A console-based multiplayer turn-based roguelike game with procedurally generated mazes using recursive DFS algorithm. Built with C# and Spectre.Console.
Note
For a complete project report, see the Information.pdf file in the repository.
- Procedurally generated maps - Unique maze for every game session
- Multiple map sizes - Choose from small, medium, or large arenas
- Various trap types - Hidden hazards throughout the dungeon
- Character customization - Multiple classes with unique abilities
- Simple gameplay - Easy to learn, strategic depth
- .NET 8.x SDK installed
- Modern terminal/console (PowerShell 7.0+ recommended for best compatibility)
# Clone the repository
git clone https://github.com/Abner-Abreu/Random-Dungeon.git
cd Random-Dungeon
# Restore dependencies
dotnet restore
# Run the game
dotnet runImportant
The project uses Spectre.Console for rich console rendering.
Some older terminals may have compatibility issues. Use an updated terminal for the best experience.
- Select number of players (2 or 4)
- Choose map size:
- Small (15x15): Quick matches [recommended for 2 players]
- Medium (25x25): Balanced experience, ideal for any match
- Large (35x35): Extended gameplay [recommended for 4 players]
Each player creates their character:
- Name: 3-10 characters, no duplicates allowed
- Class: Choose one class, each with a unique ability
- Turn start: Regenerate 3 energy and 1 mana
- Active player is highlighted in green on the map
- Available actions:
- Move: Travel across the map (costs energy)
- Status: Check character stats and information
- Use Ability: Activate class ability (costs mana)
- End Turn: Pass to the next player
The first player to reach the central room wins the game!
Note
The map is filled with invisible traps... until you step on them ;)
Each class has a unique ability that costs 3 mana to activate:
| Class | Ability | Description |
|---|---|---|
| Warrior | Destroyer of Walls | Randomly destroys an adjacent wall, creating a new path |
| Mage | Exchange | Swaps positions with a random player |
| Explorer | Instinct | Reveals traps in adjacent cells (marked in red) |
| Summoner | Summon Goblin | Removes traps from adjacent cells without revealing them |
| Traveler | Refreshing Breeze | Grants 2 extra energy for additional movement |
The maze is procedurally generated to maximize randomness and variety:
- Initialize an NxN square matrix filled with walls
- Start from a random position and "carve" paths using Recursive DFS algorithm
- At each iteration, randomly decide (10% probability) to create a cycle/loop
- Place traps on walkable cells with probability based on distance from center:
- Outer ring: 10% probability
- Middle ring: 15% probability
- Inner ring: 25% probability
- Place a 3x3 central room at the maze center
- Spawn players at the corners based on player count
Traps are invisible until triggered. Five different types:
- Energy Drain Trap: Reduces energy by 3 points (affects movement capacity)
- Anti-Mana Trap: Reduces mana by 3 points (prevents ability usage)
- Past Change Trap: Randomly changes player's class and ability
- Trap Respawn: Regenerates all traps on the map in new locations
- Teleportation Trap: Moves player to a different location (maintains similar distance from center)
- Move in four directions: up, down, left, right
- Navigate using arrow keys
- Validates movement (within bounds and to walkable cells)
- Automatically triggers traps at destination
- Costs 1 energy per move
- Checked after every player movement
- Compares player position with central room boundaries
- Game ends when condition is met, displaying final statistics
- Language: C# (.NET 8.0)
- Console Framework: Spectre.Console
- Algorithm: Recursive Depth-First Search (DFS) for maze generation
- Architecture: Object-oriented design with class-based character system
Random-Dungeon/
├── Program.cs # Main game loop
├── classes/ # Character classes and game logic
├── fonts/ # Console font assets
├── Maze.csproj # Project configuration
├── Maze.sln # Visual Studio solution
├── Information.pdf # Detailed project documentation
├── LICENSE # MIT License
└── README.md # This file
This project is licensed under the MIT License - see the LICENSE file for details.
Enjoy the game! 🎮✨