Procedural Generation
Work
As part of the MS program in Game Design and Development at RIT, my team and I have been working on Vessyl, a roguelike beat 'em up in Unreal, as our capstone project.
Our game needs to generate content algorithmically at different levels.
On a macro scale, it needs to create the sequence of encounters players will encounter as they move through their run. These are structured as a tree, with splitting and merging paths to provide players with meaningful choices to make.
In turn, these encounters need to be populated algorithmically to ensure that the play experience conforms to an increasing difficulty curve over time. This means spawning in a reasonable number of enemies, choosing which enemy types to spawn or, for non-combat encounters, populating rewards for the player that feel appropriate and useful.
Currently, the rules used for the creation of our map are in place though the UI for it still requires polish. The logic for allowing the player to traverse between the encounters has also been added to the game.
Working closely with our level designer, I have created Unreal actors that give him freedom to set up combat encounters by placing possible spawn points in the level. These are populated by a subsystem that assigns itself a budget based on the player's progress and performance, to create a self-balancing difficulty curve.
Capstone Project
Procedural Encounters in Unreal
My role in the team has been to design and develop the procedural generation systems that support our core game loop.
The concept
Our prototype map
Current state


Moving towards using the procedural generation of terrain as a useful tool for games, I first started creating simple meshes on Unity and soon moved to creating hex meshes using Red Blob's tutorial on hexagonal grids as the base for how to calculate how to layout the terrain.
Unlike previous efforts, this time I use a function mapped on the x-direction (cos(x) + sin(x)) and another on the z-direction (sin(z)+cos(z)) to calculate the height for every hex in the grid, instead of starting with Conway's Game of Life. These functions can be changed to produce different results.
This was also a great exercise to learn about shaders, which are used to determine how to color the mesh. Beneath a certain threshold, the shader simply outputs blue (as a sort of sea-level cut-off). Above that threshold, the shader adds the values for the normals of the mesh to color the "land" portion of each hex. Since the normal in Y is green, it works out great to make it feel that these are grass topped hexes.

Moving to Unity
Meshes, noise & shaders
My most recent project for terrain generation involves first creating an image using Perlin Noise which I use to create colored terrain. The terrain and original noise map are fed to a shader which computes shadows in real-time.




In 2018, I started a blog called Eduardo Builds where I shared the projects I worked on in my spare time. During the time I maintained that blog I worked on two procedural generation projects.




The idea behind this project was creating mazes that combine rooms and corridors to then populate them with the encounters I'd give my players.
The first step in developing this was first creating perfect mazes, for which I implement a version of Prim's algorithm in Javascript.
After that worked, I used that technique to fill the spaces between randomly created rectangles that served as the rooms for the dungeon and then opened doors between the corridors and the rooms to make the design feel more connected.
I continue to work on this tool, with the idea being to also randomly generate denizens of these dungeons that form factions and have claimed parts of the dungeon for themselves. It can be found here.
Having seen it was possible to create two-dimensional terrain using cellular automata, I tinkered with ways of procedurally generating height values that would allow the creation of 3D masses that felt usable in simulations, mesh generation or creating visualizations for DMs of their worlds. It was also a great excuse to practice the R programming language, which I was using while practicing Machine Learning.
The terrain generation and the height values were created using Javascript on a web browser system I no longer host (though the code can be found here). I then exported the array values to R for the visualization.
This served as the basis for my latest project in procedural terrain generation using Unity, discussed below.




Dungeons & Islands
Previous Work
One project was about creating dungeons procedurally, inspired by my need to create content for the D&D group I used to DM for. The other one was a refinement of the Cellular Automata project from 2015 that sought to generate realistic-feeling three-dimensional terrain.
The dungeons
The process
A possible dungeon
A heat map for height
Same terrain visualized in R
The islands
First steps
One of my earliest projects as I tried to learn how to program was creating a grid of terrain procedurally.




From noise to cell systems
The two images below are my first naïve attempt at terrain generation using Markov chains and then using Conway's Game of Life with an adapted ruleset. These images are both from 2015. Sadly, I lost the code to this specific project when the HDD in my computer failed.