Summary of "Getting Side-Tracked Fixing Terrain - Open World RPG Devlog (November)"
Summary
This devlog focuses primarily on a major overhaul of the terrain system in an open-world RPG, shifting it from CPU-driven to fully GPU-driven to improve performance and flexibility. The creator had initially planned to work on Survival Mechanics but was forced to prioritize terrain due to a performance regression caused by an update in the underlying engine (Gau).
Key Technological Concepts & Product Features:
- GPU-Driven Terrain System:
- The original terrain system used two scripts (Terrain Controller and Page Cache Manager), which caused synchronization bugs and performance issues.
- Rebuilt as a single script to manage terrain generation, caching, and rendering more efficiently.
- Terrain generation involves creating multiple image "stamps" (height maps, color maps, and multiple data layers) that are composited via compute shaders.
- Compute shaders are used extensively to generate terrain features such as noise, slope maps, normal maps, and biome data.
- The system renders terrain chunks sequentially, pushing data through compute shaders before moving on to the next chunk.
- Compute Shader-Based Foliage System:
- Replaced the CPU-based foliage system with a GPU-driven method.
- Trees are generated by sampling a grid with random offsets, followed by a Compute Shader pass to reorder instances and count valid ones.
- Uses multi-mesh rendering with indirect instance counts fetched from GPU buffers.
- Grass is generated dynamically around the player in a smaller moving chunk (32m increments), separate from the main terrain grid, allowing on-the-fly grass generation.
- Required modifications to the Gau Engine source code for multi-mesh buffer access and indirect multi-mesh drawing.
- Biome Matrix:
- During foliage generation, a 2D grid matrix per biome is created, storing averaged biome values used for audio, particle effects, AI spawning, and other gameplay systems.
- Survival Mechanics (Initial Implementation):
- Basic hunger system and consumable items implemented.
- Inventory and serialization systems were reworked to support these features.
- Hunger applies debuffs but not death, inspired by games like Valheim.
- Introduced a backpack system affecting combat mobility—players must drop backpacks to engage in combat, encouraging tactical decisions.
- Markers indicate backpack location when dropped.
- AI System:
- Added AI groups and individuals (new herbivore species called "Antelope").
- AI groups spawn based on biome and other factors.
- Tiered update system for AI: detailed physics and updates close to the player, progressively simplified updates at longer distances to optimize performance.
- AI groups can interact with each other and the environment even when the player is far away, enhancing world immersion.
- Gau Engine Source Code Contributions:
- Submitted three pull requests to the Gau Engine repository:
- A bug fix for multi-threaded GPU particle calls (merged).
- A getter for the multi-mesh transform buffer pointer, allowing compute shaders direct memory access (merged).
- Implementation of indirect draw commands for multi-meshes, enabling compute shaders to control instance counts for rendering (pending merge).
- These improvements aim to reduce CPU overhead and improve GPU-driven rendering performance, especially for large-scale foliage and terrain.
- Submitted three pull requests to the Gau Engine repository:
Development Challenges & Future Plans:
- The terrain rebuild delayed survival mechanic progress.
- UI for foliage and biome layer selection is incomplete due to time constraints; planned for January.
- Will implement large-scale biome transitions and integrate indirect multi-mesh drawing features in future updates.
- Survival Mechanics will be expanded with hunting and further gameplay integration.
- The developer is optimistic about the new terrain system’s stability and performance improvements.
Main Speaker/Source
The video is a solo devlog by the game developer working on the open-world RPG, who also actively contributes to the Gau Engine source code. No other speakers are mentioned.
Category
Technology