I’ve been prodding at this idea for a few weeks now, went through two different attempts to build it to, but it seems to consistently fall apart. basically, what I want is a grid of blocks that can be destroyed or rebuilt made up of several basic blocks that fit together to form walls, corners, ect. you can tag blocks for digging, claim rooms, you know. dungeon keeper type stuff. only real difference is I want to allow for double sided thin walls and partial walls rather then everything being exactly the same block sized.
I’ve treed two variations on using a grid of nodes to generate the blocks. the first attempt each node had code and generated it’s own block locally when told to. this didn’t run so well, so on my second attempt the nodes were strictly for data storage and I used a master script to generate the stage exclusively, this ran better.
but both worked with smaller grid sizes. the first was fine with up to 50 X 50 the second ran better and loaded faster at 60x60 but both cases if I increased the size over 100 performance just bottomed out the second anything trys to move or update in the game. if noting is moving but the camera it’s fine. the larger the grid, the worse the performance.
it seems directly linked to the number of wall and floor segments that are drawn in. I tried only drawing in blocks the camera has seen. but it went from tolerable to slow, to unbearable as I uncovered more blocks. since the blocks contain no data I am baffled. generating the blocks that are visible and destroying them when not is to slow for that to work either.
there has to be something I am overlooking here, but I can’t see what it is. does anyone have any advice on how to handle this sort of dynamic level layout or how to approach handling it more efficiently?