Texture-based procedural level generation (UE4)
This is the final project of my degree, and a sum of everything I have learned, and my passions for game design.
ARPGs like Path of Exile have been my go-to genre for a long time. I love the mechanical complexity, interconnected systems, the potential to build your character with almost infinite variety, and perhaps most importantly; the problem-solving aspect to making your character viable.
This project is the start of my own ARPG game, and will be the technical foundation for the pseudo-infinite level generation system. My goal is an infinitely scalable map with no upper limit to player or enemy scaling - the player can keep pushing as far as their skill level allows. It can be considered the follow-up to my game prototype The Construct.
I won’t be publishing all the details here (can’t be giving all my design secrets away) but this should serve as a progress report for anyone that is interested.
Maybe if there is interest, later down the line I’ll make some tutorials for how to do some of the things I’ve been working on.
Procedural Noise-Based Alpha Map Layer Blending
A bit of a mouthful, but this is the basic setup for the game biome structure. The further the player progresses vertically, the more varied the biomes (tile sets) that they can encounter. This encourages “vertical” exploration to more difficult regions to keep encountering new content.
This uses the Widget Blueprint (UI) and Uniform Grid Panel components to produce a square based map which can be added to as required in vertical or horizontal directions as the player explores.
The block colours will later be replaced with a nicer-looking material that better represents the biomes/tile-sets the areas correspond to.
The material takes the texture coordinates and appends a Vector2 value for the tiles coordinates, then uses those coordinates as the inputs for a procedural noise algorithm (Voronoi noise in this example) then applies coordinate-based functions to the resulting noise texture to produce an alpha mask, which are then stacked to form the layered material you see.
Each colour represents a different biome or tile-set, while the small squares you can see represent a checkpoint in the game.
Red and Green biomes are only generated above a certain vertical threshold (y coordinate) and later (rarer) biomes preferentially overwrite previous ones.
Real-Time Geometry Streaming
Level “tiles” are generated in 512x512 sections using the biome information from the texture generated above.
Each tile procedurally populates a set of points, then connects all of them into a Minimum Spanning Tree [MST] (using a modified blueprint implementation of Kruskal’s Algorithm) to make sure all of them are accessible.
Areas for each point are carved into rooms, then corridors are carved between them following the MST.
Because each tile is seeded based on its coordinates, and initial “parent” seed, every tile is reproducible!
The geometry is rendered to a texture (red/green images at the bottom of the window) to allow for easy debugging, and will later be incorporated into a minimap for the player to follow.