I don’t see how you’d generate rivers based only on neighboring patches. Depending on the camera distance, the neighboring patches could be 100 km x 100 km, or 50 m x 50 m. You don’t work at a constant resolution / area size. What you need is a procedural function R = f ( x, y, z ) where R is the altitude of the generated terrain and xyz the coordinates in planet space. And that function R must generate a heightmap with rivers, erosion, or any cool feature you’d want. But by definition, such a function is only a function of a single planet coordinate, so it doesn’t have any knowledge about altitudes in neighboring areas.
Of course you could call a bunch of f ( x + dx, y + dy, z + dz ) and do something with it, but to get decent terrain features you’d need to call it thousands of times, which would be too slow. So I don’t see any good solution to this problem. And the fact that nobody has published any algorithm to do it, makes me think it’s a non-trivial problem…
I agree with you that this is probably impossible using a simple height function - the ‘single-pass generation’ terminology I used above.
What I had in mind for a multi-pass algorithm would be to compute the gradient of a tile at a fairly low level of detail (so this wouldn’t work for tiny streams, mainly just large rivers), then perturb the terrain based upon that. Even then, coming up with a decent river approximation using a ‘single-pass’ WITH this gradient information would be tough, as you’re having to predict water accumulation / downstream effects. Again, not familiar with the existing techniques, but I’d imagine a large number of iterations are used to ‘erode’ the terrain, and the gradient is re-calculated after each erosion step.
Something that I’d like to see attempted is to tackle surface hydrology in reverse. It is impractical to derive surface hydrology from terrain in real time, so derive the terrain from the surface hydrology. Find a function that can spit out a convincing surface hydrology structure, then go back and fit terrain to it. The process of fitting terrain to hydrology should be much more data-local than trying to go the other way around.
Here’s an image that somebody assembled based on a fractal.
The challenge would be to find a good f(x,y) or f(x,y,z) for surface hydrology.
I vaguely remember asking why this didn’t work on the old forums - because if it did work, someone would have done it, right? But the answer probably went over my head, as I absolutely don’t remember it
It’s impractical to derive surface hydrology from terrain in real time on a single consumer-grade computer, especially while running a game at the same time, but with a large enough server farm dedicated to the task I imagine it’d be possible to do in a small enough timeframe that gameplay mechanics could be tweaked accordingly.
Reduce the accuracy of the data to where it can be compressed and sent over the minimum expected internet connection to play the game, then apply reverse function there (with procedurally added local detail).
It wouldn’t be perfect, every so many planets you’d probably see Lake Victoria sized bodies of water popping in (or large rivers apparently being soaked up by the ground), and of course servers aren’t free - but they are dirt cheap, comparatively speaking. Oh yeah, and it’d give rivers that looked like they, for the most part, followed gravity rather than the other way around.
Note that the dedicated server-farm and heavy bandwidth use is only necessary for games with arbitrarily large numbers of planets; I:B could probably be shipped with the high level hydrology data, calculated over many weeks on a spare laptop, included for each planet.
Just noticed the caption, “A question remains, where should this project go?”, looks like he moved on to different things, also, very interesting that something like this can be done in Java, it’s not really a language you would associate with real-time planet rendering.
Whaatt??? That’s fantastic. Sure, you can see behind the curtain a bit during the scene transitions (although I really enjoy his zoom effect), but regardless, that’s just tremendous work.
This guy seems to have a whole system with celestial mechanics implemented, rocky planets, moons, gas giants, rings. Not really sure what game he wants to make with it based on the second video, he seems proud of his community. Is this Space Engine based, not sure…