World generation


Hello, I'm Pawlost!

I'm a new programmer in the Star and Serpent dev team, and I'll tell you a little bit about my work.

I've been working on Weltschmerz, our world generator, which generates terrain types and elevation. The word Weltschmerz is German and literally means "world pain" (the sort of feeling someone experiences who doesn't believe that the physical reality can satisfy the demands of the mind).

First milestone was creating a heightmap using the excellent modular Joise noise library written in Java. Joise supports all kinds of noise algorithms ranging from 2D, 3D, and 4D to 6D noise and is derived from Joshua Tippetts' C++ Accidental Noise Library.

The first map looked similar to this image:

After that was done I used Fortune's algorithm to generate Polygons.

I changed the border vectors of the polygons so I could create Java Swing polygons with color. At first the only distinction between terrain types was land and water:

Then I added a shoreline, oceans, and random mountain blobs:

Then I created a tectonic plate simulation for generating proper mountains at the colliding edges of the tectonic plates:

And made the map seamless by sampling two 2D circles orthogonally in 4D for the XY and ZW planes. We sample in a circle to ensure the data is periodic.

We needed support for HOCON for easy configurability and generation options, so I implemented that quickly:

The config allows us to experiment easily with more detailed and varied maps.

Unfortunately, because the polygons were too random we decided to change the map generation, and I had to refactor some ~30% of my code. We are now using rectangles instead of polygons:

The above image shows the current state of my ongoing work.

I am also debbuging Terra. There are a lot of difficult bugs to squash, but it is also very rewarding when you get things fixed and see the results.

So far the best terrain I've actually generated by using Terra is a huge "Minecraft" block for debugging :D Now that the worst Terra bugs have been fixed in our generation branch I still have to implement a converter for the world generator 3D data to 1D Terra array data to actually experience the terrain in the engine.

See you later. Cheers!

- Pawlost

This article was updated on 09/04/19 @ 10:55