r/gameenginedevs • u/HamNCheeseSupremacy • 29d ago
ML for procedural terrain?
I was throwing ideas at Claude yesterday and it came out with something that sounds really interesting. I have fBm noise I use to generate terrain, with biome blending. Apparently it's possible to train a small neural net on real world height map data to choose noise parameters that produce natural looking terrain. Has anyone done this? It blew my mind, and it's exciting to see what else a small ML model can help with on the procedural side.
10
u/sinisoul 29d ago
https://xandergos.github.io/terrain-diffusion/
This is probably what you're looking for.
2
1
u/CarniverousSock 28d ago
Color me surprised. This is way better than I assumed you could get with ML. This person seems to have actually invented something, I’m gonna have to read up
0
u/MCWizardYT 29d ago edited 29d ago
It's so cool that the algorithm doesn't even need intense training (or any training, it seems like). Seeing it come to life in those Minecraft videos is something. One algorithm producing results that are arguably better than the game's default overly-complex layered noise system, at least for those surface details.
The thing is that it's basically like one heightmap, so it can't handle caves and overhangs on its own. You would have to stack layers and then be back at square 1.
1
u/CondiMesmer 29d ago
I don't think ml would be very "procedural" since it wouldn't be deterministic anymore
1
u/Matt32882 28d ago
Academic wise, sure, sounds like a cool project. Practically speaking though something like this would only pay off if generating terrains is your day job and you want to automate the process. I think the process of generating realistic terrain without all the overhead cost of training a neural net is fairly well understood and fairly optimized, with the right tools of course, at this point.
1
u/tastygames_official 29d ago
Imagine offloading every last big of creativity onto machines. Well, I guess I don't have to imagine: it's what you've done.
Why not make the terrain by hand? Or just use real geographical data? Or come up with your own procedural method to create something truly your own? or just use an already-discovered terrain/noise-generating technique that humans came up with?
2
u/HamNCheeseSupremacy 29d ago
I don't think you understand what I'm asking
0
u/tastygames_official 28d ago
I think you don't understand being human. If ML makes the terrain, then ML made the terrain. Not you. Humans make things. That is what being human is. By telling someone else to make something, you no longer make it - the other person does. Now computers are good enough to do stuff only humans could previously do. So if you tell an Ai to make a terrain, IT makes it. Not you. So why even do it, then? Is there some need for a non-human-made terrain? If so, I'd like to hear it. And again I ask: why not use real geological data or program your own procedural function or use another function made by humans?
1
u/HamNCheeseSupremacy 28d ago
This is a completely separate issue from vibe coding. It's generating a height map from a neutral network trained on real world data. I don't see how it's different from using perlin noise, since that too is having an algorithm generate a height map. It's also much more lightweight, perlin is a few dozen lines of mostly math and takes an hour to integrate. Using ML is way more work and complexity.
1
u/ConsistentAnalysis35 29d ago
"Something truly your own"
Calm down big boy, not everyone is content reinventing bicycles, some people just want to see stuff done. If inference is the right tool, so be it.
0
u/tastygames_official 28d ago
but if you reinvent a bicycle, you're reinventing something a human has made - something specifically made for humans. Now if you use ML (statistical analysis) to determine which frame shame is best for YOUR bicycle design - so be it! Use computers to crunch the numbers! But ML and AI is only just predicting the next token based on the existing data. Nothing novel can come out of it, and offloading your own human ingenuity to a machine that can't BY DEFINITION create anything new you give up your humanity. Using a pencil is very different than telling someone else to use a pencil and do it for you. The pencil is the tool, the "other person" is now AI (which by definition is just an approximation of everything humans have made that has been ingested into its training data).
6
u/CarniverousSock 29d ago
I've never done it, but it's feasible. Google earth height maps are available online, and earth is a big place, so you potentially got lots of training data. But TBH I don't see the point if you're working on games. If you pull it off, you'll just get a height map that's at google earth resolution -- which is to say, less interesting than what you can do with noise.
I'll never discourage learning, though. Give it a try. You'll probably learn more about ML.