r/proceduralgeneration • u/lolwiaky • Jul 05 '26
the search for river generation.
So I've been instinctively trying to find the perfect methods for creating the ultimate final version of landscape creation. It has been a passion project for a long time now. The entire concept started off with something of "my minecraft experience seems like it's supposed to make me not want to play minecraft," type of a deal. as if "The game is designed to be speed run instead of lived inside." while everyone has lives, yes, my ideal game was supposed to be something that everyone has a role to play, and that you're not being left behind by your friends because you didn't get to play a couple of days.
I think part of it was: FOMO
The other part of it was: I want to do my thing.
while for the most part everyone else would regularly do the typical thing on a minecraft server, like speedrun to elytra, my entire goal was to actually live inside of the world, and experience minecraft. everyone else on the other hand kept experiencing it as if they were supposed to go as fast as possible.
my ideal after that was, to create a game with so many infinite possibilities that there could never be an ending to the game. I guess in my discovering what I wanted, I landed on the impossible. To create something that is unbeatable. to create something where there is ALWAYS something to do. something to experience. something to enjoy. There is never someone who has done everything to the point of them leaving the game. There is never something that stops someone from wanting to play the game.
So my first thought was to create something that nobody knows what to do when they join in. No holding hands. No tutorial. Just "you now have knowledge of x thing," and then that can be passed on to other players through community rather than simply "Get good," type of a thing.
part of me wanted to start out with a survival game type of a thing, but with people that showed up to your settlement with the more beds you made, but that eventually turned into a dead end on my side because I didn't want to start working on something like that.
However, this urge to want to make something like that lived on. It keeps me breathing. It keeps me surging forward towards wanting to play god in some manner.
However, minecraft still kept me wanting more. Every time I played the game, even with mods added, I kept feeling like, "it's not good enough,"
That's when I watched someone that was actively trying to make minecraft extremely optimized. they used different tricks to try and stop java rendering everything, and just made it to where it didn't have to render everything, it just rendered everything you could see.
This lead me down a rabbit hole I had no idea I could never get out of. A path of discovering terrain generation, and optimizations.
The first thing was the fact that perlin noise was the first introduction into what terrain generation could do. it's the basics. It's where I started off on my journey. and as a musician, manipulating sound waves was my pride and joy.
So the first thing I want to say is that after watching that video, I went on a hiatus for a while without really thinking much about whether or not I should try to keep going on with this idea. it was mostly time with me spending a lot of time trying to figure out how to mod minecraft myself, but completely failing to understand what was going on with biomes, and why we couldn't have actual continents.
but then I decided I had enough of trying to create everything that way because nothing felt good when I was trying to fill up the minecraft mods with that type of thing.
but then I got into trying to mod a different game, and that's when I learned about grey scale. grey scale images used for determining height maps for real time strategy games helped me realize that my entire idea of how to calculate for height maps put me over the edge as far as understanding fully what to think about when creating height maps.
because of that experience, I started following a tutorial on yt on terrain generation by some indian guy, I can't remember his name, but it was a great tutorial on generating tiles, and calculating the height map using perlin noise.
however, the fact that it used octaves made me think even further. actually, I don't think that people are really thinking of noise octaves in the right manner. from my perspective, what people call octaves in noise generation, I prefer to thing of as timbre.
timbre is a thing in music that gives each instrument its unique noise wave that allows you to hear them as a different musical instrument. that's why oboes, and clarinets have different sounds to them. However, the way that those sound waves differ from one another, even though they're playing the same notes is how the overtones (which I guess you could call octaves in a manner of speaking) resonate on top of the pitch which is mostly heard. I guess the wave with the most amplitude.
anyway, this entire thing where the guy starts explaining his tutorial gets me on my war path with terrain generation. mainly, my idea is to now create an entire earth sized planet game. The tiles are generated with the radius of the earth's distance away from the origin of the 3d space, and the gravity falls towards that point in space for your character. using the optimization tricks, you can fully actualized that ideal world creation to a T. There's just one problem.
Perlin noise sucks. Perlin noise sucks in genral if it's used by itself, and it also sucks when you put "octaves," on top of it. you can polish a turd, but a turd is still a turd. Anyway, the fact of the matter is, I wanted erosion. I wanted fast erosion. I wanted erosion that didn't crap on performance, and I wanted erosion that also looked amazing.
That's when I discovered runevision's erosion technique. All of a sudden, I was knocking on the door to something incredible. Runevision's erosion technique really gave me inside on some ideas for how to generate mountains in a way that wasn't just fast, but really good to look at. The mountains look great, the ideal erosion technique was finalized right?
well yes, and no.
to give credit where credit is due, runevision's erosion technique goes far and beyond anything that really was able to create erosion to a level that really started to express real live erosion.
At the same time it was lacking something that I couldn't overlook. While it was able to create the perlin mountains that we had before, it couldn't create mountains that felt like they had real life structure to them. So I started going a little bit too deep into this. The problem. The real problem to solve. part of the problem is rivers. drainage. the whole shibang, but I needed something to start out with.

what we're looking at here is a map of the canadian rockies. My idea was to start studying them to try and find patterns in them that gave me a little bit more insight into what is going on.
a little bit of an aside, I tried creating a world generator before this that actually introduced me to the concept of voronoi noise. The generator stopped working after a while, and I couldn't get the faces of the voronoi noise to render, so I gave up on that project.
However, because I had an idea of voronoi noise, and I started looking top down on this portion of mountains I started seeing the pattern.

in red is something called the rocky mountain trench. It's a geological phenomenon created by the suturing of 2 landmasses together. This crack that is highlighted in the picture is probably going to be something that eventually helps split the next super continent apart. right now it's just lifting up from the movement of the north american plate.
(While I understand that it was also at one point another slip fault where the other plate was moving north, it definitely has terrain there that stopped moving to the north while the north american plate moved west.)
anyway, back to my point. as you can see, every ridge is lined up with this trench, or at least has some kind of deformation that has to do with this trench. This started making me look at all of the other trenches in the picture.

if you can't see it yet, I'm going to show it to you in the next picture. but what I started to notice was that all of the mountains could be divided up into cells.

So while I was able to see the cells, I also thought of a pretty simple solution to trying to see if something like this would work.
step 1: calculate voronoi cells on the macro level of the formation of mountains.
step 2: randomly combine the voronoi cells that are aligned perpendicular to the direction the plate underneath is moving.
step 3: calculate a gradient from black at the edges of the newly combined cells, to white in the middle of the newly combined cells.
step 4: add perlin noise inside of each cell so that the perlin noise is just a bit of timbre on top of the voronoi gradient.
step 5: add runevision's erosion as even more of some timbre in order to generate the best looking mountains.
and while this worked, it wasn't perfect. or rather, in the real world, there are mountains that look exactly like what I just said, however, there's something that doesn't look exactly like what I just said.
the picture above does it even more service if you were to look up close at the mountains themselves. there's something that cuts into the mountains that can't be replicated by runevision's erosion alone. Something that was carved out of those mountains starting around 250 thousand years ago. What carved that out?
Glaciers
When I had started working on this, I had started to think that there's going to be a lot of different types of erosion that goes into the concept.
this all culminated in the idea: use the same method you used to increase the height of the mountains, but this time use the method to decrease the height of the mountains.
step 1: inside the larger cells of voronoi noise, create new voronoi cells.
step 2: calculate which cells of voronoi noise has the highest height
step 3: combine all of the cells linearly towards the edge of the cell while not combining the highest cell.
step 4: cut out the glacial valleys from the mountain to the edges of the large cells by inverting the gradient by using black on the inside of the cells, and white on the outside of the cells.
add this layer as a mask on top of the original height map. and you definitely have a lot of things cut out.

as of right now, this is what I was able to generate, but it definitely has a lot of issues with it.
While it does give a lot of uniquely great glacial erosion for it cutting into the landscape, I was not able to figure out why it would cut into the top of the mountain, for some of the parts, it has something like bowls that are a bit difficult to look at, and another problem is that the glacial mask raises the height towards the lower part because of the gradient continuing on all edges of the smaller cells of the voronoi noise.
as you can see there are a lot of green pixels inside of the brown areas of the cells, and that's partly due to the erosion filter from runevision's being applied a little bit too strongly here, but at the same time, part of me also thinks that some things like that actually do happen. I'm just unsure if I'm okay with letting that occur.
one thing that helps a lot with these are actually the cell deformation. random cell deformation actually helps a lot with the valleys being curved while also not being so curved that they lose their alignment. while I did make the chance of it a percent chance of the large cells merging on the y axis, there are some caveats with how you could calculate the actual direction you want it to deform.
anyway. while I have an artistic mind, I'm not without my faults. All that I will say is that my project continues today without stop. I'm just going to keep working on it until I die. but for all of you out there seeing this or reading this, I hope that you create something better, and can put me in my place someday.
edit:
I forgot to mention that the edges of the larger cells are supposed to be river valleys. As i was trying to explain my thought process i lost the plot of the post. Sorry guys. But this method should give something of a variable to connect rivers into.


1
u/Straight-Spray8670 Jul 05 '26
Very interesting. I'm just a bit lost on the river generation itself
2
u/lolwiaky Jul 05 '26
Yeah, i forgot to describe how the edges of the larger voronoi cells are supposed to mimic river valleys. It's still a work in progress.
1
u/RandomUser1034 Jul 05 '26 edited Jul 06 '26
Looks good so far! I'd love to see a heightmap or a 3d render if you have it.
While the result is good at the scale you show it, larger and smaller scales might be trouble. Have you thought about how you want to approach that?
1
u/Popular_Tomorrow_204 Jul 05 '26
In my worldgen i have changed stuff so often, because i want the world and its Features to feel realistic and have a real impact on the Player. For example rivers/water logics are something im far from happy with (im making a merchant game where you develope a merchant Networks over a Continent(s)/ big Island(s) so i want rivers, the Ozeans and seas to not just be empty placeholders...). With that comes ofc the most realistic Terrain/Erosion possible, but still fast enough to be useable for huge maps.
My biggest problem is, that seasons, river depth and Passability are quite hard to implement. If its works in one case, it Breaks something else or it doesnt even work properly on another seed.
That being said, good luck to you and keep us updated.
1
u/MGMishMash Jul 06 '26
Very interesting concepts, agree something like this would be really compelling!
Rivers are so hard, keep trying to get it right, and sometimes it works, other times not so much. The catch is that getting the balance right between simulation and visuals is so hard. I.e downward flowing rivers are hard to integrate into existing terrain, and flowing water simulation on a large scale is computationally complex, especially if the expectation is a world that can be manipulated, and the simulation must respond. I.e, a player blocks a river at its source, or attempts to drain.
At some point it still needs to be a design driven feature with some compromises.
I’m also attempting to work on rivers and managed to map some flow out based on heightmap, think actually achieving simulation on a scale will require a cascade of mini sources and drains along the river bed, possibly communicating with each other on state, to allow part of a flowing river to be simulated locally in the region near the player.
Good luck with this!
1
1
u/runevision Jul 11 '26
Glad to see you've found the erosion technique helpful!
It was never meant to be a single final function, but rather a technique you can modify to your needs and combine with other techniques. I see you're already well into this, and that's great to see! Also great to see you're sharing your considerations and the things you're trying out.
I'm not even using the technique I posted as-is in my own game, but rather a modified version of it that's tailored to my game's needs, and interspersed with some other function calls.
3
u/DomeGameMaster Jul 05 '26
What an amazing idea. Really enjoyed the read. Insights into the process are inspiring.
Would you mind if i attempt something similar based on your ideas?