Thank you so much for your detailed answers. I reinvestigated and rechecked every thing you said to me since the beginning, and each time i gain confidence on the fact i'm going the right way, so thanks again. It is very good to be able to say "now i dont have a doubt on the way i do this, anymore, so lets move on"
Thanks for explaining so clearly. I tried your method over mine (i calculate force/torque for each wheel right away rather than summing), but as expected it gives me the exacts same results. So i guess my calculations must be good there.
I agree, but i deactivated slip ratio, wheel angular vels around axle and any braking/acceleration force to simplify my steering behaviour research. I just apply 1*weightLoadOfCar/4 to the powered wheels for the moment. So in my case it will be only lateral forces generated right ?
I would argue with that. In your post #6, the blue arrow IS the real velocity of the tyre, which is perpendicular to the vector from CG to wheel pos, but not to the wheel's heading.
So it WILL generate both long/lat forces.
Thank you for explaining your way of using traction circle. I personnaly was ploting my curves for a normal load, applying traction circle (by croping excedent force) and then multiply by the load. The final result should be the same, but anyway i deactivated this feature right now.
I think i really need your expertise to help me search the right way, because all the maths and physics we reviewed together seems ok everywhere. I have rewritten and triple checked all physics / maths functions. I "hope" i am wrong on this, but everything really seems ok there.
So i would say the problem relies more on the car handling side of the problem.
I have tweaked a LOT of parameters recently, and i can offen "sense" the same defaults in almost every configuration i tried.
My general feelings are :
- Car seems way too much sensitive, or the total opposite. Controled drift are impossible due to very fast changes in car orientation
- Car seems to acquire way too much angular velocity, too fast
- Each time a wheeltrain acquires some force it will happily make my car oversteer/understeer dramatically fast
- Quite offen, if i go fast enough and start to oversteer in a long controled slide, small changes (gaz/brakes/steer), will cause the car to violently change heading to realign with velocity trajectory (almost instant), or to realign with previous oversteer heading.
- Car will easily spin, and then continue to travel backward
- Applying full lateral vector to front wheels when steer angle is near 30° will result in extreme car slowing
- If i have 5% more lateral traction in front wheels, the car will spin almost everytime !
- Dividing torque by 2 or 3 makes it better but still not perfect
- It is almost impossible to have the car at 30°, sliding laterraly and to control the slide movement by changing acceleration or steering. Again, things seems to happen too fast
- Very important thing i think is that the car will rarely slide laterally for a long time, as there is alway a force (front or back) that is higher and will make the car to align with direction vector one way or the other very fast
- Car is not unstable or jittering, i test all kind of situations, and the response it gave me seems always appropriate, only way too violent / not enough controlable
- No traction circle
- No weight transfer
- 1ms time step, which is small enough AFAIK
- Deactivated wheel angular velocity, slip ratio and engine (only dumb front force when i press forward)
- Drag/Air resistances (constants multiplied by worldVel or worldVel² to have some damping), very negligeable
- Regrouped wheels to middle of car (no X), as it changes almost nothing in behaviour, to avoid eventual calculation errors
- Car mass : 1500Kg
- Car Weight / Tire : 3700
- Car inertia : 700
- Car CG is centered, front wheels are 2m front and back wheels 2m back
- Car total length is 4m
- Pacejka lateral curve is like this :
this.slipAngle = [0, 1.0, 3.0, 5.0, 9.0, 11.0, 20.0, 30, 40, 50, 60, 90]; this.lateralForce = [0, 0.7, 0.9, 1.0, 1.1, 1.15, 1.20, 1.15, 1.1, 1.0, 0.9, 0.80];
When i compare this to your racing game K_J_M, (first i am telling me that it is a very nice game you have made ^^), and then the first car available in demo seems to gain some +/- angle easily, then it slides a little to prevent lateral motion, and it seems really soft and smooth. I can use all parameters i want, i still not have succeed to have this kind of nice feeling.
My point of comparison are recent casual games (like death rally), the KJM racing game, my game when i use non-realistic physics to try to have a nice behaviour, and ultimately games like GT, Grid or NFS series. So from most arcadish to most realistic, i still miss a big something to make my car controlable as those games do.
For your implementations, as soon as you had lateral pacejka and base the base physics right, did you managed to create a fun, controllable car right away ? Or did it recquire some more hacks/forces downscaling or real physics features stuff (like front slip ratios) to allow for controled drifting ?
For example the small demo you shared on the "car headache" thread started by marci, if i remember correctly, you apply angular velocity right away as we press left/right. And you scale the lateral pacejka to front speed, too ? Is it because the demo is simple, or is it because it just works better that way ?
I'm shooting a video or two to try to illustrate the fact the car behaves quite good until it spins, and the "trajectory auto-realign" stuff i was talking about.
I look at my samples again and again, but my intuition gives me nothing on this, i feel like i have the basics right and i have tried changing almost every value i have here and here without enjoyable results...
Video 1 : You can see in the second curve the weird alignment thing i was talking about.
Front / Rear lateral forces are the same.
Interesting values on the chart. Last run in slow motion.
The lateral force is simply slipAngleInRads * 1 * weightLoad
All others parameters are as i have explained above.
Except for that, i can have some controlled drift with a linear slipAngleInRad * someConstant force output.
Video 2 : An oversteer manoeuver with the pacejka curve i posted just above.
The front lateral force is 5% higher (multiplied by 1.05).
Along the video i am varying various parameters (lateral output magnitude, trying to accelerate in cornering to help, setting front/rear lateral force to equal, or back lateral to 95% of front).
It demonstrates that very few parameters variation can cause very fast spin vs. successful cornering. No controlable drift with those parameters...