Saturday, April 16, 2016

procedural generation - Smooth Biome transitions with tile map?


I'm using a simplex noise system to generate height maps for an "infinite" 2d world map. It works perfectly - I can define which tile belongs at which height value, etc.


However, I'm trying to add in biomes - I want different areas of the map to use tiles exclusive to that "biome".


I've tried generating a second noise value divided by a larger number so that I can generate very large areas. That noise value determines the biome, and the noise value for tiles determines the tile inside that biome. This works ok - but when the same noise value means different tiles in each biome, then you wind up with very ugly cut-off lines between biomes.


I tried adding the biome noise and tile noise together and only selecting the tile based on those. The edges were smoother, but there really was no actual use of the biome code - just tiles locked to unique noise values, never overriding each other.


What's a better way to do this, so that biome boundaries follow "features" of the terrain? I want them to be fairly large, but not cut through a "mountain" - the boundary should follow the natural curvature of the height map values.



Answer



You should be including the elevation in your biome generation (higher elevation reduces temperature, and above a certain height, reduces moisture). See this question and my answer for more details on that. Basically, you should add multiple large noise values, for different aspects of the terrain. You can get more detailed and apply wind patterns that carry moisture from wet areas and deposit it in dry areas. The wind would be blocked by high elevation, creating deserts on the other side of the mountains, similar to what happens in real life.



If you want even smoother transitions (visually), you'll need to make tiles to represent the transition. You may consider creating textures for these tiles on-the-fly with texture blending. Blend the two textures of the bordering biomes based on the percentages each has in that location.


No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...