I'm glad to read an answer to my topic
So i guess the new subject is "how to make it both physics-based and and fun", eg : have some sort of NFS cornering style. Or at least GT with a very controlable car.
Thanks for the precision
The Pacejka MF, takes KILO NEWTONS as input load, so your 1N is actually 1000N!
Yes, i realized the same thing. I have come to the conclusion that physics-based car SHOULD implement some sort of weight transfer, as ultimately every force get scaled by weight transfer.
I was twiddling with stability and controlled drifting and such in the weekend and realized that the weight transfer has significant importance in cornering and control, which makes sense, but also confuses me why anti-roll bars help stabilizing in corners
For anti-roll bars, their main effect should be to prevent the car to roll in high speed cornering ; in 3D physics, if you generate a lot of lateral forces during cornering, the car inertia makes it want to roll : http://www.euclideanspace.com/threed/games/examples/cars/cornering/car2cornering.png
I think from a 2D point of view, that anti-roll bars will help to prevent too much weight to go left/right of the center of mass during cornering too, which can have some effect in tires grip. Altough, i have read, lateral weight transfer is generally a good thing, as it gives more grip to the tires who needs it. But it must become a bad thing past some critical ratio value i guess.
What i can tell you is what i know (almost) for sure abour car control. In a so primitive state as we are, the things that would tend to have the more effect on the driving feeling would be :
- The wheel friction (long/lat, etc)
- The wheel springs (weight repartition entirely relies on them)
- The control system intelligence (without intelligence even a very fun/arcade car might be unplayable without very carefull throttle/steering management from the player)
I feel like we are more at step 1. Successfully going to step 2 might be quite complex, and maybe we should do some arcadish algorithms to handle weight transfer and its effects the way we want it before blindly implement yet another "real life" physics formula.
I realized those past days that input post-analyzing is maybe even more critical that correct lateral/long forces implementation. If you look at almost every car game, at high speed the wheel is steering of 2-3° against 45° at very low speed. Some games calculate the peak of lateral grip to prevent the player from going besides grip peak. Same goes for front/brake inputs.
It's not ESP or anti lock system at this point, it is more like the driver "listenening" to what the car he is sitting in has to "say". I'll try to come up with some formula to calculate max steer angle in real time to see how much it helps during cornering.
What kind of lateral friction do you apply ? Because i tend to have some sort of controled lateral drift quite easily with :
Without weight transfer my car was incredibly unstable at high speed (>100km/h), even with a very small (2-3°) steering angle it spun around instantly.
a) no weight transfer
b) a linear force returned for cornering forces : slipAngleInRadians * 5 for example (with a 1500kg car, so it is around 3500N for each tire)
I shooted this video to show you what i am saying.
Without weight transfer, i tend to have this behaviour when the lateral forces curves & weight load are == for the 4 wheels. With "real" pacejka curve, i get a lot of understeer after the peak, so i have to limit the steer angle of the wheel.
Sorry for the low framerate it is actually smooth and nice to see (no teleporting). I'm recording with VLC which gives me a not that good framerate.
Adding rear/front (no lateral) weight transfer i get :
- Great instability if turning + braking. Note that braking occur naturally because of front wheel lateral friction, "natural" air/roll friction, + eventually real driver input braking. Anyway, my car spins really fast even with a very small amount of weight transfered from the rear to the front.
- Increased understeer effect during high speed cornering, especially if i do not limit steer angle.
- Theorically controled drift could happen, but in reality car spins way too fast for the driver to have any time to react. Even in slow motion, if you have time to react, the situation evolves too quickly. But the physical facts & consequences are not illogical to me.
I don't know if my experience is helping or confusing you. (helping, i hope).
I remember using 5% more traction (linear *1.05 multiply) for front or rear wheel train, successively. More grip to rear = understeer and more grip to front = oversteer. Nice to play with without weightload, but as soon as weight get transfered it makes turning even more catastrophic.
My intuition here tells me, the great yaw velocity comes from the lack of balance between front/rear tires lateral response. *1 or *10k is not very important as long as everything scales at the same time. If the lateral force balance comes to F70%/R30%, for example, the car will do spin turns very fast.
When i analyse those ratios at the times the car seems to be in a small oversteer situation (which is a feeling players tend to like), the front wheels quickly (almost instantly) goes from 90% to 51% of the total generated lateral forces in early cornering. If you want to prevent the car to spin, the lateral force of the rear wheel must quickly go over 50% to keep the car heading controllable (in the above video example, the rear wheels go to 51% of the total lateral force generated to "counter" oversteer). So, looking at the problem from this perpective might help you to adjust parameters to stabilize things. It helps me to think clearly at "what i want", anyway.
I know we can use different traction circles/curves for front/back tires, but i have seen very nice drifting behaviour in Edy's car physics which seemed to apply the same curves for every wheel. So i would (will) try to get drifing whithout messing with this for now.
Actually i am wondering if lateral weight transfer could greatly influence the wheels in the outside of the turning lane, in a maner that would add more stability to car yaw, and eventually help us to get a nice turning feeling. What is your feeling about this ?
Adding some load transfer helped, but it was still oversteer without throttle. With throttle it was just understeer, but no inbetween... So I cannot play with brakes and throttle to control drifting
Same thing here. Worse : if i try to limit traction circle to have throttle/braking to allow for controled drift, i go from normal high speed understeer (due to high speed, despite small deceleration) to instant oversteer because throttle consume too much traction budget. I have the feeling i want the 100% operating range of my drifting to be limited to a very small range of force difference.
Looking at Edys vehicle physics curves in real time, i learned you can saturate front wheels without starting to spin instantly. I still have to figure out if that is dued to springs, more complex formulas, or to input control and magic things.
My weigth transfer formula is:
Here is mine , it looks to be the exact same. Anyway, weight transfer is quite easy to check from real life data available on internet. The problem does not lie in the raw calculations rather in the fact that spring must have a great influence on that, too (i guess).
For 4 wheel weight transfer, I'm not sure if this is the right thing to do:
Just transfer along axles based on lateral acceleration.
...the same for the rear wheels...
I was going to do the same thing. You can indeed get lateral weight transfer the exact same way you get front/rear. The problem is you have 2 differents values for 4 wheels, so it is 8 values. How do you combine that ? I was thinking about this :
For example :
- static load = 3500N / wheel
- front/rear load = 4000N front / 3000N / rear (decelerating)
- left/right load = 5000N left / 2000N right (high speed turning)
- i think we SHOULD take care of angular velocity in lateral weight transfer, but i haven't looked into it.
And 15% of the weight goes from rear to front.
I would say it give me for the different tires :
- FL : 3500 + 3500 * (+0.42 + 0.15) = 5495
- FR : 3500 + 3500 * (-0.42 + 0.15) = 2555
- RL : 3500 + 3500 * (+0.42 - 0.15) = 4445
- RR : 3500 + 3500 * (-0.42 - 0.15) = 1505
I think those weight repartition values would produce very unstable car (yawspins), but i'll try it anyway.
I'm not entirely sure how/why it helps, what do you mean by jacking force exactly ? I know it has something to do with suspension, but i havent really looked into in ATM.
Adding some jacking force helps a bit, but still not the result I expected.
h_roll_center = roll center height from ground
I tried to divide weight transfer valye by 250, 500, 1000 to simulate "time to reach the calculated weight", it helps, but still, weight transfer has dramatic effects on behaviour.
I really don't know, and i really want to know ! As i said, suspension seems to be a critical part of how a car can be handled.
Maybe I'm mixing up things, or should I implement a proper suspension model, where all spring and dumping forces do all the weight transfer and the formula above is not needed at all?
Be sure you are using the proper wheel distance to CG. If i have more weight to the front, the car easily align the front in the turns. Even when CG is only closer to front of a few cms, the effect is immediatly noticeable. As with traction, even a few % changes have great consequences.
I was also playing with car settings, and it seems a front engine car (60:40 weight balance to the front) is more controllable than a mid-engined (40:60) which should not be.
AFAIK, front engine cars are easier to handle, as they can easily turn compared to rear-mounted engines car which can be tricky to handle during oversteer situations as the back of the car want to go to the front (easier car spins). So i guess you're experiencing something which is good.
But with unstable car turning due to a few % changes in repartion of mass, if you are braking with a front mounted engine, you will obtain even wore oversteering.
In facts, all those things leads me to think that my main problem is the effects so small ratios changes are producing. Dramatical effects. Everything should be WAY more stable even with poor wheels/suspensions systems.
So the right question is what should i do (maths shortcut or real physics) to improve my car stability... ?
My currently strategy is :
- Intelligent analysis of player inputs (ideal max steer angle/throttle ...)
- Gently decreasing force when coming closer to traction circle edge (when i'll re-introduce it)
- Try lateral weight transfer to if it improves/worsens car handling during high speed turns
- Maybe add a "time to build up" to generated forces. I have read, in reality a tire can take 250ms to really produce the max force it can bring. But i'm afraid it will do counterbraking and such things totally impossible to handle.
Extreme measure i might try if results are not good enough in a few days :
- Directly rotating velocity vector of the car in some situations (i have to define situation+angle, help can be brought by KJM as it seems he is doing it in his game)
- Limitating max torque / angAcc / angVel of the car
- Artificially prevent car spins (eg: if rear wheels go to 55% of lateral force + the car has some important yaw velocity, introduce some mechanism that would stabilize it)
- Limit weight transfer to a VERY small ratio
- Use a linear pacejka curve
I'm very interested by your experience and future answers