Skip to content

TheDuckCow/godot-road-generator

Repository files navigation

Godot Road Generator

A Godot plugin for creating flexible 3D highways and streets with traffic support

Join our discord Patreon GitHub License Latest Release GitHub commits since latest release (dev)

Version Support

⚠️ This project is not feature complete yet!

See upcoming milestones.

Branch Plugin version Godot Support
main 0.9.0 4.3+
dev Next release 4.4+
godot4.3 0.9.0 4.3+
godot3 0.6.0 3.5-3.6

The main branch always matches the current release, which is why main may look inactive. All new development occurs in the dev targeting the Godot version listed above. When a release is ready, the dev branch is merged into main.

What problems this addon solves

Without this plugin, Godot users have a few ways to create roads:

  1. Use a CSGPolygon following a path
    • Simple to use and requires no plugins, but has many limitations
    • You need a custom material for every lane combination (1 way street, 2 lane road, multi lane highway)
    • No way to transition from one lane count to another
    • No easy way to create intersections without fiddly geometry placement
    • Largely impossible to avoid mesh gaps between different segments of CSG nodes, and inherent limitation
  2. Hand-model roads in a 3D modelling software
    • This requires additional skills
    • Not being dynamic, greatly limits the iterative nature of game development
    • Additional file and project management
  3. Use an asset pack that comes with Road Segments
    • Typically limited to square-tile road layouts
    • For non grid-based packs, you then have to deal with how to properly line up track pieces
    • Hard to customize the pre-baked materials to fit another visual styles (back to point 2 above)
  4. Write code to generate custom geometry
    • It should go without saying, this is extra work! And this is exactly what this plugin aims to provide

In addition to each point above, each scenario requires you to design your own AI traffic system to follow your roads. Furthermore, even when comparing to road generators for other game engines, they lack features to create fine tuned lane shapes such as dynamic lane changes and settings based on discrete cross-sections. They also tend to focus on editor creation and lack functionality necessary for in-game, procedural use cases.

High level Features

Feature Demo
Cross-section based geometry. The many settings of RoadPoint's smoothly interpolate from one point to the next. Lane-control gizmo adjusts lane count, per RoadPoint or (holding shift) per entire RoadContainer. roadpoint widget
RoadContainer scene organization. Group sibling RoadPoints, and snap together with other RoadContainers. Save a RoadContainer to a scene for reuse. Containers
RoadPoint inspector panel. Define lane width, shoulder, and more. Hold shift to affect all RoadPoints within same container. inspector panel
Click-to draw with collision snapping. Fine tune placement after using native 3D gizmo as needed. click to draw
Procedural intersections. Dynamically connect RoadPoints to create RoadIntersections. Supports non-planar setups. (RoadLane/edge curve support coming soon) procedural intersections
Prefab intersection RoadContainers. Snap together built-in four way, three way, and highway on/off ramps with ease. Prefab containers
Terrain3D integration. Flatten terrain to meet the level of your roads with options for margins and falloff. Format extendable for other terrain generators too. Terrain3D integration
Multi-material support. Separate surface and underside materials per RoadContainer. Source trim-sheet provided to guide creation of customized materials. Material swap
Auto-generated AI paths. Enable for automatic RoadLane placement, or hand place in your scene. Use the RoadLaneAgent helper to help agents follow roads, handling transitions between segments. AI path demo
Decoration edge curves. Once enabled on a RoadContainer, add CSG path geometry or make your own scripts to instance assets along left, right, and center curves. Decorations demo
Runtime-available functions for procedural use. Operations apply on single RoadSegments at a time to be performant. Procedural demo
Export RoadContainers to gLTF/glb. Output sections of your road network to edit further in a 3D software, without exporting your whole scene. Export road mesh
Support for custom-made meshes. Turn off "Create Geo", then drop in your own meshes + colliders. AI paths remain connected. Custom road meshes demo
GDScript-only (for now). No extra compiling or dependencies to worry about. GDScript only

Credits

This addon is distributed under the MIT license.

It was developed by Moo-Ack! Productions as a part of the "Wheel Steal" game project. We poured a lot of effort, time, and money into making this an intuitive, highly functional addon - and we chose to give it away for free to the Godot community.

You can share you appreciation by:

  1. Following or sharing the game project on Bluesky or Instagram
  2. Joining the Wheel Steal discord
  3. Becoming a Patron of the project (see special Roadside Support tier for hands on support)

Major contributions by bdog2112, antonkurkin, NoJoseJose, Picorims, and more here.

Logo designed by Kenney.

How to install and use

Follow the Getting Started tutorial here. View demo usage by opening the road_demos/demo_menu.tscn scene, and navigating to any of the connected demo scenes - the "Museum" scene being a good starting place.

Then, check out the wiki pages for more detailed usage.

Games made with the Road Generator

Want to include yours? Create an issue!

Future plans

All development ideas are added as enhancement issues here. All prioritized issues are part of milestones defined here.

Contribution

Contributions are welcomed! See the contributing guide for all the details on getting started. It's a good idea to join in the discord if you can, or at least start an issue conversation, before jumping head first into the code. Maintainers will help guide your approach and make sure no effort is wasted.

About

A Godot plugin for creating 3D highways/streets and lane-following traffic

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Sponsor this project

Contributors

Languages