Procedural Cave Generation
In this project, I created a procedural cave generation system in Unity using C#. The environment is generated entirely at runtime through a combination of random noise generation, cellular automata smoothing, and a flood-fill cleanup algorithm to ensure the cave is traversable.
The core of the system builds a 2D map representing walls and floors, which is then converted into a 3D mesh using a Marching Squares–inspired triangulation algorithm. I implemented custom logic to dynamically construct both the floor geometry and vertical wall meshes around open areas for a seamless cave structure.
Additionally, I added procedural object placement, such as treasure chests, that appear based on local geometry and random chance, enhancing exploration and replayability. Each cave layout is seed-based, meaning users can reproduce or randomize environments by adjusting parameters like map size, density, and smoothing iterations.
This project strengthened my understanding of procedural content generation, mesh construction, and algorithmic geometry processing in Unity, while also improving my ability to write clean, modular systems that bridge logic and visual design.