A downloadable tool

Physics based vehicle addon for Godot 4.x

Features:

  • flexible
    • physics tweaking allows you to make things ranging from arcade to lite-sim
  • modular
    • pick and choose which features you want
  • extensible
    • create your own vehicle components
  • documented
    • no guessing, most variables are documented, even the ones that are not exposed/exported in the godot editor

Implemented Components:

  • engine
  • drivetrain with analogue clutch
  • basic infinite torque limited slip differential(can behave as open or locked)
  • ls-differential between differentials
  • breaks with abs toggle
  • input handler(mouse steering, keyboard, or gpad)
  • sway bar(anti-roll)
  • gear shift assist

Core Nodes/Resources

KVVehicle:

  •  helper physics functions that abstracts away some physics math
  •  anti-slip on slopes

TireResponse:

  • use curves to define tire grip response
  • handle audio response for rolling and slipping
  • 'fake' surface bumps

KVWheel:

  • responsible for applying suspension and tire forces
  • helper sub-node to visually position rest-length and max suspension travel
  • raycast or shapecast(see limitations)

Helper Nodes and extra features:

  • particle handler for common uses
  • engine sfx audio handler
  • centre of mass overwriter for visually setting the centre of mass
  • ackerman ratio helper
  • weight distributor helper - calculates rest stiffness from centre of mass position

Limitations:

  • no simracer hardware support yet - Godot can`t set force-feedback
  • godot's shapecast gets more broken the farther you get from world origin
  • since the torque forces on the tires are a feedback system that uses data from the previous frame, some wheel or engine oscilations can happen, a substep sytem is implemented and other tweakable fixes. this is not an issue for arcade games that won't use the physical drivetrain or for low mass vehicles.

Acknowledgments and similar projects

Running / Installing

The download is an example project, to install just copy addons/kv-vehicle into <your-project-directory>/addons/ godot documentation on installing plugins

This addon was developed for planet-rally

star it on github

Download

Download
kv-vehicle-24-04-23.zip 53 MB

Development log