SERIES: Driving Simulator Workshop (Mirror)


In 2020-2021, I wrote a tutorial explaining the first steps to assemble a simulator like GDSim yourself in Godot, sharing fundamental concepts and sources that helped me. Here I will collect a mirror of those posts.

Stay tuned, because new devlog posts will follow! ๐Ÿบ๐ŸŽฎ

This tutorial series is reposted as-is. There are no errors I'm aware of, but it would be different if I wrote it all again. I'm copying it here for preservation and because it makes sense. ๐Ÿ™‚

Posts:

I. Suspending a RigidBody
II. Suspending a RigidBody, Part 2
III. Rays Go Round - Lateral Force
IV. Rays Go Round - Adding Things Up
V. Start Your Engines
VI. Brushing Up and Misc. Details

General Formulas:

# Hooke's Law for springs
spring_force = stiffness * compression
# Damping factor added to Hooke's law
spring_force += damping * (compression - previous_compression) / delta
# Slip ratio
slip_ratio = (angular_velocity * radius - velocity) / velocity_magnitude
# Pacejka "magic" tire formula
Force = Load * Peak * sin(Shape * arctan(Stiffness * Slip - Curvature * (Stiffness * Slip - arctan(Stiffness * Slip))))
# Rolling resistance
roll_resist = 0.005 + (1 / pressure) * (0.01 + 0.0095 * (velocity / 100)^2)
# Torque and the moment of inertia
torque = moment_of_inertia * acceleration
acceleration = Torque / moment_of_inertia = delta_velocity / delta_time
delta_velocity = delta_time * torque / moment_of_inertia
# Moment of inertia for a solid disc
moment_of_inertia = 0.5 * mass * radius^2

Sources:

How to Build a Racing Game (Jake Gordon) -- Not super relevant here, but offered if you'd like to start where I started. ๐Ÿ˜„
Car Physics for Games (Marco Monster) -- A seminal source. Excellent place to start...so long as it remains online. (Check out the date!)
Space Dust Racing UE4 Arcade Vehicle Physics Tour (Space Dust Studios) -- Video overview of the raycast suspension concept.
Pacejka '94 Parameters Explained (Edy) -- Deep dive into Pacejka parameters, with a collection of more- and less-helpful example values.
Tyre Dynamics (Racecar Engineering) -- Overview of fundamental concepts in tires.
Unity Drift Simulator Tutorial (NoCakeNoCode) -- A comprehensive example in Unity's programming language, which inspired my drivetrain simulation
Combined Slip Tire Models (Imam) -- MATLAB scripts for both tire models discussed here

Get GDSim

Download NowName your own price

Leave a comment

Log in with itch.io to leave a comment.