Skip to content

Latest commit

 

History

History
118 lines (85 loc) · 4.14 KB

README.md

File metadata and controls

118 lines (85 loc) · 4.14 KB

Weltschmerz

Example of earth generated in World map generator by Weltschmerz

Table of Contents

About the project

Weltschmerz is a library for simulating terrain, moisture, temperature, wind, and precipitation based on real environmental principles. The values Weltschmerz outputs can be used, for example, for generating realistic looking maps or terrain. Weltschmerz is primarily aimed at games and does not produce scientifically accurate data.

Weltschmerz is used in Foreman to generate 3D voxel terrain and in World map generator to generate realistic looking maps.

Examples

Foreman takes elevation from Weltschmerz and generates 3D voxel world based on this elevation.

Foreman example: https://www.youtube.com/watch?v=lAZFasyDf7Y

  • World map generator generates biomes from environmental variables.

World map generator example

Getting Started

These instructions will get you a copy of the library for development. See build for notes on how to build the dll library for your project.

Prerequisites

Make sure you have installed all of the following prerequisites on your development machine:

  • .NET environment

  • Git - OSX and Linux machines typically have this already installed.

  • Config file in your project folder

Installation

A step by step series how to install library into your project

  1. Select or make your .NET project

  2. Include C# Hocon library in your .csproj file. (File is located in your .NET project)

  <ItemGroup>
    <PackageReference Include="Hocon.Configuration">
      <Version>2.0.3</Version>
    </PackageReference>
  </ItemGroup>

Now you have 2 options how to include Weltschmerz in your project.

Git submodule

  1. Go to your project folder
  2. Initialize git in your repository
git init
  1. Add Weltschmerz as git submodule
git submodule add [email protected]:starandserpent/Weltschmerz.git --recusive
  1. Include all .cs files from Weltschmerz in your project

DLL Library

  1. Open Weltschmerz in your IDE
  2. Build solution
  3. Open your project
  4. Add Weltschmerz library as reference into your project

Usage

You can access all environmental variables from Weltschmerz class

    Weltschmerz weltschmerz = new Weltschmerz();
    double elevation = weltschmerz.GetElevation(0, 0);

If you want to replace any generator in weltschmerz by your own, use abstract class

    weltschmerz.ElevationGenerator = new Elevation();

Default config file is named "config.conf", use ConfigManager to load your custom config files.

    string path = "yourpath/to/file"
    Config config = ConfigManager.GetConfig(path);

For further implementation as library in 3D game see Foreman or for map generation see World-map-generator

Documentation

You can find documetation on github wiki

Licence

This project is licensed under the MIT License - see the LICENSE file for details

Contact us

Follow us

This library is also used in Rituals of the old.