I am making a procedurally generated "infinite" map using a chunk based system.
At first I made every chunk an array object but after 400+ array objects the game slowed a lot.
So now I make the array, generate the info, then put the info into a dictionary with the key being it's coordinates, then delete the array.
It seems to be working fine, even after 3000+ keys/chunks, but I am trying to optimize it to minimize lag when new chunks are generated or loaded from the dictionary.
I'm hoping for larger chunks so that the player can see far away, and in the future you won't be able to escape enemies unless they are very far away. Like, half a mile away if you're running from a dragon.
Right now if chunks are only 10 tiles across it generates and loads seamlessly but 30 tiles across isn't very far for most purposes. If chunks are 30 tiles across there is slight delay on generation and no delay on loading. If chunks are 50 tiles across then there is lag both ways
I am new to using Construct as an adult, so in the past two weeks I have learned lots of critical information and am able to make fancy things, but I'm still very new. I don't know where to begin to minimize chunk generation delay and maximize render distance, I guess I'm just trying out random things and seeing what works.
Ideally if I could keep the initial array system that would be great, but 400+ array objects is causing big lag