I made some updates for my Godot native car project, now with realistic wheel slips (Pacejka model), powerslides, drifting and fish tailing.
Video:
Enjoy!
I made some updates for my Godot native car project, now with realistic wheel slips (Pacejka model), powerslides, drifting and fish tailing.
Video:
Enjoy!
That’s so cool! I have questions!
I feel like those techniques have so many applications beyond cars.
Looks fantastic. What are the basic challenges when using the physics (Jolt) engine in Godot? I am curious more about the motion, braking, steering/side slip and traction, not as much as the body crash/deformations. Thanks!
Great progress !
Your car physics pack a punch !
That car damage and deformation looks impressive!
Hi! I made a custom node-link based approach, built on Jolt.
Marks: they are dynamically created meshes on the top of the contact surface
Hi! I’m using bare bone parts of jolt, ie. calculating and applying forces myself. It gives me more control.
Hmmmm…. Donuts!
Great work on this!
How do you solve the low-speed instability of Pacejka’s magic formula? I use two models: Pacejka for high speed and a basic implicit slip-based friction model for low speed. However, I still run into some instability at near-zero velocity and micro-jitter that causes the vehicle to slowly slip from slopes.
Not OP, but what I’ve done in my own Godot Vehicle Demo is to smoothly transition between the slip-model and a constant value based on the velocity. The argument for the constant is that a tire that’s barely moving should basically have perfect grip.
Here’s the code I used [C#]:
// Edge case: Quantized slip ratio as a result of numerical instability at low velocities.
float thresh = 1f;
if (velocity.Length() < thresh)
slipRatio = Mathf.Lerp(1f, slipRatio, velocity.Length() / thresh);
I’m not sure what OP did to solve this though. I guess I’m curious about that as well.
For the singularity I divide slip by a fixed reference speed instead of wheel speed, so it never blows up near zero. The creep is the real problem though. Any velocity-based friction gives zero force at zero velocity, so gravity always wins a little, and if you crank the gain to fight it you get jitter instead. What fixed it for me was pushing back against gravity directly: each wheel cancels its share of gravity along the slope, clamped to grip. Then when the car is braked and nearly stopped I pin the contact patch to an anchor and spring it back, basically a crude bristle model. Two details made it actually stable. The damper is clamped so it can never remove more than the wheel’s own momentum in one step (otherwise it overshoots every frame, that was my micro-jitter), and the spring has about a 1 cm deadband so contact noise doesn’t turn into a slow drift. Also blend between your two models over a speed range instead of a hard switch, since near the threshold you cross it constantly.
Not OP, but I was dealing with the same issue myself with my own custom car physics, and the solution in this video helped me figure a way out. Sharing with the hope that it helps others.
Very impressive work! The damage system looks amazing especially.
Thank you!![]()
Thank you! Great explanation
Thanks a lot! I think I get it now