Tuesday, September 20, 2022
HomeGame Developmentprocedural era - Tips on how to discover out which biome the...

procedural era – Tips on how to discover out which biome the participant is at the moment on


I am utilizing Godot 3.5 and OpenSimplexNoise to generate my 2D topdown world with proper (auto)tiles. How can I detect on which biome I am at the moment standing on?

That is how I generate my map (indirectly simplified pseudo code)

for (x : WORLD_SIZE_X)
    for (y : WORLD_SIZE_Y)
         m_temperature[{x, y}] = openSimplexNoise.getNoise2D(x, y);

for (x : WORLD_SIZE_X)
{
    for (y : WORLD_SIZE_Y)
    {
         float temperature = m_temperature[{x, y}];
         if (temperature > 0 && temperature < 0.5) // forest
             m_tileset.setCell({x, y}, forestCellID);
         else if (temperature > 0.5 && temperature < 0.8) //desert
             m_tileset.setCell({x, y}, desertCellID);
         else
             //and so on
    }
 }            
   

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments