so summer is creeping ever closer, and when I gets here the plan is to have time to pick up working on the Dominions Roguelike once again.
The goal set for myself to accomplish over the semester was get some sort of map generation. Tiles are the typical roguelike representation of a game world and there's lots of resources on how to implement them. I really wanted to not do tiles (since I've avoided them completely in everything else so far) but with little to no knowledge in map generation (or high level math in general) I was feeling hopelessly overwhelmed.
Fortunately, lch pointed me to some styles of terrain generation that are not archaic roguelike tiling algorithms. I found some existing implementations I could start with. Along the way I learned how PixelArrays work, so I could automatically generate a surface without needing to glue together a bunch of tiles.
I found a Python implementation of an algorithm called Perlin noise. I played with it, tweaked the interface and output, and eventually got it working the way I needed it to. Right now I've got it making greyscale texture surfaces. The plan is to make some color gradient functions that map the greyscale to discrete color values (for example: at some threshold, darker colors will become water, which then can become deeper water).
So that's it right now. In a couple of weeks I hope to post some screenshots of textures mapped to color values, forming landscapes with oceans, lowlands, and mountains. The exciting thing is that I can make a landscape representing terrain height, and then generate another layer of perlin noise to lay over this for placing forests, swamps, and other features.
So here's a pic I generated using my current implementation. It is nine octaves of noise linearly blended with a period of 256, an amplitude of 1, and a persistence of 0.5. This is a pretty typical noise pattern. The algorithm has different parameters that may be modified to influence how the noise looks. This pic has a lot of even clumpiness, but different parameters can make pictures with just a few big clumps, pics with even more granularity, or even pics with a tile pattern
Imagine now the darker portions mapped to water, and the whitest portions as mountain peaks. The greyscale makes it hard to see the difference inbetween, but with a nice lowland green to brownish grey highland gradient the real texture of the noise will become apparent.