Carnage3D - [yet another] GTA1 remake project

Talk about any other games here
User avatar
JernejL
Hitman
Hitman
Posts: 123
Joined: 21 Feb 2010, 22:03
GH nick: RedShirt

Re: Carnage3D - [yet another] GTA1 remake project

Post by JernejL »

jericho wrote:
10 Sep 2020, 09:25
JernejL wrote:
10 Sep 2020, 07:35
does box2d have any kind of support for top down vehicles? can it get velocity at point on body and apply force on a point?
Yep, disabling gravity force along Y axis gives "top down" mode.
What I am implemented at this point is: each vehicle is single rigid body with dimensions in meters (1 map unit equals 4 meters). Mass of the body I take directly from style data, I assume that value in kilograms. Applying forces, impulses and torque on it gives some driving-like mechanics.

Seems like a good start, i assume you already went thru these:

http://www.iforce2d.net/b2dtut/top-down-car/
http://domasx2.github.io/gamejs-box2d-car-example/
https://github.com/signalsin/Racer

One thing needing to be done is that you model each wheel on the car, so maybe next step is to figure out where tyres should be placed relative to center of body. also, does box2d support off-center mass for body?

So.. figure out how Drive Wheel Offset, Steeringwheel Offset place tyre in car, probably similar to doors (they just specify offset from center of body? )

User avatar
jericho
Mugger
Mugger
Posts: 19
Joined: 09 Sep 2019, 20:03

Re: Carnage3D - [yet another] GTA1 remake project

Post by jericho »

JernejL wrote:
10 Sep 2020, 10:31
One thing needing to be done is that you model each wheel on the car, so maybe next step is to figure out where tyres should be placed relative to center of body. also, does box2d support off-center mass for body?
The first thing which i've tried is was adding "true" wheels as separate rigid bodies attached to chassis via joints. It was okay more or less, though I doubted whether it was really necessary, seems there was no wheels simulation in gta1. So I decided to get rid of wheels and make it more simple.

Didn't try to set custom center of mass yet, but it seems Box2d supports this.

User avatar
JernejL
Hitman
Hitman
Posts: 123
Joined: 21 Feb 2010, 22:03
GH nick: RedShirt

Re: Carnage3D - [yet another] GTA1 remake project

Post by JernejL »

You might get better behaviors with separate tyres, things like j-turns and handbrake turns might perform poorly or impossible without simulating tyres separatedly as they are product of each tyre functioning on the body in different way.

You just need to catch similar feeling to gta1 for it to be good and fun, and then have some method to choose your physics simulation engine values approximately from gta values.

I think with today's technology it's hard to reproduce rather poor mid-90s physics math, that thing ran in fixed-math, especially the ridiculous and glitchy collision detection & response :)

Post Reply