Hacker News new | ask | show | jobs
by bcraven 475 days ago
To my geologist's eyes there is a fundamental flaw in this method: the assumption of randomness.

All mountain ranges are driven up by lateral forces, so simply look on a satellite image to notice how they are made of ranges[0]. I do wonder if this propensity can be introduced to the code.

[0] https://en.m.wikipedia.org/wiki/Zagros_Mountains#/media/File...

8 comments

You generally start with some kind of perlin noise and then add plate tectonics e.g. with voronoi diagrams (use anything you want), then add climate, erosion etc. however many passes you like. It’s a fascinating rabbit hole.
One thing you can do is take a DEM and match the distributions, then sample those distributions for new terrain. This can (in theory) reproduce any characteristic represented in the original signal. It can even be relatively efficient compared to things like erosion models if you constrain the number of octaves in the signal.
What's DEM?
As someone who has simply studied a bit of geology I agree with you--noise-generated mountains look wrong. Long ago I played around with attempting to generate terrain with faults (take a line across the world, raise everything on one side, lower everything on the other. Start with some big ones, then add more making the step size smaller as you go) followed by erosion (pick a pixel that's a local maximum, move a portion of the difference between it and the lowest neighbor to that lowest neighbor, that's the new cursor, repeat until everything around is equal or higher.) Very compute-intensive, though, and not suitable for on-the-fly generation (the faulting step might be possible with a noise generator, I see no way to do the erosion and without it everything's too harsh.) At the macroscopic level it looked a lot more realistic, I had neither the memory nor the CPU power to do too fine a model. I simply couldn't hold a large map, nor were 16-bit integers granular enough to make good slopes.

I can look at real terrain and do a pretty good job of judging whether it will be easy/hard/impossible, I've never seen a game map where that was true.

Certainly! The limit is your creativity. My first idea: generate very large scale 2D noise. Choose a threshold to divide it into regions. For each region, choose a direction of motion. Design a “mountain envelope” function that considers distance from the nearest border to create mountains/subversion zones based on the direction of each plate and the shape of the border.
You can also do similarly for water erosion, plotting channels where it runs downhill, carving a little on each cycle (and some terrain engines do).
I think https://veloren.net/ has contributors who have put a lot of work into simulation geology, but I can't recall the place I read that
This image from the same article is stunning. Those massive formations look like CGI to me. They're just too far removed from the sort of mountains I'm familiar with.

Notice the cars in the foreground for scale.

https://en.m.wikipedia.org/wiki/Zagros_Mountains#/media/File...

You can get much more realistic results at a smaller scale for e.g. waterways using iterative methods -- simulating rainfall and erosion. I imagine the same would be true at mountain ranges using some model of your lateral forces to influence the heightmap. The main issue with this will be the computation time, naturally. Not that that should stop anyone, but it's likely the reason you don't see it in shipped games.
Diffusion limited aggregation is another interesting option for mountains assuming you're willing to employ an approach that isn't single pass. However a naive implementation is extremely expensive compared to other iterative options.

To be fair to OP though it doesn't model lateral forces. It just produces a visually plausible result (to my non-geologist eye at least).

In general, are aware of any physically-based long-term geological process models with real life fidelity as a goal, and that have a remote chance of being feasible for gamedev?

I imagine that, analogous to work done in weather forecasting, someone can shove DEM files into the pattern-matching engine of an AI, but I do wonder how feasible a completely algorithmic model will be.

Not sure if this is what you're asking, but take a look at Terra Firma on Steam: https://store.steampowered.com/app/1482770/Terra_Firma/

I don't know what tech they're using, but it does have erosion, water flow and sediments, plus others. I see they're planning a paid version with more features this year. I've only played an alpha some time ago, but it should be possible to export the maps to use in other programs.