Hi, I made a random map generator in c++ and I have some questions about how to get the best performance out of it.
The generator makes a grid, where each square is, for example, a wall or a floor. In the end the size is around 100x100 blocks, so around 10 000 squares.
My question is, which is the performance wise best way to spawn it.
1: Should each square be an actor, a component, or a level itself? Most of the squares are just static ground or a wall. Is there a difference in performance for each approach?
The whole game is top-down and outside the player’s view, nothing needs to be loaded. So I made a script, which detects, once a second, which squares should be visible or not.
2: I made every square outside of the player’s view lose its collision so that calculating power is lowered. Is this even needed or is this an unnecessary extra effort?
3: I suppose everything outside of the player’s view doesn’t get rendered automatically. So turning off the visibility of the squares outside of the view is not a necessity, right?
Thank you