Unity Procedural Generation: Build Infinite Game Levels
Learn to code dynamic 3D dungeon levels with procedural generation, create custom layouts, generate a NavMesh and fill your world with enemies, loot, and decor—all while levelling up your C# skills!
//

Stop designing every room by hand.
Hand-crafting levels is fine for a linear game. But if you want replayability, variety, and a world that feels different every time a player drops in, doing it by hand doesn't scale. Procedural generation is the answer, and this course shows you exactly how to build it.

Generate dungeon layouts with rooms, hallways and custom shapes.
You'll start by building a 2D dungeon layout stored as a data structure and texture file, then use ScriptableObjects to customise it without touching the algorithm. Rectangular rooms, irregular shapes, branching hallways: the same system produces wildly different results every run.

Turn a 2D layout into a full 3D level with Marching Squares.
This is where the generation becomes something you can actually play. The Marching Squares algorithm converts your 2D layout into a 3D environment using just 16 tiles, which means you need far fewer assets than you'd expect to get a level that looks and feels complete.

Fill your dungeons with loot, enemies and variety that holds up.
An empty dungeon isn't a game. You'll build a rule-based system that populates every level with treasure chests, enemies, and decorative items, with enough variation baked in that no two runs feel like the same room reshuffled. NavMesh generation at runtime means your NPCs can navigate every new layout without you lifting a finger.

Write advanced C# that makes your procedural systems sing.
Lambda expressions, expression-bodied members, System.Linq: the techniques in this course are the ones that separate intermediate C# from genuinely fluent code. You'll use them in context, building real systems, so by the end they're tools you reach for naturally rather than concepts you vaguely remember reading about.
What you’ll learn
Create infinite game levels that feel fresh every playthrough.
Generate procedural dungeon layouts with rooms and hallways.
Turn 2D layouts into dynamic 3D levels with Marching Squares.
Implement a runtime NavMesh so players and NPCs can navigate.
Use Scriptable Objects to customise layouts without extra code.
Populate dungeons with treasure, enemies, and decorations.
Apply rule-based systems to avoid repetitive level design.
Master advanced C# techniques to optimise procedural systems.
30 Day Money-Back Guarantee
100% refund, no questions asked.Lifetime Access
Access your content on any device, at any time.Teaching Support
Never get stuck with our teaching assistants on call.About the course
Want to make game levels using procedural generation? It's one of the most powerful ways to create infinite, dynamic game worlds without designing every single detail by hand.
Learn how to code your own algorithms and build replayable levels that feel fresh every time! No more designing every corner—let the code do the heavy lifting!
You'll start by generating a dungeon layout with rooms and hallways. Using Scriptable Objects, you’ll customise layouts effortlessly, making sure no two levels feel the same. Say goodbye to repetitive level design—your game world will evolve with every play-through.
Next, you’ll turn your 2D layouts into a fully realised 3D game level. We’ll harness the power of the Marching Squares algorithm to create detailed levels with only 16 tiles. If you’re a solo dev or working with a small team, this trick will save you heaps of time and effort.
Navigation is key, so we’ll dynamically generate a NavMesh at runtime.This means your player can seamlessly explore every new dungeon layout without breaking immersion. Whether you're building an RPG or a roguelike, this skill will come in handy!
But what's a dungeon without loot and baddies? Using a rule-based system, you’ll populate your levels with treasure, enemies, and decorations. You’ll also learn techniques to prevent everything from looking too repetitive—because variety keeps players engaged.
Along the way, we’ll level up your C# skills with advanced concepts like lambda expressions, expression-bodied members, and System.Linq. If you've got the basics of C# down and want to push your coding skills further, you’re in for a treat.
This course is perfect for anyone who knows their way around Unity’s UI, GameObjects, and Prefabs. If you can handle loops, classes, and variables in C#, you're ready to level up your skills with procedural generation.
By the end of this course, you’ll have a robust system for procedural level design, plus a sharper understanding of advanced C# concepts. Ready to apply these techniques to your own projects and build infinite game worlds? Let’s dive in and start coding!

Curriculum
Instructors

Barbara Reichart
Hi, I'm Barbara! My passion for computer games started when I first played Commander Keen during a computer class. That experience sparked my curiosity, and soon after, I taught myself to code. A kids' novel I read had some snippets of code that supposedly made stars fly - though it turned out to be just text, which was a bit disappointing! Still, it inspired me to start experimenting, first with simple learning games and later with board game design.
My love for programming led me to study Computer Science at TUM and Georgia Tech. Even after graduating, I couldn’t get enough, so I pursued a PhD at TUM, where I taught iOS app and game development while researching learning games.
Beyond coding, I’ve always enjoyed teaching. I wrote tutorials for RayWenderlich and later developed scripts for a distance-learning university. Now, I work at a small indie studio, continuing to combine my love for games and development.
In my free time, I enjoy prototyping new ideas, participating in game jams, bouldering, and spending time outdoors with my dog. I'm also a huge fan of GameDev.tv courses—so when I saw they were looking for instructors, I knew I had to give it a shot!



