Generating Exhumed River Channel

Generating Exhumed River Channel

I recently did some work in generating rivers in a 2d game. Revisiting this work to create an exhumed river channel, I decided it might be fun to revisit how to generate it to make the channel look more realistic. Instead of using a drunken walker, this is a more expensive but interesting map generator:

  • Start by generating 2d simplex noise where
    • less <0.6 is floor
    • rest is walls
  • Generate terminal lines at each map exit (north, south, east, west). Shuffle those lines and randomly choose a start and end location for the river based on two of

Read More

Generating Cliffs for 2d Game

Generating Cliffs for 2d Game

Source code available on github here.

A recurring problem in 2d games is how to represent depth. In isometric games this is easily solved but in discretely top-down games it's harder to solve. After doing a lot of research I fell onto a simple idea: do the best you can insinuating the depth and leave the rest to the imagination. Here's the algorithm I used to create 2d top-down cliffs:

  • Create a small map of perlin noise and a wide map of perlin noise. Add the two together and give the large map a weight of 3 with the small

Read More

Pigeon Hole Stepping v2

Pigeon Hole Stepping v2

I had originally written an article on how to implement PHS here. Having found the maps generated slightly redundant I decided to take another look. Here are the steps taken to successfully generate a more realistic "town." It's essentially a drunken walker like Diffusion Limited Aggregation mixed with a hallway constraint that mimics the large part of PHS.

  1. Start somewhere in the middle, add this and all possible directions up to a certain dynamic length (I used a standard deviation of 1.4 with a mean of 5, ) as nodes: [{x,y,direction},...].
  2. We will be looping until all nodes

Read More

Generating Ancient Ruins

Generating Ancient Ruins

While creating algorithms for random continent generation, I came across an old algorithm I had worked with called Coupled Map Lattice. Using that to create a continent was hard but I was able to accomplish it doing layers of filters:

  • generate map with noise between -1 and 1
  • apply CML using Spatiotemporal Intermittency settings
    • (a = 1.75, ε = 0.6)
    • I found that using something too chaotic didn't have a noticeable affect compared to just generating noise in general.
  • normalize values to between 0 and 255
  • apply a gaussian blur
  • normalize values to between 0 and 1
  • apply slight height

Read More

Pigeon Hole Stepping

Pigeon Hole Stepping

For 7DRL this year I developed a new map generation algorithm called Pigeon Hole Stepping.

Fill the map with walls

This map generation algorithm relies on negative building techniques. This concept will make more sense as the later steps are explained.

Dig Hallways

Essentially, we can assume that hallways that are parallel to each other are at least the length of a single room and up to two rooms apart in distance. Because of this assumption, we can make a random walker that will move around with this restriction in mind until map is filled completely.

Allocate Rooms

Assuming the

Read More