Working on generation for a world map for my Gemini MMO game. So far it is generating mountains, plains, hills, valleys, water, coasts, and plateaus. Each tile on the map represents a 10 square kilometer region that a colony could settle in.

The next land type I'm going to add is rivers. After that, I will start work on biome generation.

In the generation code, After the land types are generated, the game will then generate biomes based on the land type of a tile and its adjacent tiles. This ensures that biomes only occur in land types that make sense, and that biomes that shouldn't be next to each other are not next to each other. It will also take into account the equator of the map so that hotter biomes are near the equator.

The biome and land type of your chosen tile region determine what plants and animals and resources are available naturally, as well as the seasons, weather, and climate of the region. The location of the tile also determines sunrise and sunset times, and therefore the times at which colonists wake up and go to sleep, and how long daylight is within that region.

Pretty much all of these factors will affect the types of buildings, technologies, and items you will need for your colony to survive within that region.

Finally, land types and biomes will also affect where trade routes can be placed within the world map.

MMO Game World Map WIP

๐Ÿš€ clseibold

May 02 ยท 2 months ago ยท ๐Ÿ‘ dragfyre, Nexy, lowpass

7 Comments โ†“

๐ŸฆŽ bluesman ยท May 02 at 18:16:

Wow. Ambitious!

๐Ÿš€ robert ยท May 02 at 18:55:

What's the generation look like? I've used perlin noise and some math to simulate erosion before in my unfinished game. Yours is a bit more complex than a mere heightmap however.

๐Ÿš€ clseibold [OP] ยท May 02 at 21:00:

@robert This is just a very general overview, but right now it's all essentially built with a base perlin noise and overlapping layers of perlin noise, random numbers, and checking the characteristics of tiles to then generate other characteristics within that tile or in adjacent tiles:

There's a base Perlin Noise and an offset added for a basic slightly hilly plains, and the offset is to get it so that values below 0 are less common so that they can be used for water. Then I take that height map and add mountain ranges to it.

I generate random mountain peaks and raise the altitudes of those tiles on the map. For each peak, the base height is 1.0, so that everything above 1.0 is a mountain. An angle is randomely generated so the mountain range follows along than angle, and then that angle and the distance from the mountain peak is used to change the tile heights to gradually fall off, blending in with the current land.

Perlin noise is used again to create extra water bodies (medium and large). The new perlin noise generator determines where I should place them to begin with, and then the altitude of the tiles on the map are changed to the new water depth.

And then perlin noise is used again to randomely place plateaus, but only if the heights are above 0.25 (near water) and below 0.9 (near mountains). You can expand the plateaus out to smooth its edges too.

After that, almost everything else, except for the climate calculations, are based on something else.

Rivers start at mountains and always flow downwards, and they stop if and when they reach a body of water. Rivers will also affect everything generated after them, too.

Next, I generate climate - the seasonal rainfall and seasonal temperature of a tile - with perlin noise and the distance the tile is from the equator, mountains, and bodies of water. It generates a rainfall and temperature of every tile for each season, as well as the average of all the seasons.

It also takes into account the altitude's impact on the temperature. Bodies of water and mountaintops will increase rainfall. There's also the rain shadow effect where one side of a mountain will get less rain. Lastly, bodies of water warm and cool more slowly than land, so the climate temps should reflect that. They also get more rainfall too.

The climate then effects everything generated after it.

Ponds, streams, springs, and marshes are more common/supported in places with higher rainfall. Both bodies of water and springs can also support ponds and streams. Winter snow will also increase the chances of springs because of snowmelt in spring. Springs are also more common along the foot of mountains, plateaus, and hills. So I just check if the tile has any of this stuff and increase the chance number of generating the spring. It's the same process with marshes and the other things.

After that, I do land features in plains areas: groves, meadows, scrubland, rock outcroppings, seasonal flood areas, and salt flats. These are all highly dependent on climate and altitude and how close they are to bodies of water. Flood areas will spread out up to a maximum distance to tiles that are same or lower altitude.

Deserts are generated mostly by looking at the climate information that was already generated. Deserts on earth also tend to be around the 30 degree latitude mark, so that is simulated that for the map too.

Valleys get marked when there's two tiles of high elevation with one tile of lower elevation between them. Valleys next to water are considered river valleys. And the last thing is coastal areas, which are just the adjacent tiles to the larger bodies of water.

Lastly, all of these things can be accounted in the terrain cost for the A* Search Algorithm if one ever wanted to do game trails or land traversal stuff. I do have game trails that take into account climate, but I don't know if I'll keep it since they are static (generated once at map generation), and generic (they don't specify particular animals). The game trails start at a water source and end at some food source or other natural feature. Shade (trees) also affect the terrain cost for game trails.

There's a couple of things I haven't done yet but am considering:




๐Ÿš€ robert ยท May 04 at 19:30:

Thanks. I was expecting some kind of perlin noise or wave form collapse, but not so many iterations. Sounds like you've put some thought into this, what with the climatology, geology, etc.

๐Ÿš€ clseibold [OP] ยท May 04 at 19:58:

@robert Yeah, I had to research *a lot*. I have 39 biomes, 11 different land types. I'm actually currently implementing about 90 different tree types/species in the game right now, all to ensure that each biome (almost!) gets at least some form of tree. It might be a bit excessive, but I think it adds richness to the game world, especially since it's text-based.

I'm still new with the perlin noise stuff. I've learned how to blend two perlin noises by weighting, adding, and even doing some perlin noise masks, I think they're called. And I know how to change the amplitude, add an offset, or scale the noise from [-1, 1] to [0, 1] or [0, n]. But I've never done any wave form collapse, and perlin noise is still a little hard for me to reason about fully, particularly how the scale factor changes things. The amplitude is much easier to grasp than the scale factor, for me.

Even in places where I set things randomely in the world or I use some calculation for the placements of things (like with the climate stuff), perlin noise is still added in for a little variation. So climate is primarily influenced by latitude, and altitude will subtract from the base latitudinal temperature, but then there's a perlin noise value added in at a ~0.2 weight for some local climate variation.

If I wanted to be even more accurate, which I might do, then I would add in wind patterns and water currents and this should help make the climate even more accurate. I think the avg. rainfall generation could be vastly improved by this too, which would probably affect a lot of other things, but will certainly affect the assigned biomes. Rainfall should also be affecting the avg temperature, iirc, but currently it doesn't.

I think the iteration/layer approach is much easier than trying to get the correct perlin noises to all combine/blend correctly. It's also required to have climate a separate iteration, which means anything based on the climate also becomes a separate iteration.

I don't really have to think about infinite procedural generation though, because my map size remains static, so I think that makes me able to do things you wouldn't be able to do in other types of games. For example, I can actually have an equator and poles, unlike minecraft, lol.

๐Ÿš€ robert ยท May 10 at 20:08:

There is a voxel game with a procedural world similar in scale to Minecraft called "Vintage Story" It manages to have latitude based climate bands but they loop infinitely, so the climate gets colder as you head north but eventually it starts getting warmer again as you transition from polar ice back to temperate forests, deserts etc. and then back again. Over and over. Not completely realistic but I thought it was fun. It has seasonal weather as well.

๐Ÿš€ clseibold [OP] ยท May 10 at 20:16:

@robert That's really cool! That's also a decent way to do it to still have an equator-type-think in an "infinite" procedural world like that.

I'll have to check that out.


Source