Unity Procedural Generation: Build Infinite Game Levels

Unity Procedural Generation: Build Infinite Game Levels

English | MP4 | AVC 1280×720 | AAC 44KHz 2ch | 61 lectures (10h 23m) | 6.28 GB

Code 3D dungeons, generate layouts, create a NavMesh, and fill them with enemies, loot, and decor—while levelling up C#!

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!

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.
Table of Contents

Introduction & Setup
1 Welcome to The Course
2 Setting Up The Project
3 Intro To Proc Gen
4 Community & Support
5 Accessing Our Projects

Room Layout Generator
6 Section Intro – Room Layout Gen
7 Generate The First Room
8 Draw Level on Texture2D
9 Define Data Structures
10 Stubs & Lambda Expressions
11 Find All Exits
12 Enums and Enum Extensions
13 Expression​-​bodied Members
14 Pick Exit Using Linq
15 Calculate Second Room Position
16 Object Initializers
17 Generate Multiple Rooms
18 Validate Room Positions
19 Work With Random Seeds
20 Configure With Scriptable Objects
21 Generate Different Room Sizes
22 Limit Room Occurrences
23 Add Special Rooms Textures
24 Display Special Rooms
25 Stub Method For Exit Detection
26 Detect Exits On Texture

Generate Level Geometry
27 Section Intro – Geometry Gen
28 The ILevel Interface
29 Implement Texture Based Level
30 Calculate Tile Index
31 Create Tileset
32 Create Level Geometry
33 Implement a Singleton
34 Share Data Using Singleton
35 Add Variations With TileVariants
36 Combine Generation​​ LevelBuilder
37 Set Up NavMesh
38 Set Player Start Position
39 Point​-​And​-​Click To Move Player
40 Animate Player

Decorate Rooms
41 Section Intro ​-​ Decorate Rooms
42 Set Up Room Decorator
43 Create Decoration Texture
44 Create Pattern Rules in Unity
45 Set Up Rule System
46 Detect Patterns
47 Apply Rules to Texture
48 Apply Rules to Level Geometry
49 Align Texture with Level
50 Center Pattern in Room
51 Apply Multiple Rules In A Room
52 Copy Arrays And Limit Rule Use
53 Rotate Rules
54 And Decorator Rule
55 Or Decorator Rule
56 The Noop TileType
57 Create Prop Variations 1
58 Create Prop Variations 2
59 Create Prop Variations 3
60 Working With EnumFlags
61 Get Room Connectedness

Homepage