I know there are several tries on this topic, but all of these are only usable for some kind of endless runner game, at least I think so.
I need a modified version and I do not know how to accomplish it.
I want a nicely reasonable generated surface terrain combined with detached reasonable caves in the underground to generate a nice adventure world.
A major problem maybe is that I want it to be generated only at the first start of the game. The randomly generated world should be saved and loaded, when you restart the game.
I thought about this whole thing and came up with an idea, but I am not sure if it is doable because it could cause some kind of lag:
Could you actually make the world to be 1 array? Let's say the world is 1 big grid. The height is 15 squares of this grid and the width is 20.000.
Now on every square of this grid, which is actually filled with a block of the terrain, the value is 1. When there is no block on the square, the value is 0.
So you could save and load this array to keep the randomly generated world. When the players destroy or creates a new block on the grid, the array is changed and saved when the game is closing.
Then you could have a second array, which is holding the different materials like earth, stone etc.
Let's say 0 for earth, 1 for stone etc.
Is this doable or do you know a better way of achieving it?
I would really appreciate your help, whether it is in form of a tip, idea or even a example capx.