0

I'm currently in the process of coding a procedural terrain generator for a game. For that purpose, I divide my world into chunks of equal size and generate them one by one as the player strolls along. So far, nothing special.

Now, I specifically don't want the world to be persistent, i.e. if a chunk gets unloaded (maybe because the player moved too far away) and later loaded again, it should not be the same as before.

From my understanding, implicit approaches like treating 3D Simplex Noise as a density function input for Marching Cubes don't suit my problem. That is because I would need to reseed the generator to obtain different return values for the same point in space, leading to discontinuities along chunk borders.

I also looked into Midpoint Displacement / Diamond-Square. By seeding each chunk's heightmap with values from the borders of adjacent chunks and randomizing the chunk corners that don't have any other chunks nearby, I was able to generate a tileable terrain that exhibits the desired behavior. Still, the results look rather dull. Specifically, since this method relies on heightmaps, it lacks overhangs and the like. Moreover, even with the corner randomization, terrain features tend to be confined to small areas, i.e. there are no multiple-chunk hills or similar landmarks.

Now I was wondering if there are other approaches to this that I haven't heard of/thought about yet. Any help is highly appreciated! :)

Cheers!

Zultar
  • 183
  • 1
  • 9

1 Answers1

2

Post process!

After you do the heightmaps, run back through adding features.

This is how Minecraft does it to get the various caverns and cliff overhangs.

Eben
  • 422
  • 2
  • 11
  • That's actually what I'm doing right now to smooth the heightfields produced by the Diamond-Square algorithm. Guess I should look into it some more for other applications. – Zultar Sep 04 '14 at 09:47
  • @Zultar if you think this answer satisfies the question, please mark it as the answer :) – Eben Sep 07 '14 at 19:45
  • Um... I'm pretty sure Minecraft uses noise turbulence to create the cliffs and overhangs. Inputting a distorted x, y and z coordinate into your height-map function creates very nice height-map-ish terrain with the occasional overhang and cliff. – Barry Smith Jun 06 '15 at 13:15
  • That's a good point, a turbulence algorithm would allow you to get those kind of features on the first pass. – Eben Jun 07 '15 at 16:39