Biomes and map generation

Immortius

Lead Software Architect
Contributor
Architecture
GUI
I have implemented the erosion technique described in that paper, so feel free to ask me any questions you have about it.
 

Nym Traveel

Active Member
Contributor
Art
World
The second thing is quite easy to accomplish imho.

I want to call all of the programming cracks, I have quite a brain-teaser for you:
It's about midpoint displacement, other called plasma fractal. To make it tileable I need to generate the same pseudorandom number for the edges of a square. This alone could be easily achieved by just hashing the corner coordinates plus adding the seed (by some arbitrary function). The problem is that i want to take the 2d noise to shape the overall terrain. if i use just one random number i can have the deep sea on one chunk boarder and on the other some mountainous region. Thats in fact not what I want. So, one "solution" is shown here:



Imagine the vertex 1 to be the first point of the original chunk. The random value of two equals the value of 1 + some offset (maybe coordhash+seed or whatever, fixed but random). 4 is generated by the same procedure.
First problem occures now: how shall 3 be created? 4->3, 2->3, 1->3? Let's assume 1->3.
(To shape the lands a bit more one can allow more offset to 4 than to 2, resulting in some stretched out landscape - but that's optional.)

Now chunk b shall be created. Vertices 2,3 are already calculated. 5 and 6 are calculated based on 2 (Same procedure as in chunk a.)
for chunk d we now have a problem because the lower left one isn't calculated yet. Different ways 2->8, 5->8 give different results. Thats the overall problem: the way determines the outcome which is not desireable as the seed should set the world in stone.

I could imagine some sort of always compute an L shape to get to the current point (In the upper example: to get to 9 go 1789 and to go to 6 go 1436).
Problem with this is: as we proceed by going further down the line all those random little offsets can sum up and we get the initial problem of having deep sea and high mountain in one chunk.

I'm quite desperate right now and just could resist on tagging all of you in here to make you aware...
And if you ask why i want this crazy thing in there: it just gives great shapes ;)
Possible other solution: just scale it up to for example 1024x512 and use the pseudorandom thing from above. Difficulties here: Save this array in a good spot, this will be accessed by many chunks generated at completely different times...

Ok, end of the presentation right here, what are your thoughts?

Edit: is the erosion thing already in the code somewhere? This thing shoudn'T be much of a problem, maybe calculate one row of blocks more to be able to erode the outer blocks but this should be doable :)
 

Josh

Member
Contributor
Hunter
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. ;)
What about volcanoes? those would be cool in hotter/more tropic biomes/regions
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
I like all the fancy math but am doing you all a favor by staying out of it :D

Nym Traveel - are you focusing more on the world map generation scope or chunk generation? I figured at first we'd want to go after the world map to reshape how humidity/temperature and land/sea are distributed in biomes, but still let the existing chunk generation generate blocks? Then maybe at one point extend that into new biomes we don't have currently, like different kinds of mountains. And add regional features sometime :)

Josh - As for volcanoes, like cities they should be regional features applied after base terrain generation is done. I guess they might be more likely in some areas rather than others, like mountains

As for biome listings, there are a bunch of existing collections out there, but I can't find the one (Minecraft mod) I was looking for that had a really nice list. Here's one but the one I remember had a table ...
 

Nym Traveel

Active Member
Contributor
Art
World
I'm currently focusing on world map generation. As of now I want to take back the old 2d Heightmap with some eroding for the large scale and add the mountain details locally with the help of 3d perlin dynamically controlled by the biome lookup function (and hopefully find a way to save some computing capacity by doing so)
In a 1h discussion with my dad after lunch i think I got an idea to control the tiling of the plasma fractal, quite happy about this :)
Where the chunks actually come into play is just the size of the tiles, out of convenience I wanted to make them 16x16 and thus chunksize so I could pin the 2d array onto the chunk-object (and maybe add 4 values for the boarders as i need them for the next chunk)

Currently the scope for the temperature(t) and humidity(h) is 0 - 1.0 and elevation(e) yet to be quantifised.

If you want to help fill the lookup table, feel free to go to wikipedia/biomes or the link Cervator posted one post above, write a list or just some notes.
For example:
"I'd say we definately need some hostile to life wasteland which should be t>0.9, h<0.1 e~?
Desert shall be one step more friend like around t>0.9, h<0.2, e~?
etc..."
I would much appreciate this :)

After all this would regional features come into play but atm I just want to make some awesome overall landscape. :)
 

Immortius

Lead Software Architect
Contributor
Architecture
GUI
Edit: is the erosion thing already in the code somewhere? This thing shoudn'T be much of a problem, maybe calculate one row of blocks more to be able to erode the outer blocks but this should be doable :)
No, I did it in Unity3D a while ago.
 

Nym Traveel

Active Member
Contributor
Art
World
Ok, it's quite late but I wanted to get this post out.
I played around some more with the plasma noise thingy and came to the conclusion that the only way to make this thing a realistic scale is to scale the tiles up. I attatched the code, it's just a little java applet overall. Feel free to play around with the settings and tell me if you like it (and please go into the settings for the applet and bump up the size, the default 300x200 or whatever is a joke^^). As of now there is nothing really optimised on this ;)
Random values for every point are generated using a huge integer-hash function which is horribly slow but i had problems with periodicity of a random Array.
Personally I like the outcome of this, I will implement the Perlin-noise one of the next days and hopefully get similar results (Perlin is way faster ;) ). Otherwise I have to chat with one of you programming cracks where to save a 2048x128 matrix (some powers of two forwards or backwards) which can be in charge of many chunks (as many as matrixentries/16²) ;)

This will hopefully result in a very convincing terrain :)


ok, paste in the code tag exceeds the Message length and .java files aren't allowed to be upload. So please rename this to .java and feel free to adjust the settings in the source ;)
 

Attachments

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Here - easier :D

https://github.com/MovingBlocks/TeraMisc/commit/fc71c0c298ef5a669016b11f48bddc2a231b0fab

I set it up in IntelliJ with the existing project setup you can generate under TeraMisc. I'm not sure how to define util/plasma as a source directory, so had to do that manually, then also tweaked the applet resolution in the run config that'll auto-generate by running the class.

Played with it some, pretty cool. Especially messing with the settings. Makes nice banded images that seem very clear. You're thinking generate something like one of these at a fairly nice size and that's the world map, right? Or maybe those are climate bands for use in biomes. Land/sea would probably not be quite that bandy. Sensible to combine that banded setup with a sea/land generator like that polygon thing? Or more of a regional thing? :)
 

Nym Traveel

Active Member
Contributor
Art
World
This could be anything ;)
I also had problems on getting it to work properly, but now I think it works :D

I updated the whole thing and mixed a perlin noise into it. Unfortunately my 2d version doesn't work properly by now but I'll fix that next week ;)

If you want to play with it:
you can change the settings as usual. Also the most important function drawMixed. This one blends the perlin noise and the plasma fractal. I set it up so that computeColor automatically cuts everything beyond black/white so don't worry to go wild with the formulas ;)

With this version i recommend you to check out at first the +21 seed (there would be a mountain chain at the top right) and the +11 seed which is more flat :)
Sea level yet to specify;)
Of course this is all not final, there's much tweaking left to do ;)

My Todolist:
add two other noises for temperature and humidity and make the calculate color a bit more fun :) (so for example the redvalue represents temperature, blue humidity or sth like that ;)
Then port the magic into Terasology and add the 3d Perlin stuff

Have fun with it and maybe post one or two pictures with corresponding seeds ;)

so long,
Nym
 

Nym Traveel

Active Member
Contributor
Art
World
half of it is original TS stuff anyway ;)
I would wait with merging it until it's sophisticated
 

mkalb

Active Member
Contributor
Logistics
The "dev" package is for developing stuff. It is not included into the game (ZIP, Applet, ...)
 

Nym Traveel

Active Member
Contributor
Art
World
As this would be quite a huge impact, I'd love to see all people involved with the topics mentioned to read and comment! (of course all other coments are welcome, too ;) )

Another update from my construction site.
I currently work on some basic implementation of the plasma fractal and think about handling the fairly big size of it.

Besides that, I stumbled upon a really -interesting thesis- which is primarly concerned with simulating plate tectonics! More pictures, a video and some text can be found -here-.
There are, however some concerns:
  • Biggest issue first: The source is published under the GPLv3 which forces the users/modifiers of the source to also publish with this license (as far as I understand...). I'm really not an expert when it comes to licensing, maybe Cervator knows better. I would anyway have to port this from c++ to java and tweak certain things to fit TS. Maybe a little conversation between us and this guy could help ;)
  • This would be the step away from infinite terrain! Thats the fee we'd have to pay. However, we wouldn't have a hard edge but things that leave at the bottom will appear at the top et vice versa. The longer I think of this possibility, the more likable gets this idea. I mean, if we take a 512 map for basics, a cube with one meter and one pixel on the heightmap is responsible for lets say 1000 cubes (or just 500, to be discussed) we'd have a whopping 512km in each direction which is 262144 km² which is nearly double the size of Florida (or nearly as big as Bavaria in Germany with the 500 variant). Of course the 3d Perlin would come into play when calculation the actual high LOD the player sees but we'd have a variety of features (islands, mountain regions, flatlands) we couldn't dream of with a fully noise based solution.
  • Simulation time: the author has a Pentium4 4x3.0 ghz and 1gb ram. His map with 512 resolution needed between 70s to 140s, the bigger map with 1024 needs 300s to 480s! As one minute is fairly much it's an unreasonable demand to let somebody wait 5 to 7 minutes for the game to start! Anyway, to be honest: I think that these times can be beaten down by a bit more powerful pc with some more ram... (a little, nice to have feature would be drawing the animation of the plates on the load screen, so the player sees his world being created ;) )
Well, besides the nicer overall landscape, this has also some other advantages:
  • When I look at the current development, theres much progress in things like history/culture and also the building/city generation. With a deterministic overall world, we could mark regions for the different sides, like capitals, weapon-free-zones, etc. Also we could write algorithms for city placement more easily. Cities won't just pop up, they have a reason to be where they are - at the foot of a mountain, evolved by some settling miners, a fishermen village at the ocean, etc. . Trade routes are also easier to calculate when we know the position of the city in advance.
  • low lod rendering. I mean, if we know that 50 km farther will be mountains, we could render them based on this and fill our horizon :)
Hm, I certainly missed out some points but I wanted to start the discussion.
so long,
Nym
 

Skaldarnar

Development Lead
Contributor
Art
World
SpecOps
This sounds really interesting to me.. What's about offering this map style as an alternative world generation (such as the flat option?). I will have a look at the thesis, but from the other papers mentioned I can see the benefits for village and road generation. The LOD idea has my full consent as it makes the world look more natural (and the player feels more like he's in another world rather than in a video game).
Nonetheless, the technical aspects have to be considered. To me it seems that a P4 4x3.0 GHz and 1GB RAM are not so little specifications (for example for kids playing with daddy's old laptop or something....).Though, we have to reduce these requirements or offer an acceptable alternative such as the standard perlin noise approach.

Just my inital thoughts on that, I think this is going to very interesting discussion here :)
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Good stuff, and the finite world option has come up before. I don't think a one time lengthy world generation for something like that would be much of a problem, DF does that too and yeah if we can graphically display the progress to the user then cool :)

Yeah GPL would be tricky, but drawing inspiration for something similar in Java shouldn't be a big deal I figure.

Will leave this up for more review when I get back from work, gotta go.
 

Nym Traveel

Active Member
Contributor
Art
World
So, I played around with the source a bit and no way of getting this thing to work...
I'm neither an expert with linux, nor c++...

I will read through the thesis probably next week (I'm also on vacation for a few days) and try to recreate this in java (no direct port, going creative on this one ;) ). Don't expect much fancy stuff before 2 weeks or so ;)

The issue about having this as an option is the following:
We'd have double the work for the villages, regions, etc. Also double the work for the world management. With finite world + wrapping around there's imho a complete different logic in the background. I don't think this is good if design decisions always have in background: we need to make this work for both world options.

Thats why I'd like to hear as much opinions as possible ;)
 

Cervator

Org Co-Founder & Project Lead
Contributor
Design
Logistics
SpecOps
Okay, looked at this some more and I'll rattle some cages for more feedback :)

The sample images of generated worlds look absolutely sweet and far more realistic than anything I've seen before. I'd love to see something like that for the finite/planet mode world gen. I do think we can support multiple options including infinite there by abstracting it right. I also think we might want to get some more design in place there so we're working on the right stuff :D

I did a write-up in a related thread (or earlier in this thread, I forget) about world-regional-local features. I've sort of been thinking of these efforts focused on adding a "world" map to the generator system along with maybe some regional flair that we could then base local generation on simply by having the world map provide the seed/temp/humidity stuff, but I probably haven't gotten my understanding of that down right.

Somebody might have to correct/augment me here, but currently we're basing everything on the Perlin noise seed value turning into humidity/temp, biomes based on that, and blocks based on more seed values, right? As long as I'm close to however it works then that's fine. I'm sure I'll get a bunch of stuff wrong, bear with me please :)

What I'd like to see is an option to pre-generate a finite world map like that (or a segment of infinite world map) and use that to supply values to lower level stuff like regional and even local elements. With a finite world we might also be able to take advantage of latitude, climate bands, height (imagine a mountain rising to a couple km above sea level over a few km horizontally), etc, but I suspect we can pass the same from an infinite generator and just replace some with randomly decided / noise seed.

You could have a plate tectonic world map gen only available for finite worlds while perlin world map gen would work for both. You could also have a Ringworld generator at this level, for instance. Biome would be determined at the world map stage and later used for other stuff including local blocks (so existing chunk generators could continue to work unmodified, maybe augmented with average height). Cities etc would not generate at the initial world map stage (although it would be presented to the player as regional features applied on top of the world map during a world generation "movie").

Finite worlds could generate that whole world map in one go, a pure noise option could likewise generate an initial world map, even if it couldn't take advantage of stuff like latitude. It wouldn't be as pretty but it could supply the same data.

At the regional stage you're basing decisions off the world map data but whether you're looking 100km in any direction to see if two cities should be linked via trade route in a finite or infinite world shouldn't really matter other than the terrain being different. Either way the "city eggs" we've talked about would be all that would be recorded.

In finite you might have all of them generate at once, in infinite you'd have your pseudo-world map still, you might just have more to generate later. We get around the trouble of long-distance trade routes by not even determining full info for city eggs semi-distant from the player until even more distant world map has generated. So maybe a city 5 km from the player has a listed trade route with another city 50 km from the player, by the time to player is 10 km within the more distant city more world map generates and attaches a trade route from a new city 100km from spawn to the one 50 km from spawn. If there's a world map info screen the player can get to you might have info that the 5 km city has a trade route to the 50km city, but if you look at the 50 km city information would list as "unknown" unless it is deduced from a known object (the 5 km city)

Numbers made up, of course, and even trade routes are an example more than anything.

I think the double work factor actually comes in at world map stage only - adding a pure noise-based world map for infinite and deriving new info from that, rather than at city placing stage, which would in theory work the same for finite vs infinite. The world map framework itself would just be built once, supporting different world gen models. We already have a terrain preview gadget for bigger maps generated via Perlin, so it might just registering that as a world map generator sibling to a shiny new tectonic plate world map generator :)

This is not my most graceful wall of text ever ... wrote it in several chunks while busy at work. Apologies in advance for any lack of clarity! The super short version: We don't have any concept at all of a true "world map" presently, I think we need to develop that as a design and tectonic (example of finite) plus random (example of infinite) as world map gen implementations, then city gen as a regional step on top of whichever world map implementation. I hope that makes sense :geek:
 

Skaldarnar

Development Lead
Contributor
Art
World
SpecOps
Puuh .. :D what I understood sounds good - and its mainly what I wanted to say :)
Its quite late at night here, so I'm not sure wether I got the road part right. But we can simply build the roads after the player has discovered a second (or third, or ...) city and connect them (and add teleport point to it, whatever).
 
Top