Hi everyone,
I’m developing a game with a procedurally generated world and require some advice on optimization.
Current Approach:
- I spawn the world chunk-by-chunk in predefined locations using ChunkSpawner actor.
- All spawned actors have an owner on the level (the ChunkSpawner actor) and are managed via World Partition.
- I handle part of the spawning logic in C++/Blueprints, and for some systems, I use the PCG framework.
Problem:
Spawning a new chunk causes a significant FPS drop due to the high number of actors and meshes being instantiated at once. I tried mitigating this by:
- Limiting actor spawns per frame (staggered spawning).
However, this doesn’t fully solve the issue since each chunk contains a large number of objects.
Desired Solution:
Ideally, I’d like to pre-generate the entire world upfront (e.g., during a loading screen) and then rely on World Partition to load/unload chunks dynamically during gameplay. Unfortunately, I haven’t found any tutorials or guides on implementing this approach.
The only alternative I’ve seen suggested is spawning nearby chunks while showing a loading screen, but this isn’t ideal for me because:
- With World Partition, only a few chunks are loaded at a time, meaning FPS drops would recur frequently as new chunks load.
Question:
Are there best practices or recommended methods for pre-generating a full procedural world before gameplay while still using World Partition?
Any advice or examples would be greatly appreciated! Thanks in advance.