
Get an overview of what you’ll learn in this course. We’ll cover player movement, procedural dungeon generation using the Random Walker Method, rounded edge tile placement, and enemy AI with patrol and pathfinding logic. By the end, you’ll have a functional random dungeon generator for your own roguelike games.
Learn which Unity version and image editing software are used throughout this course. While you're free to use any version or tool, this lecture provides recommendations to help you follow along smoothly.
Create a 2D Unity Project that will serve as the foundation for this course. We’ll configure the necessary project settings to ensure a smooth workflow for procedural generation.
Learn about the classic 32x32 pixel roguelike graphics by David Gervais, which are available for use under a Creative Commons License. We’ll go over how to access these assets by downloading Angband and discuss how you can use any tileset of your choice in this course.
Learn how to flip the player sprite when changing directions based on keyboard or game controller input, ensuring proper character movement.
Implement basic player movement mechanics using directional input from the keyboard or game controller, allowing the player to navigate freely around the scene.
Create Floor & Wall prefabs to manually build playable areas for the player. These same prefabs will later be used in the random dungeon generator, forming the foundation of your procedural levels.
Build a Tile Spawner prefab that automates dungeon construction. Instead of manually placing walls, this spawner will generate walls around floor areas dynamically, saving time and improving efficiency.
Use a random walker algorithm to generate a dungeon layout. This method moves a virtual walker through the map space, placing floor tiles randomly until the desired dungeon size is reached.
Learn how to strategically place an exit doorway in the dungeon. We’ll cover best practices to ensure the exit is positioned effectively within the generated layout.
Spawn random items throughout the dungeon while ensuring they appear in logical locations—next to walls rather than inside narrow corridors, creating a more natural placement.
Place random enemies in the dungeon while avoiding walls and tight corridors. This method ensures enemies spawn in open spaces, allowing for better movement and player interaction.
Learn how to prepare existing pixel art graphics for rounded edge tiles. Set up a template that will be used to create new tile sets later in the course.
Understand the basics of binary counting and how binary values can be used to efficiently organize and store tile variations for procedural generation.
Use the template from the previous lecture to construct a binary-based tile set, ensuring that all tile variations are properly designed for rounded edges.
Transfer the completed tile set into a grid-based texture atlas, arranging 4x4 grid arrays in the correct order for binary-based tile placement.
Write a C# script to automatically apply rounded edge tiles to surround all walls within the randomly generated dungeon, creating a more natural, organic look.
Break down your scripts into smaller, modular functions to improve code reusability. Learn how to structure your code efficiently so it can be adapted for multiple procedural generation tasks.
Use the Random Walker method from earlier in the course to generate a series of random hallways, forming the foundation for a more structured dungeon layout.
Expand upon your hallway system by adding rooms of various shapes and sizes. Learn how to integrate rooms seamlessly with the existing random hallways to create a more diverse dungeon structure.
Enhance the natural look of your dungeon by adding corners and turns to hallways. This simple modification helps create more interesting and immersive dungeon layouts.
Create a C# script that allows enemies to patrol the dungeon in random directions. This forms the foundation for enemy movement and AI behavior.
Structure your movement script to handle multiple movement behaviors, including patrolling, chasing, and attacking the player based on game conditions.
Implement a basic pathfinding system that enables enemies to navigate around obstacles while pursuing the player.
Learn how to position an exit doorway in a location that is surrounded by three adjacent walls, ensuring a structured and accessible level design.
Develop a Fog of War system that hides unexplored regions of the dungeon. The system will also manage Field of View (FOV), displaying the area around the player with varying levels of opacity to indicate explored and unexplored spaces.
Enhance the Fog of War system by adding a smoother, curved trim effect, creating a more natural and visually appealing transition between fully opaque fog and semi-transparent explored areas.
Bonus Lecture
Learn how to generate dynamic, grid-based dungeons for roguelike games using C# in Unity!
This course is designed for beginner to intermediate Unity developers who want to explore the fundamentals of procedural dungeon generation. You’ll learn how to create a 2D random dungeon generator using simple yet effective algorithms to build grid-based environments for roguelike-style games.
What You'll Learn:
★ Implement a 2D grid-based dungeon generation system using C# in Unity.
★ Use classic pixel art assets to create visually appealing roguelike environments.
★ Apply a rounded edge effect to dungeon walls for a more organic, non-repetitive look.
★ Develop basic enemy pathfinding AI using a flood fill algorithm to track and chase the player.
★ Make enemies patrol, navigate the dungeon, and engage in combat with the player.
★ Expand and customize the dungeon generator by tweaking parameters for different level layouts.
This course does not cover building a complete game but instead focuses on core procedural generation techniques that you can expand upon. By the end of the course, you'll have a working 2D dungeon generator and the knowledge to refine and expand it for your own roguelike projects.
With procedural generation, no two dungeons will ever be the same. This makes your game environments more engaging, dynamic, and replayable. Whether you want to create a traditional roguelike experience or use procedural elements in your game, this course gives you the foundation you need to get started.
★ Enroll now and start building your own 2D procedural dungeon generator in Unity!