July 12th, 2013, 12:10 PM
Randomely Generated Earth-Like Terrain?
I would like to know how to create a randomly generated terrain, maybe about the size of earth that is completely round so that somebody in a game can travel all the way around it, if they had the 376 days non-stop needed to walk it. It's a simple question, about a fairly simple topic that may take up a bit much of space on a hard drive. I don't need to create any of the physics or anything now, just a randomly generated planet that I can use. Although, it might not be that simple to make. I think I will be able to tweak the size, too. For testing purposes. If I can't get a good reply, then I will .
July 12th, 2013, 06:47 PM
This is a pretty huge subject, because "planet" is a pretty broad description. And well designed maps feel like real planets do -- as in the direction of water erosion matters, as does sea level.
So most generators start by applying a set of rules in succession to a sphere.
First off is Big Elevation -- a random generation for general elevation which is guided by two rules: how big/deep should the biggest depressions be permitted to grow, and how big/high should the biggest extrusions be permitted to grow. The point is to start with a slightly lumpy plant you can apply water erosion rules to next.
Next is Erosion. It should make the steepest, highest elevations sharper, the lower, flatter elevations smoother, spread out the bits where sea level is, and carve rivers where downward basins exist.
Then micro-terrain. This is what gets you your randomness, and is usually the only step map makers actually do (they usually have enough back story from which to manually create the map up to the point Big Elevation and Erosion would do). This is where you let a random process take control of small regions at a time (usually based on zone rules) and modify them to roughen up the terrain where you want, scatter trees, boulders, and other debris about and start coloring things as it goes (deciding what is grass, what is sand, etc.). Getting this right is hard, which is where the zone rules come in. You make rule sets for what debris are permissible (mangrove trees shouldn't be in the permissible set for a desert zone, for example), the density of different types of debris, and the density of the roughing modifications you want.
If you want to detail a whole planet automagically and you don't really care how the result turns out, then just start with a sphere, write a process that makes up zones on its own and have it control the micro-terrain process, and viola, you'd have a (horribly weird) planet. You can probably get away with just writing an elevation variation process for microterrain (so you get sort of wavy hills) and then putting crap (trees) in the way so the player can't see too far at once.
Its been a long time since I did any of this. I bet today there are sooper-dooper planet generating libraries that make all this a snap.
July 12th, 2013, 08:56 PM
I wish that were real (the thing about the complex planet library).
July 12th, 2013, 10:37 PM
There most certainly are such libraries in existence somewhere, whether they are publicly available or are in game dev house X's close-held secret toybox is the question. I'm sure there are disparate elements to be found here and there anyway.
Regardless, writing your own toolkit wouldn't be too hard unless you have really stringent requirements. Do you already have a data model that describes how the terrain is plotted? If you do its not very hard to start populating values on a set of rules as a test to see how things turn out -- and then tweak the rules and start deciding how you want to segregate such rules from one another.
July 13th, 2013, 08:09 AM
I just don't really know how to make it that big and wrap around all the other terrain. It would take ages to make it with a manual terrain maker today because it's so big and I can't have crazy giant 4 quadrillion foot high mountains. It needs to have more realistic terrain. What you would see from a character's perspective. I wish I had access to that library .
July 13th, 2013, 10:35 AM
Do you know either what the map data structure looks like or have an API you can call to input generated terrain details? If you know either, you can toy with a generator idea and start working the kinks out a lot faster than you might think.