Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Unity 2D Random Dungeon Generator for a Roguelike Video Game
Rating: 4.8 out of 5(249 ratings)
1,917 students

Unity 2D Random Dungeon Generator for a Roguelike Video Game

A simple approach to programming a top down 2D random dungeon generator for roguelike video games using C# in Unity
Created byBilly McDaniel
Last updated 3/2025
English

What you'll learn

  • Write procedural dungeon generation algorithms to create randomized roguelike environments in Unity.
  • Use C# to solve common game development challenges, including grid-based level design and AI behavior.
  • Implement a 2D bitwise tilemap system for automatic tile placement and rounded edge generation.
  • Develop a simplified enemy pathfinding system using flood fill logic to navigate around obstacles.
  • Create a dynamic Fog of War system that reveals explored areas and manages player visibility.

Course content

6 sections28 lectures6h 56m total length
  • What's Included in This Course?1:29

    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.

  • Software Used in This Course0:29

    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.

  • Setup Unity 2D Project2:52

    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.

  • Graphic Tilesets12:50

    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.

  • Player Movement (Flip X)20:48

    Learn how to flip the player sprite when changing directions based on keyboard or game controller input, ensuring proper character movement.

  • Player Movement (Move)18:15

    Implement basic player movement mechanics using directional input from the keyboard or game controller, allowing the player to navigate freely around the scene.

Requirements

  • Basic computing experience – Comfort with general software navigation and file management.
  • Experience with Unity – Prior exposure to the Unity game engine is recommended.
  • Basic knowledge of C# programming – Understanding of variables, loops, and functions is required.
  • 2D graphics editing experience is helpful – While not required, familiarity with Photoshop, GIMP, or similar software will be useful.

Description

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!

Who this course is for:

  • Unity developers looking to create randomly generated 2D dungeons.
  • C# programmers who want to explore procedural level design and AI movement systems.
  • Roguelike game enthusiasts eager to learn how procedural dungeons are built in Unity.
  • Indie game developers seeking efficient ways to generate tile-based levels dynamically.