That's certainly more elegant than this one:
195 lines of Amiga BASIC.
How about mountains including sun, clouds, fog and snow in 500 lines of text:-
Needs a WebGL enabled browser.
The terrain is somewhat unbelievable, though. After the generation, I'd suggest running some simulated erosion on it. A few iterations of simulated water flow and material removal. Assumption of homogenous soil will do the job; asking for simulated harder rock intrusions would be too much.
Yeah, I think that's the largest problem with any of the various random terrain generators, they're missing the next step (likely because it's a very complicated step and likely extremely hard to code for FOSS) of errosion simulation. This would also allow you to know where rivers and lakes would be, and thus make it a lot easier to use these sorts of terrain for more in-depth creative works like fiction and gaming.
It's delightfully simple once you figure out what it's doing.. each feature (lakes, rivers, forests) have a 2D array defined that functions like a stamp. For rivers, the generator picks a random x,y coordinate, stamps into the terrain, then moves the x,y in a random direction and stamps again. It repeats until it hits the edge of the map.
Lakes and forests run on a similar concept, but the loop is modified so it behaves differently.
that water simulation is pretty amazing, thanks for sharing!
I was especially impressed once i realized i could lift the sphere out of the water and smash it back down, or have it partially submerged.
the only real flaw i've noticed is that water can't overcome the surface tension and separate, like when you smash the sphere downwards you'd expect some water to become airborn. likely that bit adds a lot of complication to the simulation.
After looking at a few of these terrains, I was thinking that I'd want to pick a good one and 3D print it for table top gaming.
POV-Ray can produce much the same thing with a script of about 130 characters.
This topic was automatically closed after 5 days. New replies are no longer allowed.