Skip to content

SolarizedRed/lands

 
 

Repository files navigation

Lands - a world generator

Build Status

You can generate worlds data (heighmap, biome, etc.) and images for your own worlds.

For example:

python lands/generator.py world -s 1 -n seed1

Worlds are generated using plate simulations, erosion, rain shadows, Holdridge life zones model and plenty of other phenomenons.

Once a world it can be used for simulation civs evolution (see project civs).

For a generated world is also possible to generate additional maps, for example ancient looking map:

python lands/generator.py ancient_map -w seed1.world

Install

Windows

If you want to run Lands on Windows you can read these instructions.

Linux

  1. Install python 2.7
  2. Install pip
  3. Git clone / download the repository
  4. Run pip install -r requirements.txt
  5. You should be good to go!

Output

The program produces a binary format with all the data of the generated world and a set of images. For examples seed 1 produces.

Elevation Map

Precipitation Map

Temperature Map

Biome Map

Ocean Map

Usage

Short Long Description
-o --output generate files in OUTPUT
-n --worldname set WORLDNAME
-s --seed use SEED to initialize the pseudo-random generation
-t --step use STEP to specify how far to proceed in the world generation process
-x --width WIDTH of the world to be generated
-y --height HEIGHT of the world to be generated
-w --worldfile WORLD_FILE to be loaded (for ancient_map operation)
-g --generatedfile name of the GENERATED_FILE (for ancient_map operation)
-f --resize-factor resize factor
-p --plates-resolution plates resolution
-q --number-of-plates number of plates
--gs --grayscale-heightmap produce a grayscale heightmap, after the option it expects the name of the file where to generate the heightmap (e.g., --gs bw.png)
-r --rivers produce a map of reivers, after the option it expects the name of the file where to generate the map (e.g., -r rivers.png)

For example these commands:

python lands/generator.py world -s 4 -n an_example -p 2048 -q 25 -x 2048 -y 2048

Produce this output

Lands - world generator
-----------------------
 seed              : 4
 name              : seed3
 width             : 2048
 height            : 2048
 plates resolution : 2048
 number of plates  : 25
 operation         : world generation
 step              : full

starting (it could take a few minutes) ...
...plates simulated
...elevation noise added
...elevation level calculated
...precipations calculated
...erosion calculated
...humidity calculated
...permeability level calculated

Biome obtained:
     subtropical thorn woodland =   16353
                tropical desert =     188
             boreal rain forest =   69472
        tropical thorn woodland =   19680
            subpolar dry tundra =    6316
      warm temperate wet forest =   17799
            subpolar wet tundra =   24453
          subpolar moist tundra =   15104
            tropical wet forest =   18441
           subpolar rain tundra =   79723
           tropical rain forest =    5906
                            ice =   85254
          tropical moist forest =   28871
        subtropical rain forest =   14733
            boreal moist forest =   24395
              boreal wet forest =   35212
         subtropical dry forest =   26259
       subtropical desert scrub =    3256
       subtropical moist forest =   25220
    cool temperate desert scrub =   11162
          cool temperate steppe =   25604
               boreal dry scrub =   13403
            tropical dry forest =   22415
       tropical very dry forest =   27033
          tropical desert scrub =    2473
    warm temperate moist forest =   27704
    warm temperate desert scrub =    4861
     warm temperate rain forest =   10774
    cool temperate moist forest =   42770
      cool temperate wet forest =   52813
      warm temperate dry forest =   29992
                          ocean = 3314282
          cool temperate desert =    2950
             subtropical desert =     287
          warm temperate desert =     709
     cool temperate rain forest =   46844
         subtropical wet forest =   18280
                  boreal desert =    5445
     warm temperate thorn scrub =   16175
                   polar desert =    1693

Producing ouput:
* world data saved in './an_example.world'
* ocean image generated in './an_example_ocean.png'
* precipitation image generated in './an_example_precipitation.png'
* temperature image generated in './an_example_temperature.png'
* biome image generated in './an_example_biome.png'
* elevation image generated in './an_example_elevation.png'
...done

This is the corresponding ancient map

python lands/generator.py ancient_map -w an_example.world

Algorithm

The world generation algorithm goes through different phases:

  • plates simulation: it is the best way to get proper mountain chains. For this pyplatec is used
  • noise techniques are used at different steps
  • precipitations are calculated considering latitude and rain shadow effects
  • erosion is calculated
  • humidity in each zone is calculated
  • terrain permeability is calculated
  • biome is calculated using the Holdridge life zones model

Install dependencies

Using virtualenv you can install the dependencies in this way

virtualenv venv
source venv/bin/activate    
pip install -r requirements.txt

Requirements

Libjpeg is required by PIL

Contributors

Evan Sampson contributed the amazing implementation of the Holdridge life zones model and improved a lot the ancient-looking-map, biome, precipitation and temperature generators. Thanks a million!

About

World generator using simulation of plates, rain shadow, erosion, etc.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%