So I was working on a summer project and I wanted to try something with procedural generation. What I wanted to do is to generate some islands but then I stumbled on some problems. So my world is divided into chunks of 100*100 tiles. I want to generate the chunk when the player enters it for the first time. But how am I going to generate such islands? And how am I going to generate cross chunk island (when a island is on the border of the chunk I want it to continue on the next chunk). Btw chunks are saved in files as a string like :
Chunk 0,0 = 000001000500003002
Where each int stands for a tile type.
Can someone link me to some usefull resources or just give me an idea on how to do this?
Split your chunk generation into two phases: Terrain and decoration.
In the terrain phase you generate everything that structures depend on being there, like height/volume, biomes, basic tiles (stone/dirt/water)… but no actual structures (something larger than a tile) of any kind.
Then decorate the chunk by generating/placing all the structures into it. The trick here is to only let the decoration phase happen AFTER all immediately surrounding chunks have their terrain generated.
Hope this helps!
I am not planning to make structures that are bigger than a chunk. I want it to be like when an island (sand tiles in the middle of some water tiles) is at the border of a chunk it continues on the next.
It will help if you create classes for your map, your tiles can then hold more data then. There are plenty of examples of infinite maps available, I searched “Infinite 2D procedural tile generation”, one example: