Godot Version
4.7.1.stable
Question
Hi everyone,
I’m building a forest scene in Godot 4.7 that needs to contain a very large number of trees. The forest is fully procedural and generated at runtime, so tree placement isn’t known at design time and nothing can be baked in the editor everything has to be spawned/built dynamically while the game is running. I’m trying to figure out the most performance-friendly architecture before committing to one. I have two ideas and I’d love some feedback:
Option 1 — Instanced tree scenes + visibility ranges
Create a scene for each tree type and instantiate those scenes at runtime as the generator produces tree positions. My understanding is that Godot batches identical meshes with the same material automatically, so draw calls should stay reasonable. Then I’d use the visibility_range_* properties on each tree to switch to impostors at a distance.
Option 2 — Chunked MultiMeshInstance3D system
Divide the generated forest into chunks and build a MultiMeshInstance3D per chunk at runtime, filling the instance transforms from the procedural data. When the camera gets close to a chunk, I’d spawn the actual tree scenes (for collision/interaction), and when it moves away the chunk gets culled and falls back to the MultiMesh representation.
My main concerns are CPU overhead from having thousands of nodes in the scene tree (Option 1) versus the lack of per-instance culling and per-instance LOD in MultiMesh (Option 2) — plus, since everything is generated at runtime, the cost of building/updating MultiMesh buffers on the fly without causing stutters.
Which approach would you recommend, or is there a better hybrid? Any real-world experience with large procedural forests in Godot 4.x would be really appreciated. Thanks!