Godot RetroTerrain (GDScript)
An example of how to build terrain similar to old strategy or management games, like Rollercoaster Tycoon. It also includes a water shader and basic terrain generation. Rewritten for Godot 4.3 and GDScript!
This implementation is based on the fantastic tutorial by Eric Schubert. Please watch the video for a full guide on how this works (linked below).
Features
- Generation of terrain mesh and normals
- Simple terrain shader based on height of vertexes
- FPS and RTS camera implementations
- Basic map generation using FastNoise
- Optional smoothing of normal maps, so the shading looks less blocky
- Optional grid lines for more retro look
What's missing?
This example should be a great starting point, but if you wanted to take this further:
- Chunk-based map rendering
- Tying to render huge maps (e.g. 1000x1000) ends up crashing Godot. Try breaking the map into several smaller meshes as needed.
- Collisions
- Using a similar technique to the mesh generation, you should be able to easily generate a collision shape.
Credits
- Eric Schubert for the original tutorial in Unity
- StayAtHomeDev for the water shader tutorial in Godot
- Myself (NickToony / Nick Hope) for bringing this all together in Godot 4.3