• Create Account

### #ActualEdy

Posted 12 October 2012 - 04:11 AM

At this level, it's all about game and fun with an acceptable level of physical accuracy, and thus as everything in game programming it's all about cheating as much as possible. So there ARE miracle recipes as long as you are not a professional in aero dynamics or in suspension geometry setups.
Later when we work out everything about differentials and tyre simulation those magical solutions will disappear.

I am not even talking about realistic simulation, i am talking about something really simple, the basics.
Beside the fact that marco monster is 10 years old, it cover everything so well, its just the best way to start in my opinion.
And gamedev forum should be there to help you to answer question on a particular point that you don't understand for example.
Of course, its always interesting to see some reading on car physics, a subject that passionate all of us, but the fact of melting all kind of question and answer together make it really confusing and not that easy and enjoyable to read IMO.

Anyhow.. you seem to want to complicate things a lot .. they are REALLY simple:

Having a solid and well tested RigidBody class with addForce, addForceAtPos, addLocalForceAtPos, addLocalForceAtLocalPos and so on, member functions should be the first step in your simulator development ;)

That's exactly my ongoing work: nailing down the basics of vehicle simulation in a way that could be easily understood and used by anyone. Yes, there are really simple ways of doing pretty realistic vehicle simulation. Yes, there are "miracle" recipes, but they are not so miracle, they are just some simple formulas combined in the proper way. And YES, working on differentials, tire simulation, etc could still be simple and comprehensive.

Hopefully a good tutorial should be the result of this work (unless I'm proven terribly wrong )

If that is what you mean, then we agree ! Either way, please explain further, the "no calculation" thing.
As all front/lateral forces get eventually multiplied by the wheel load, we can say getting the wheel load right is maybe as much or even more important than getting the initial values right. I had much trouble with that, and honestly for this particular subject i kind of miss examples. When i look at a big pickup truck i can see the springs getting highly compressed. Marcos state something like "xxx acceleration > formula > xxx Fz on back wheels, so you accelerate faster". The fact he didn't talked about car suspesions made me think :
It is not a very important part of the simulation (VERY wrong i think, now)
Suspension or no, i CAN get the force he is talking about, eventually, and maybe suspensions will just make the weight shift process a little slower (i guess it is really wrong too).

No calculation: you set up a vehicle as a rigid body mass suspended on 4 damped springs. If you drop that vehicle from 1m on a surface, it will fall down and when the springs make contact with the surface, they will compress and expand while supporting the mass of the vehicle. Eventually, the damped springs will absorb all the energy and the vehicle will stand still. At this point, the physics engine has done everything for you, you haven't had to code anything yet.

The physics engine allows you to access the 4 contact points with the surface, as well as all related information on each one. This includes the position, normal vector of the surface and the downforce, that is, the force supported by each spring at any time.

Now we start to code. You instruct the physic engine to apply a force to the rigid body of your vehicle in the positions of the contact points (AddForceAtPos). The engine will then simulate the effect of that force at that rigidbody, and what happens when you apply an off-center force on a rigid body? It causes rotation! (torque). The engine will take care of the calculations for simulating that behavior. So imagine that the force you've just applied is located at the contact point of one of the rear springs ("wheel") and is pointing forward. It will cause the rigid body to want to rotate backwards. But the rear springs will counter act this trend by compressing (and thus exerting more force). At the same time, because of the rotation the front springs will expand (exerting less force). Here you have your weight transfer, and all you've done is "AddForceAtPos".

The physics engine gives the downforce on each contact point. So you can use this value for calculating the magnitude of the force you will pass to "AddForceAtPos".

+1. We need some real life values with a known-setup car to help us.

Here are some gems from Kunos (of course ;) ). These real world data are really valuable as they give us a reference of the values we should use and expect to see in the results. Maybe they should go to the first post?

I found a ratio of 1.1 (Fx=Fy * 1.1) is a good starting point.
..
For tyres you are looking into the 200,000 N/m spring rate and a 400 N/ms for damping.
..
It depends a lot.. a typical road tyre will give you 1.0 - 1.1 G.. with load sensitivity and all you should get close to 1.0G on a skidpad. A normal road car with 1.0G lateral acc is considered VERY good (ie. the BMW Mini scores a tad less than 1.0G and is considered a very good handling car).
..
Continuing the grip references, for a high performance road tyre (high end supercars) you see 1.2 - 1.3
Racing slick tyres range from 1.4 to 1.9 depending on compound.
..
The more load on the tyre the more the friction coefficient goes down. A tyre that can do 1.2 at 1000N, might give you 1.1 at 2000N . That is why the loaded tyre will be the first one to "break" grip.

### #1Edy

Posted 09 October 2012 - 05:55 AM

At this level, it's all about game and fun with an acceptable level of physical accuracy, and thus as everything in game programming it's all about cheating as much as possible. So there ARE miracle recipes as long as you are not a professional in aero dynamics or in suspension geometry setups.
Later when we work out everything about differentials and tyre simulation those magical solutions will disappear.

I am not even talking about realistic simulation, i am talking about something really simple, the basics.
Beside the fact that marco monster is 10 years old, it cover everything so well, its just the best way to start in my opinion.
And gamedev forum should be there to help you to answer question on a particular point that you don't understand for example.
Of course, its always interesting to see some reading on car physics, a subject that passionate all of us, but the fact of melting all kind of question and answer together make it really confusing and not that easy and enjoyable to read IMO.

Anyhow.. you seem to want to complicate things a lot .. they are REALLY simple:

Having a solid and well tested RigidBody class with addForce, addForceAtPos, addLocalForceAtPos, addLocalForceAtLocalPos and so on, member functions should be the first step in your simulator development ;)

That's exactly my ongoing work: nailing down the basics of vehicle simulation in a way that could be easily understood and used by anyone. Yes, there are really simple ways of doing pretty realistic vehicle simulation. Yes, there are "miracle" recipes, but they are not so miracle, they are just some simple formulas combined in the proper way. And YES, working on differentials, tire simulation, etc could still be simple and comprehensive.

Hopefully a good tutorial should be the result of this work (unless I'm proven terribly wrong )

If that is what you mean, then we agree ! Either way, please explain further, the "no calculation" thing.
As all front/lateral forces get eventually multiplied by the wheel load, we can say getting the wheel load right is maybe as much or even more important than getting the initial values right. I had much trouble with that, and honestly for this particular subject i kind of miss examples. When i look at a big pickup truck i can see the springs getting highly compressed. Marcos state something like "xxx acceleration > formula > xxx Fz on back wheels, so you accelerate faster". The fact he didn't talked about car suspesions made me think :
It is not a very important part of the simulation (VERY wrong i think, now)
Suspension or no, i CAN get the force he is talking about, eventually, and maybe suspensions will just make the weight shift process a little slower (i guess it is really wrong too).

No calculation: you set up a vehicle as a rigid body mass suspended on 4 damped springs. If you drop that vehicle from 1m on a surface, it will fall down and when the springs make contact with the surface, they will compress and expand while supporting the mass of the vehicle. Eventually, the damped springs will absorb all the energy and the vehicle will stand still. At this point, the physics engine has done everything for you, you haven't had to code anything yet.

The physics engine allows you to access the 4 contact points with the surface, as well as all related information on each one. This includes the position, normal vector of the surface and the downforce, that is, the force supported by each spring at any time.

Now we start to code. You instruct the physic engine to apply a force to the rigid body of your vehicle in the positions of the contact points (AddForceAtPos). The engine will then simulate the effect of that force at that rigidbody, and what happens when you apply an off-center force on a rigid body? It causes rotation! (torque). The engine will take care of the calculations for simulating that behavior. So imagine that the force you've just applied is located at the contact point of one of the rear springs ("wheel") and is pointing forward. It will cause the rigid body to want to rotate backwards. But the rear springs will counter act this trend by compressing (and thus exerting more force). At the same time, because of the rotation the front springs will expand (exerting less force). Here you have your weight transfer, and all you've done is "AddForceAtPos".

The physics engine gives the downforce on each contact point. So you can use this value for calculating the magnitude of the force you will pass to "AddForceAtPos".

+1. We need some real life values with a known-setup car to help us.

Here are some gems from Kunos (of course ;)). These real world data are really valuable as they give us a reference of the values we should use and expect to see in the results. Maybe they should go to the first post?

For tyres you are looking into the 200,000 N/m spring rate and a 400 N/ms for damping.

It depends a lot.. a typical road tyre will give you 1.0 - 1.1 G.. with load sensitivity and all you should get close to 1.0G on a skidpad. A normal road car with 1.0G lateral acc is considered VERY good (ie. the BMW Mini scores a tad less than 1.0G and is considered a very good handling car).

Continuing the grip references, for a high performance road tyre (high end supercars) you see 1.2 - 1.3
Racing slick tyres range from 1.4 to 1.9 depending on compound.

The more load on the tyre the more the friction coefficient goes down. A tyre that can do 1.2 at 1000N, might give you 1.1 at 2000N . That is why the loaded tyre will be the first one to "break" grip.

PARTNERS