Hey all!
I’m making a game as us ue4/indie devs tend to do. I am using a custom made blueprint that spawns in a room and then halls off that. When the player opens a new door all rooms except the one you are entering is deleted. And then when you open the next door a room is generated and the previous are deleted.
And voila! Infinite, random rooms.
Enter the problem. The rooms are made of “Hierarchical Instanced Static Mesh Components”. It is my understanding that this is considered “best practice” for my use-case as I need advantage of LODs and also instancing a mesh is far more performant then spawning a new actor.
The rooms are incredibly simple. An HISMC for the floor, wall, ceiling and door. I plan to add more later on for specific details etc, etc, but this simply doesn’t run well enough for me to justify moving forwards.
The rooms are completely random sized and can have any number of doors, they can be long, short, huge, tiny, etc, etc… All made from 1000x1000 tiles for the sections.
Once the rooms are generated and “done” I get a constant 180+fps easy. The problem is every time a room is spawned in or removed the player gets a consistent 30+ seconds of lag. The game is essentially paused and it absolutely kills the pacing.
Does anyone know of any way to alleviate this? Tips or help? I have no idea how to optimize it more then it already is, I’d love to move the generation to multi-threading or even c++ but I’m still quite inexperienced.
If I could get any learning material, tips, advice or help it would be much appreciated.