
In this video (objectives)…
Barbara welcomes you to the course and gives you an overview of what you’ll be learning.
In this video (objectives)…
Create a new Unity project and make the necessary imports.
In this video (objectives)…
Learn how procedural definition is defined and used in a variety of games. Analyze advantages and disadvantages for using procedural generation in your game.
In this video (objectives)…
We introduce the ways that you can get help, support and contribute to the community.
In this video (objectives)…
Any time we change our project during a lecture we will commit that change to a public source control repository for students to access. In this video, we show you how to access that content.
In this video (objectives)…
Overview over the layout generation results and what you will learn in this section. From Unity Editor Tools like ContextMenus to advanced C# syntax features like lambda expressions, expression-bodied members and Object Initializers.
In this video (objectives)…
Load an example layout from a texture file and apply the necessary parameters to render it as a pixel graphic on a quad, ensuring the texture maintains its clarity and pixelated appearance. Use ‘System.Random’ to randomly generate dimensions for a rectangle representing the first room in a game level within the center area of the level.
In this video (objectives)…
Apply the first room’s rectangle parameter to draw a layout on a Texture2D object.
In this video (objectives)…
Define data structures for Hallways, Rooms and the Level in order to retain semantic information.
In this video (objectives)…
Learn about the utility of stubs as placeholders before implementing the complete functionality to calculate all potential exits from a room. Additionally, delve into lambda expressions to write more concise code, enhancing readability and reducing verbosity in their implementations.
In this video (objectives)…
Find all positions at the borders of a room with sufficient distance from its corners to use as potential exits.
In this video (objectives)…
Employ enums to define the hallway directions. Find the opposite direction using enum extensions.
In this video (objectives)…
Learn how to write properties and methods in C# more concisely using expression-bodied members. See how this syntax simplifies code and enhances readability.
In this video (objectives)…
Filter a list of possible exits from a room using Linq. Also learn how to write if-statements in a shortened way using the ternary operator.
In this video (objectives)…
Place a second room with fixed size in the level by calculating its position based on the position of the first room and the exit positions.
In this video (objectives)…
Extract creation of rooms into its own method. Learn about object initializers to create objects in a concise manner. Lastly, add more variety by picking a random room size.
In this video (objectives)…
Call the room creation code multiple times to add a specified amount of rooms to your level as long as it is possible. Then add those rooms to the level.
In this video (objectives)…
Make sure rooms don’t overlap, by validating their position with regards to the positions of all other rooms.
In this video (objectives)…
Learn why every random number generator has a random seed and how you can use it to make your life easier and your game better.
In this video (objectives)…
Move the configuration of your level where you define size, scale and number of rooms into a scriptable object, so that you can design and keep multiple different configurations at the same time.
In this video (objectives)…
Create more variety for your levels by defining different room sizes, so that you can have everything in your game from tiny storerooms to large ballrooms.
In this video (objectives)…
So far only the total amount of rooms has been limited. In this lecture set a limit for each particular room size to have more control over the generated level.
In this video (objectives)…
Add textures to room templates with special shapes that you can define in a texture file. This allows you to add more variety.
In this video (objectives)…
Use the textures for special rooms to draw them into the layout map for the dungeon. As a result the shape of dungeons become more interesting and varied.
In this video (objectives)…
For special rooms our current approach to picking exits leads to confusing results. Instead you learn how to pick exits specific to each special room from its texture.
In this video (objectives)…
Exits for special rooms are marked on their texture using four colors, one for each direction. Map those colors to their direction and use that information to connect rooms nicely.
In this video (objectives)…
See a preview of what the dungeon will look like at the end of the section. Learn why marching squares is a great option to create a 3D level from a 2D map.
In this video (objectives)…
Specify an interface to represent level data. That way you can load the level layout either from a texture or from the procedural generator.
In this video (objectives)…
Learn how marching square translates a 2D representation of a level into several 3D tiles. Implement the algorithm that maps from the layout to the tile index from marching squares.
In this video (objectives)…
Learn how marching square translates a 2D representation of a level into several 3D tiles. Implement the algorithm that maps from the layout to the tile index from marching squares.
In this video (objectives)…
Take the tile indexes from the previous lecture and match them to a Unity Prefab using Scriptable Objects.
In this video (objectives)…
Use the Tileset you defined using Scriptable Objects to create a 3D representation of the level using the provided 3D tiles.
In this video (objectives)…
Create a Singleton so that you are more easily able to share data between different components of your procedural generation algorithm.
In this video (objectives)…
Make generated levels more interesting to look at, by having several small variants of your basic level tiles.
In this video (objectives)…
Add the geometry generation step to the LevelBuilder component, so that you can create a new Layout with one single action in the context menu in Unity.
In this video (objectives)…
Learn how to set up a NavMesh and an agent that can move on top of it. Implement code that updates the NavMesh every time the level geometry changes.
In this video (objectives)…
Place the player in the middle of a room and create a simple camera that focuses on the player avatar.
In this video (objectives)…
Use Raycasting to find out where players clicked and write a script that moves the player avatar to that new position.
In this video (objectives)…
Learn how use the Animator and how to set the velocity of the player avatar, so that it animates correctly.
In this video (objectives)…
Overview over the layout generation results and what you will learn in this section. From Unity Editor Tools like ContextMenus to advanced C# syntax features like lambda expressions, expression-bodied members and Object Initializers.
In this video (objectives)…
Set up a Mono Behavior that will trigger the room decoration process. Integrate this room decorator with the layout and geometry generation steps.
In this video (objectives)…
Transform the level layout into an array, so that you can use it as a representation of the level including decorations.
In this video (objectives)…
Create a BaseDecoratorRule class, which provides the template for all rules that we can use in our rule system. In RoomDecorator call the base methods to ensure that a rule is picked and applied to decorate a room.
In this video (objectives)…
Learn how to detect patterns in the level that can then be used to detect where to apply rules. Those rules can then be used to place items and decorations in the level.
In this video (objectives)…
Practice creating several more rules that can be used to decorate rooms in your dungeon.
In this video (objectives)…
Apply the rules to the level by changing its decorated texture. That way rules will be able to change the level. All rules applied later, will then work on the changed level. This means that while the room starts out with only walls, you can later have rules that require items to be next to them, creating a cascade of rules that build on top of each other.
In this video (objectives)…
Align the level decorated texture with the level, to make it easier to design decoration prefabs. Create your first decoration prefabs and then instantiate them to add them to the level.
In this video (objectives)…
Align the level decorated texture with the level, to make it easier to design decoration prefabs. Create your first decoration prefabs and then instantiate them to add them to the level.
In this video (objectives)…
Expand the rule system, so that you can specify for every rule if it should be centered in the room horizontally or vertically.
In this video (objectives)…
Only one item per room makes it look empty. Instead now create a method that tries to add several decorations to a room up to a defined maximum.
In this video (objectives)…
Set up limits on how often each rule can be used, to provide more control over the procedural generation. For example limit the number of treasures to one per room
In this video (objectives)…
Allow to specify a rotation for the prefab on each rule. That way you can reuse the same prefab for different rules and configurations.
In this video (objectives)…
Force the procedural decorator to only apply rules in combination. For example if you place a pillar in one corner of the room ensure there is the same pillar in all other corners.
In this video (objectives)…
With the Or-Decorator rule you can ensure that the rules in combination can only be applied a maximum number of times. For example have either treasure on the wall or in the center of the room but never both in the same room at the same time.
In this video (objectives)…
Utilize the Noop TileType in the pattern detection as Joker and in the pattern application to not change the level decoration texture in a certain position.
In this video (objectives)…
Add variety to room decorations by adding a component to prefabs that randomly enable and disable children. As a result every instance of the same prefab will look slightly different.
In this video (objectives)…
Create a component that triggers the variation generation on all PropSelectionXor components on the same GameObject. This makes it more convenient to use both manually and from code.
In this video (objectives)…
Toggle more variation where you can decide for all attached GameObjects to be active with a defined probability.
In this video (objectives)…
Learn how EnumFlags allow you to label rooms in a way where you can select one or multiple types and save them all in one simple variable.
In this video (objectives)…
Keep track to how many other rooms each room is connected. This can be used to define what role a specific room should have in the dungeon.
Based on decorations assign the different room types. Dependent on the type filter which rules are used and then apply the decorations that fit the room type.
Get more practice on using System.Linq by assigning the remaining room types.
Congratulations to finishing the course. In the lecture we also show some ideas how you can extend the system you built during 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!