Biomes and map generation

Nym Traveel

Active Member
Contributor
Art
World
Let's go :)
I roamed around in the source for quite a while now and I think I understand world/biomegen to a decent level now.

Short summarisation of the two main classes (in my eyes):
org.terasology.logic.world.WorldBiomeProviderImpl
Basically generates two noises for temperature and humidity and calculates the biome based on these.

org.terasology.logic.world.generator.core.PerlinTerrainGenerator
Where the magic happens.
The main thing is generateChunk which decides what block is what based on a density map.
Most important is the creation of the density map in calcDensity. This one I don't totally understand, but I can see that humidity and temperature (so basically the biomes) are used to create a distanceToMountainBiome which is used to compute a mIntens etc, finally resulting in a long formula to generate the density.

So basically we have:
Terrain affected by temperature, humidity
Biomes affected by temperature, humidity

Multiple people requested a wider variety of landscapes.
My approach would be:

First: set biomes by a huge 2d noise. Other Biomes could be added quite good, changing biomesize is a matter of changing a multiplicator of the noise.
(Biome inspiration can be found -here-)
If the noise is not too wild, we should even get a nice alignment - like if very low noise values mean desert and very high mean glacier it would be very uncommon, yet not impossible that those two are directly next to each other.
Second: set terrain accordingly to the biomes, so a Forest will get less mountains than a high mountain region.
optional third: If humidity and temperature is needed for anything other:
every Biome gets a default humidity and temperature + a suddle noise overlay. By this the biome specific range would fit plus we have a bit of variation.

So, what are your thoughts? Is this a feasable/good methode?
so long,
Nym
 

mkalb

Active Member
Contributor
Logistics
I have an idea for a new biome creation class/algorithm.

If you look at this wikipedia articles a solution with bands/ribbons would be more natural.

Climate
Biome

Each color of this image is a biome/climate. The blue areas are oceans and lakes.

ClimateBiome.jpg
 

Immortius

Lead Software Architect
Contributor
Architecture
GUI
I think it would be nice to generally evolve the Biome Provider into a provider of various world information, leaving the various generators to read out of it information to do their work. So then changing the world to do something like, say, be generated based on a precalculated map rather than noise would just require switching out the Biome Provider from a noise based one to one based on midpoint displacement or whatever.

Or in other words you have a model that describes the world abstractly, and generators that transform that model into the world itself.
 

Nym Traveel

Active Member
Contributor
Art
World
This would be very nice!
In fact the seperation you described is kinda my seperation in first and second.
I'm not very well-read with this whole topic but I can imagine starting on this topic when the real programming cracks are busy with other stuff, if you want ;)

mkalb: thats exactly what I meant - didn't say anything about how the noise should look like :)
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Great initiative! Have you roamed around the forum and issue tracker some too? There's another nice world gen thread in the incubator for instance, talking mostly about world shape, finite vs infinite, etc. Polygon-based island / continent / civilization generators have come up too, and I love the idea of using those to shape the actual world land vs water. Several others have shown interest, including glasz and dacresni

Yeah there'll be a few layers to any approach, both infinite and finite have unique benefits. It would be nice to write up an overall model supporting the wide potential, then coming up with a way we could aim for that while only doing one small piece at a time (keeping it realistic)
 

Immortius

Lead Software Architect
Contributor
Architecture
GUI
I'm not very well-read with this whole topic but I can imagine starting on this topic when the real programming cracks are busy with other stuff, if you want ;)
Feel free to do so, if you have the time and the desire. :) I'm not likely to work on that bit any time soon (maybe water), not sure what Begla is planning once he has time on his hands again.
 

glasz

Active Member
Contributor
Art
One first path suggested was to follow this tutorial . I started to code some delaunay triangulation but it didnt work, and i can of gave up and moved to other stuff.
 

Nym Traveel

Active Member
Contributor
Art
World
glasz This approach is very interesting, although we wouldn't have overhangs with the 2d Polygons...
But I'd like to read into this topic anyway :)

Cervator I found this thread but as it's quite old and there was not much movement I decided to open this thread to take a semi new approach. The issue tracker is completely new to me ;) (and I just have superficial knowledge with git :O )

So I will commence to make a structured analysis of what ideas we have so far and it's up/downsides and present it in the course of the weekend probably. Then we can evaluate better which path to go :)
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Great - thanks!

Also, it isn't my expertise, but I figured the polygons things was for creating the "world map" layer - then actual chunk-level detail would generate later as needed, which could possibly generate overhangs and so on via whatever tactic that uses
 

Nym Traveel

Active Member
Contributor
Art
World
This could be very interesting.
So the world map describes the overall shape and height of the map, regional things like hills, plateaus etc are added later. Sounds great. Finally we would have mountains be really high (not just from sea level but also when you are at the botom of the mountain you are several meters high).

I'm quite interested in how far we can scale up the max world heigh for real mountains. (*starts dreaming*)
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Yeah don't count on 256 as max height permanently. Pretty sure we'll end up with vertical chunks and the ability to support infinite height eventually :)

Overall world generation could probably be grouped into four categories:

1) World type - selected at world create time, high-level details like finite vs infinite, climate bands vs random biomes, ocean focus vs land focus, etc - this step is entirely completed and set in stone after the player clicks "Create"

2) World map - generates first as per the settings the player chose, could use that polygon generation technique and any number of other fancy things, may pregenerate the whole world's map for (small?) finite maps or just a large section for infinite maps. More world map stuff may generate later if provoked by exploration (or world editing - could reset a whole continent you're not using if you want to regen with some changed options)

3) Regional features - a city location may generate on the world map, but not exist as a city until the player gets close. At that point local chunk generation/loading likely won't load the whole area meant to be covered by the city at once so we need it to exist in a light-weight form outside the world of chunks (what I called a "meta block" in the old days, but applied to chunk-level features - "meta-chunk"? heh). The whole city as a meta-object would generate when provoked by the player, then chunks would generate based off that. This might also be a way to let NPC civilizations evolve over time without being loaded within range of a player (they develop as pure meta-objects)

4) Chunk generation - what we've got currently. Local features and where all blocks live. Currently chunk 1 doesn't know a thing about chunk 2, they just fit together because they generated off the same backing Perlin map/noise/gizmo/thingie I don't fully understand or really need to :)

There's good potential to pile in tons of regional features, especially as mods. Some of the base stuff could be caves, underground structures, chasms, ravines, fortresses, roads, etc. Some could be based off the world map (there's a procedural road generation mention in one of those articles, I think the polygon one)
 

Nym Traveel

Active Member
Contributor
Art
World
Yes, something like this will be used :)

I just wanted to give a little update:
I'm still struggling with a newly setup pc and also have problems to get my ideas sorted and then made into code. So I'm not dead or leaving, just not really good and thus slow ;)
 

Nym Traveel

Active Member
Contributor
Art
World
Slow but steady I progress ;)
My current plan looks as follows:

First of all comes the world generation.
I want some 2D noise for the overall world map as it's fast to compute.
Recently i stumbled upon plasma fractal which i would love to throw into the equation. I currently work on making these things tileable without too much of an effort and bring a good seedmanagment into it.

Also I found a nice article about eroding which would require some more calculation effort though. Implementing this would definately seperate us from most other Voxel games...

After this first step comes the 3d Perlin noise added into the game which i want to steer based on the heighmap generated by the above process and two other 2d Perlin noises (humidity, temperature). Like this we can control the details added by the 3d noise, going wild in the mountains and leaving flat areas for other biomes

The problem with this currently is:
When we want a full 3d grid with dimensions humidity, temperature, elevation to drive the biometype we would need to fill this thing up completely ->way too much possible combinations. What shoud hot, humid, high be in contrast to hot, arid, high?
Possible solution: make just the regular humidity/temperature grid and have the heigh subtracted from the humidity and temperature map. Thus, high mountainous regions would be colder and more arid.

Oh and if you want you can help me filling this grid as creative as possible :)
(enumeration based on the following principle)


Well, thats all for the news for today, keep it going!
-Nym
 

Josh

Member
Contributor
Hunter
Have you thought of adding more flat land? The only thing I seem to find are mountains everywhere :p
 

Nym Traveel

Active Member
Contributor
Art
World
Thats what I intend with this approach ;)
I want some larg scale elevation over several hundreds of meters, barely noticable like in meadows regions for example. In mountainous regions the 3d noise comes into play and will give us some nice mountains with overhangs etc :)
 

Skaldarnar

Development Lead
Contributor
Art
World
SpecOps
I recently played a bit with WorldPainter for MC and tried to create some very natural looking landscapes. I think I will post some screens from that and give you the size of the created map, so you can get a feeling of the actual size/dimension.

When it comes to mountains I would like to see something a like a tree line, and above there should be more gravel/dirt/stone then grass. The mountain tops should be just out of stone (maybe covered with snow, dependent on the biome....?).
Just a few thoughts, give some feedback what you think of that. ;)
 
Top