[Archives] Learning Random Generation

Archives, Game Development

Learning Random Generation Part 2

With the paths done, there’s still a lot of empty space.  To fill that up, I wanted to add some different levels of elevation.  I used the same method as when I was creating the paths, but this time I spawned a random number of hill generators and then moved them around until they were no longer overlapping any of the walls. Ghosts could travel off paths in certain situations, so I needed the hills to be far enough away from a path that the ghosts wouldn’t inadvertently walk onto a hill, because that would just look silly.

After I spawn some hill generators, they move around a bit to create hills of random sizes and shapes, and then use the same code that I used when making paths appear to have corners and such to create the appearances of the hills.


Lastly I created some tombstones scattered around the cemetery.  I did this by simply randomly positioning the tombstones so that they would not overlap either the path or the hills.