I'm currently writing a little side scroller in C#, to both learn C# and have fun. Right now I have a simple random number generator generating the world but it isn't exactly all that great - so with some research, I've discovered that Perlin Noise generation may help me out quite a bit. Problem is, I want to have an "endless" landscape made up of several chunks.
Basically my questions / concerns are:
- Using minecraft as an example (Ignoring the 3rd dimension), how is Notch getting each chunk to connect to each other perfectly? Tunnels, caves, ore veins, mountains, flat lands, biomes, etc. are all connected to each other even though each chunk is generated separately, and sometimes at a much later date. This is key for me, I want the player to be able to walk to the right and as they are walking, generate more landscape that connects to previous landscape, including underground tunnels and cave systems.
- Going off of #1, how would this be accomplished under the assumption that each chunk is a square, and the world is 10 squares high, and infinite squares wide? I.e. Each "chunk" is 128x128 tiles and the world is 1,280 tiles tall total. (This is so that I can make an infinitely deep map if I choose to - and also to show that all 4 sides of a chunk / square need to be able to connect and continue on what the previous square/chunk was doing).