Skip to content

dpaulat/worldengine-cpp

Repository files navigation

WorldEngine C++ - A World Generator

Branch AppVeyor CodeQL codecov.io Docs
master Build status CodeQL codecov Documentation Status
develop Build status CodeQL codecov Documentation Status

The current stable version is 0.19.0

WorldEngine C++ is based on WorldEngine by Bret Curtis and Federico Tomassetti. The C++ project grew out of a desire to link a native WorldEngine library into an application, instead of bringing in the Python runtime. The goal of WorldEngine C++ is to maintain as much functionality and compatibility as possible. While random number generation differs between this and the original project resulting in new worlds, the application produces compatible world files and images using the same algorithms. You can find the original project here:

You can generate the data for your own world, including a number of images (heightmap, biomes, etc.).

For example:

worldengine world -s 1 -n seed1

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

The created world can be used for simulating the evolution of a civilization (see project civs).

It is also possible to generate additional maps, for example an ancient looking map:

worldengine ancient_map -w seed1.world

Manual

The manual for WorldEngine C++: http://worldengine-cpp.readthedocs.io/en/latest/

Interoperability

We would love to see WorldEngine C++ used together with other tools. Worlds generated by WorldEngine C++ can be loaded into applications using WorldEngine C++ itself as a library. WorldEngine C++ maintains interoperability with the original WorldEngine.

Worlds can be saved using the protobuf format or hdf5, for which there are libraries in several languages. We keep working on supporting more formats and always interested in ways to improve interoperability.

Binary packages

Releases for Windows and Linux are available on the releases page.

GUI

An experimental (and limited!) GUI is available as a separate project for the original WorldEngine project: https://github.com/Mindwerks/worldengine-gui.

Building

In order to build the software, you will need the following installed:

  • CMake
  • Python

First, run the setup script of your choosing. Enter the build directory, and run "cmake --build . Configuration=<Debug|Release>".

Output

The application produces a binary format with all the data of the generated world and a set of images. A sample set of data that the application produces is below.

Elevation Map

Precipitation Map

Temperature Map

Biome Map

Ocean Map

There are several optional outputs and many options to control the result. The manual is your friend!

Usage

worldengine [<operation> [<file>]] [<options>]

For details about all the possible options please refer to the manual.

For example these commands:

worldengine -s 4 -n an_example -q 25 -x 2048 -y 2048

Produces this output

WorldEngine C++ - A World Generator (version 0.19.0)
----------------------------------------------------
 Operation            : world generation
 Seed                 : 4
 Name                 : an_example
 Width                : 256
 Height               : 256
 Number of plates     : 25
 World format         : protobuf
 Black and white maps : false
 Step                 : full
 Grayscale heightmap  : false
 Icecaps heightmap    : false
 Rivers map           : false
 Scatter plot         : false
 Satellite map        : false
 World map            : false
 Elevation map        : false
 Elevation shadows    : false
 Fade borders         : true
 Temperature ranges   : 0.126 0.235 0.406 0.561 0.634 0.876
 Humidity ranges      : 0.059 0.222 0.493 0.764 0.927 0.986 0.998
 Gamma value          : 1.25
 Gamma offset         : 0.2
[2021-05-15 18:16:05.715221] [0x000050b0] [info]    Starting world generation...
[2021-05-15 18:18:23.688395] [0x000037e0] [info]    Temperature simulation start
[2021-05-15 18:18:23.712400] [0x000037e0] [info]    Temperature simulation finish
[2021-05-15 18:18:23.712400] [0x000037e0] [info]    Precipitation simulation start
[2021-05-15 18:18:23.731404] [0x000037e0] [info]    Precipitation simulation finish
[2021-05-15 18:18:23.731404] [0x000037e0] [info]    Erosion simulation start
[2021-05-15 18:18:23.777419] [0x000037e0] [info]    Erosion simulation finish
[2021-05-15 18:18:23.777419] [0x000037e0] [info]    Watermap simulation start
[2021-05-15 18:18:23.802430] [0x000037e0] [info]    Watermap simulation finish
[2021-05-15 18:18:23.802430] [0x000037e0] [info]    Irrigation simulation start
[2021-05-15 18:18:23.853441] [0x000037e0] [info]    Irrigation simulation finish
[2021-05-15 18:18:23.853441] [0x000037e0] [info]    Humidity simulation start
[2021-05-15 18:18:23.857443] [0x000037e0] [info]    Humidity simulation finish
[2021-05-15 18:18:23.857443] [0x000037e0] [info]    Permeability simulation start
[2021-05-15 18:18:23.868445] [0x000037e0] [info]    Permeability simulation finish
[2021-05-15 18:18:23.868445] [0x000037e0] [info]    Biome simulation start
[2021-05-15 18:18:23.869445] [0x000037e0] [info]    Biome simulation finish
[2021-05-15 18:18:23.869445] [0x000037e0] [info]    Icecap simulation start
[2021-05-15 18:18:23.871445] [0x000037e0] [info]    Icecap simulation finish
[2021-05-15 18:18:23.871445] [0x000037e0] [info]    Producing output
[2021-05-15 18:18:23.886449] [0x000037e0] [info]    World data saved in ./an_example.world
[2021-05-15 18:18:23.902453] [0x000037e0] [info]    Ocean image generated in ./an_example_ocean.png
[2021-05-15 18:18:23.920456] [0x000037e0] [info]    Precipitation image generated in ./an_example_precipitation.png
[2021-05-15 18:18:23.937460] [0x000037e0] [info]    Temperature image generated in ./an_example_temperature.png
[2021-05-15 18:18:23.954512] [0x000037e0] [info]    Biome image generated in ./an_example_biome.png
[2021-05-15 18:18:23.973517] [0x000037e0] [info]    Simple elevation image generated in ./an_example_elevation.png
[2021-05-15 18:18:23.974517] [0x000037e0] [info]    Done

Larger maps can take quite some time. To generate an ancient map out of this example:

worldengine ancient_map -w an_example.world

A 2048x2048 ancient map could look like this:

Algorithm

The world generation algorithm goes through different phases:

  • Plates simulation: it is the best way to get proper mountain chains. For this plate-tectonics is used
  • Noise techniques are used at different steps, using OpenSimplex noise
  • Precipitations are calculated considering latitude and rain shadow effects
  • Erosion is calculated
  • Humidity in each zone is calculated
  • Terrain permeability is calculated
  • Biomes are calculated using the Holdridge life zones model

Contributors

This project is maintained by Dan Paulat

All contributions, questions, ideas are more than welcome!

We would like to thank you great people who helped us while working on WorldEngine and the projects from which it was derived:

  • Bret Curtis and Federico Tomassetti, contributing the original WorldEngine project, and its many 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!

  • Ryan contributed the Windows binary version and discussed Lands on Reddit bringing a lot of users. Thanks a million!

  • stefan-feltmann made Lands depends on pillow instead that on PIL (which is deprecated). This could also help when moving to Python 3. Thanks a million!

  • Russell Brinkmann helped saving the generation parameters in the generated world (so that we can use it to generate the same world again, for example), improved the command line options and added tracing information (useful for understanding the performance of the various generation steps)

  • Joshua Coppola implemented the satellite view. Thanks a lot, it looks gorgeous!

  • Stephan made WorldEngine make heavy use of numpy, helping to speed up the generation. He also made world-generation much more reproducible and helped improve compatibility with Python 3.

  • Alex made things generally run faster and look cleaner by better employing numpy.

History

WorldEngine has been created by merging Lands and WorldSynth. Last Lands version was 0.5.3, last WorldSynth version: 0.12, first WorldEngine version has been 0.18. WorldEngine C++ 0.19.0 was created based on WorldEngine 0.19.0.

License

WorldEngine C++ is available under the MIT License. You should find the LICENSE in the root of the project.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages