Car/racing sims in open source Godot engine

I did some research on the state of vehicle physics implementations for the open source Godot game engine, and decided to dump my results in a thread here so others could see it as well. Would love to keep this first post updated over time as things evolve, so let me know in comments below as you find new things.

The biggest obstacle standing between Godot and a true driving or racing sim as we know it? No built-in wheel input or force feedback support in the engine yet. Only controller and rumble support for now. Don't think the missing pieces would be terribly difficult to implement though: for example, someone created a FFB plugin for the Unity game engine and open-sourced it. Dechode (who is also working on vehicle physics) is working on getting FFB working via SDL2 in Godot – see Godot-FFB-Test and godot_ffb_sdl on GitHub.



GDSim
by Wolfe
Active development


  • Detailed drivetrain model including multiple differential types, clutch torque effects, and automatic shift logic
  • Custom suspension and tire model accounting for details like suspension geometry and tire flex, including a live display of forces (Ctrl+F)
  • Night driving/racing and more, with 24-hour lighting, weather options, and simulated cycles for the sun, moon, and stars
  • Up to six vehicles with AI drivers
Not open source, but the developer (Wolfe) has detailed discussions of how he implemented the physics and AI driving (including some code snippets) on gtplanet: https://www.gtplanet.net/forum/threads/gdsim-v0-4a-autocross-and-custom-setups.396400/ Sounds like he might be open to sharing the code as well if you asked him.

For a video giving an idea of what the sim is like, see:




Godot-AdvancedVehicle
by Dechode
Open source, MIT license, last updated Jan 27 2022


Source code:
  • RWD, FWD and AWD drivetypes available
  • 3 different tire models to choose from: simple pacejka model, brush tire model and one using godot curves.
  • Tire wear
  • Fuel consumption using BSFC
  • Torque curve for the engine
  • Simple engine sound
  • Choose between preloaded limited slip diff, open diff and locked diff/solid axle
  • Manual clutch with adjustable clutch friction force
  • Manual gearbox
  • Different surfaces have different friction
Based significantly on Wolfe's gtplanet tutorial above.

Dechode also has created a simpler vehicle sim implementation and open sourced it here:



Godot Engine - Advanced Vehicle Physics
by Thales Krüger
Active development


Not open source, paid to support development costs
https://sabudum.*******.com/l/PsTbK
  • Fully simulated vehicle suspension
  • Fully deformable vehicle body
  • Deformable vehicle chassis
  • Axles bend and twist
  • Parts can fall off the vehicle
  • Simulated RPM, torque and tire forces
  • Gearbox and differential simulations
  • Basic Vehicle Health System
  • Engine and Tire sounds
Features to come:
  • Fully animated suspension meshes
  • Complete Vehicle Health system
  • Full sound system
  • Full particles system
  • LOD system
For an idea of the sim, see:




Godot VehicleBody Demo project
by BastiaanOlij
Open source, MIT license, not actively developed


Source code:

A project from a YouTube tutorial series on how to import and setup a car, build a track, and add VR in Godot:

Judging by how often others reference this guide, it contains helpful hints and tricks for working in Godot. Uses Godot's (rather weak) default VehcleBody physics implementation.



Ghost Racing VR
by James Stanley
Not open source, no updates since 2020



Oculus Quest VR game to drive a Caterham-like car around a version of Cadwell Park derived from Terra21 and Jim Lloyd's version here on RD. James put up two blog posts about his efforts:
Here's a video of the game:




Godot-6DOF-Vehicle-Demo
by Saitodepaula
Open source, MIT license, no guarantee of future updates



Demo using Godot Engine Generic 6DOF joints to make a fully working, physics based vehicle – a monster truck. The physics and joints setup is exactly the same as used in the racing game TrackMaster: Free-For-All Motorsport.
  • Completely physics and joints based
  • Body and wheels are regular rigid bodies. This has the advantage of the vehicle behaving in a completely free way, with no physical constrains: it can roll, topple and react to any other static or rigid body.
  • Eventual moving parts you may want to add, like doors and bumpers, can be added in the same way, with rigid bodies and 6DOF joints.
  • The physics behaviour (suspension travel, acceleration, top speed) needs no code. They are all 6DOF joints parameters set in the editor. In the demo, acceleration and top speed are set inside the code for convenience, but it doesn't need to be this way.


Other projects

Custom Raycast based vehicle implementation for Godot 3.x

The raycast elements serve as a basis for any type of land vehicle that needs to be suspended by "springs" and propelled using driving force applied against the ground. This system primarily allows for the simulation of wheeled, tracked and hover vehicles with as many propulsion elements as needed.

Godot "Realistic" Car Physics (g-rcp)
Raycast-based "realistic" car simulator

godot-raycast-vehicle
Drop-in replacement for the built-in VehicleBody / VehicleWheel nodes in Godot.

carphysics2d
Not specifically for Godot. This is a Javascript adaptation of the ideas found in Marco Monster's often-referenced car physics paper and demo. His original paper has been archived here. His demo code, written in C, was archived by a user on gamedev.net here (from this thread.) A Java version was archived here.

József Tarsoly's WIP Godot car sim
No code, just a couple YouTube videos as evidence it exists

Luis Cobo's WIP Godot car sim
No code, just one Jan 2022 YouTube video as evidence it exists
 
Last edited:
Great article and thanks for the mention! Also, i am working on a game / sim that i plan to open source, once it gets to a somewhat playable state. I will let you know when that happens:)
 
Great article and thanks for the mention! Also, i am working on a game / sim that i plan to open source, once it gets to a somewhat playable state. I will let you know when that happens:)
My pleasure! That's fantastic. :) Yes, please do keep in touch and let us know how things develop. Excited to eventually see what you're thinking about/working on.

And who knows, if you need some help, there are likely people here who'd be willing to chip in. For example, I'm admittedly a non-coder, but would be happy to help with design, documentation, bug triaging, testing, or other aspects like that if/when you need it.
 
Last edited:
Back
Top