Help Wanted

Car physics equations need – c00ler

c00ler
Junior Member

Posts: 8
From: St Petersburg
Registered: 03-27-2006
Hi for my new online game (free of course)
i need guy who will help me to finish car physic model
just some equations

anyone interested ?

HanClinto

Administrator

Posts: 1828
From: Indiana
Registered: 10-11-2004
How detailed of equations? 2D? 3D? Independent suspension? Offroad or track racing? Just wondering if you're looking for some simple approximations or a well-balanced physical model.

Thanks!

--clint

steveth45

Member

Posts: 536
From: Eugene, OR, USA
Registered: 08-10-2005
If you want the car physics to be realistic, it's going to be pretty tall order. If that is the case, I'd use one of the handful of free physics engines available. Otherwise, you can implement simple acceleration:

vector_3d velocity; // 3 dimensional velocity per millisecond
vector_3d direction_facing; //normalized
float rate_of_acceleration; // distance per second ^ 2
int frame_time; // time passed in milliseconds between since the last frame of animation
float air_friction; // friction for atmosphere (small number >0 <1)
float brake_friction; // friction for braking (larger fraction)
float nominal_speed;

//Here's some psuedo C++ code for each frame

/* acceleration */
if(accelerating) {
velocity += direction_facing * rate_of_acceleration * frame_time / 1000;
}

/* wind resistance : this can put a cap on how fast the car can move */
velocity -= velocity * air_friction * frame_time / 1000;

/* braking */
if(braking) {
if(velocity.length() * frame_time / 1000 < nominal_speed)
velocity = vector_3d(0,0,0); // complete stop
else
velocity -= velocity * brake_friction * frame_time / 1000;
}

Those will help you get started, and they are only for driving in straight line, like a drag race. The maximum speed of vehicle while accelerating in a straight line will be roughly rate_of_acceleration / air_friction. If you have a vehicle with perfect traction, you can just rotate the velocity about the Y-axis to match the direction the vehicle is facing, while it is turning. Maybe, the faster the car is going, the less of a turning angle is available. You will also have to match the (imaginary) vector_3d functionality to whatever 3D vector is included in the math library you are using.

Maybe tonight, I could come up with some theoretical equations for moving cars turning and skidding and such. Oh yeah, I probably made some mistakes, so use at your own risk.

Now, I want to make a driving game... darn!



------------------
+---------+
|steveth45|
+---------+

dartsman

Member

Posts: 484
From: Queensland, Australia
Registered: 03-16-2006
I'd be interesting in finding out how this is done too. Car dynamics have puzzled me, though I do have some papers to go through that supposibly explain it.

------------------
"But it is God who judges: He brings one down, he exalts another." - Psalm 76:7

Startup Christian Games Company Producing Mobile/PC Games/Tools

c00ler
Junior Member

Posts: 8
From: St Petersburg
Registered: 03-27-2006
thank you guys that answered me !
below link to matchcad file that i already have
http://www.racingmanager.org/straight.m
and our goal will edit edit it to get perfect car model

this file already realized and work on the web. PM me if you want link to see.
I even draw telemetry images !


steveth45

Member

Posts: 536
From: Eugene, OR, USA
Registered: 08-10-2005
Holy cow, the equations in that link are sweet. Clutch slippage?... crazy.

------------------
+---------+
|steveth45|
+---------+

c00ler
Junior Member

Posts: 8
From: St Petersburg
Registered: 03-27-2006
So anyone feel the power to continue it ?
or start from the scratch ?
dartsman

Member

Posts: 484
From: Queensland, Australia
Registered: 03-16-2006
nah, I'm scared to touch car physics atm :P

Though I will definately look into it later.

Please let us know how it goes, I'd like to know once you get it working and how you did...

------------------
"But it is God who judges: He brings one down, he exalts another." - Psalm 76:7

Startup Christian Games Company Producing Mobile/PC Games/Tools

[This message has been edited by dartsman (edited March 29, 2006).]

c00ler
Junior Member

Posts: 8
From: St Petersburg
Registered: 03-27-2006
this prototype already working
i can give a link over PM

but if you feel that its easy to start from scratch lets do it

dartsman

Member

Posts: 484
From: Queensland, Australia
Registered: 03-16-2006
yeah, i'd like to see the prototype, but I doubt I'd be any help with the coding side. Code looks very well commented, what language is it in?

I might look into vehicle physics tonight (being that it is only 8:00pm here).

------------------
"But it is God who judges: He brings one down, he exalts another." - Psalm 75:7

Startup Christian Games Company Producing Mobile/PC Games/Tools

c00ler
Junior Member

Posts: 8
From: St Petersburg
Registered: 03-27-2006
this is mathcad
i will send you a link to workig prototype over email and in PM
dartsman

Member

Posts: 484
From: Queensland, Australia
Registered: 03-16-2006
Wow!!!

Like that was crazy, I was actually expecting it more of a game :P haha, boy did that show me...

I was like... whats happening?? Then scrolled down to see the tables...

That is some brillant work there. I am for sure I wouldn't be able to help. That is well above my head. I'm kinda more into trying to get car dynamics working in a 2d/3d environment.

But wow, thats like some serious output there. Good work, I wish I could help, but not only is my car engine knowledge lacking emensly, I'd be afraid to touch those equations.

Do let me know how it goes though...

------------------
"But it is God who judges: He brings one down, he exalts another." - Psalm 75:7

Startup Christian Games Company Producing Mobile/PC Games/Tools

c00ler
Junior Member

Posts: 8
From: St Petersburg
Registered: 03-27-2006
hi dartsman
thank you for checking it.

maybe anyone other can help ?

CapnStank

Member

Posts: 214
From: Sask, Canada
Registered: 12-16-2004
Do you guys want real physics equations? I could run to my physics notes to get some stuff on friction and forces etc. if you're interested.

------------------
"The only people on Earth who do not see Christ and His teachings as nonviolent are Christians". - Mahatma Gandhi

c00ler
Junior Member

Posts: 8
From: St Petersburg
Registered: 03-27-2006
Yes CapnStank
i want real equations
and it will be very kind if you allow me to use your equations