|
My current sonic fangame project is on hold for now for some reasons that are unimportant here.
Anyway, onto the topic. I have made a 2D Minecraft fangame engine so far, and I added infinite world generation. The issue is that it really lags once it generates 5 to 6 chunks. A chunk is made up of X/Y 20,64 (this is measured in blocks, each block is 32 pixels, but I'm pretty sure the only info needed is the amount of objects, so a chunk is made of 1280 blocks), is that an insanely large number? Should I change the depth of the world or something? Is there a way to unload all of the blocks in chunks outside of the view? Should I somehow make it not use objects for blocks, but rather somehow come up with a method for using arrays that draw sprites? If I did that, would it make it run faster? Are there any other methods?
I have already tried deactivating all the blocks that are off screen; It crashes the game for some reason. I have also tried making all blocks offscreen invisible and non-solid.
Any suggestions?
Also, sorry for large paragraph full of questions.
|