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.
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.
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.
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
A step by step series how to install library into your project
-
Select or make your .NET project
-
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.
- Go to your project folder
- Initialize git in your repository
git init
- Add Weltschmerz as git submodule
git submodule add [email protected]:starandserpent/Weltschmerz.git --recusive
- Include all .cs files from Weltschmerz in your project
- Open Weltschmerz in your IDE
- Build solution
- Open your project
- Add Weltschmerz library as reference into your project
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
You can find documetation on github wiki
This project is licensed under the MIT License - see the LICENSE file for details
- Discord: https://discord.starandserpent.com/
- Website: https://www.ritualsoftheold.com/
- IndieDB: https://www.indiedb.com/games/rituals-of-the-old
- Subscribe: https://www.youtube.com/c/Ritualsoftheold
This library is also used in Rituals of the old.