Procedural (never ending) map generation

Hi all,

Pretext: I have minimal experience on this part of game dev and very little time to do research and what not, so I only ask that you all be kind to me in the search for wisdom and knowledge :slight_smile:

Moving on…
I have (briefly) read up on perline noise and diamond square and such, all the normal things you get from simply typing “procedural terrain generation” into google. However non of these strike me as being procedural. What I would think is that procedural means never ending, so you can jump on a map at [0,0] and walk forever north with no limits, no edge of the map. In ALL the examples of procedural generation I see people create a height map for a terrain and leave it at that. I would call that random map generation, not procedural because it has a map edge. This is also not because they used only a snip-it of the map but the source code supplied to generate the map requires a height and width as a parameter.

I would like to know how to do a procedural (never ending) map, that is my goal. To start at [0,0] and generate terrain while the player moves north. There are many games that have done this but no where have I been able to find any resources to help me make a tiny version of what these games do. Taking Minecraft as an example, it generates chunks around the player while the player moves around the map. I have done something similar with little success in that the chunks don’t actually fit next to each other.

The closest I have gotten so far is using the chunk idea, by showing only 9 chunks around the player and generating the chunks that the player moves into. The trick now is to make the map cohesive with the chunks next to it. I just have no idea how to do that.

Any pointers, any help, any links, even criticism are all of use,
Thanks all.

Perlin-Noise can be used as-is for infinite maps. You just got to


  randomValue = perlin2D(chunk.x + inner.x, chunk.z + inner.z)

That is, add the position of your chunk and the position of your point inside the chunk and pass that to the noise-function in question.
The result should be a smooth, never-ending terrain.

Sorry, but even procedurally generated maps can’t be INFINITE. Even Minecraft’s world isn’t infinite. It’s a 30 000 000 X 30 000 000 X 256 world (unit: blocks). It’s a crazily massive world, but unfortunately, no map can be infinitely huge.

Also, procedural generation doesn’t mean that the map is infinite. It just means that the map is generated algorithmically, not manually.

You can try Perlin Noise or Simplex Noise or you can just use the DS algorithm, but the best thing to do would be to write your own algorithm. It may be difficult in the beginning, but it just takes a couple of weeks to think of an algorithm and implement it. I created my own algorithm too, and it was really fun! I learnt loads :D.

Also, chunk rendering doesn’t just mean separating all of the cubes into different arrays. Chunk rendering is supposed to boost your performance by reducing the number of draw calls. So you have to actually batch the cubes into chunks, so that you can draw each chunk with one draw call instead of looping through all the blocks and drawing them 1 by 1 with several draw calls. This is very similar to 2D sprite batching, and it’s actually quite easy, but the task might seem daunting initially.

Here’s an awesome visualisation of the diamond-square algorithm: http://www.paulboxley.com/blog/2011/03/terrain-generation-mark-one

[quote]…procedural generation doesn’t mean that the map is infinite. It just means that the map is generated algorithmically, not manually.
[/quote]
True. But that generation can be ever-varying.

[quote] no map can be infinitely huge.
[/quote]
Are talking about the fact that there are only so many Long values or Double values? If coded at an reasonable scale, those limits will never be reached.

Perlin/Simplex can go as far as numbers exist that are not out of range for the coded calculations. And even then, couldn’t one just re-seed the origin, create a smooth transition to the new seed and continue?