Skip to content

About

Console multiplayer turn-based videogame with random generated maps developed using C# and Spectre.Console.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

37 Commits

Folders and files

Repository files navigation

Random Dungeon

.NET License Spectre.Console

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.


🎮 Key Features

  • 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

🚀 Quick Start

Prerequisites

  • .NET 8.x SDK installed
  • Modern terminal/console (PowerShell 7.0+ recommended for best compatibility)

Installation & Running

# Clone the repository
git clone https://github.com/Abner-Abreu/Random-Dungeon.git
cd Random-Dungeon

# Restore dependencies
dotnet restore

# Run the game
dotnet run

Important

The project uses Spectre.Console for rich console rendering.
Some older terminals may have compatibility issues. Use an updated terminal for the best experience.


📖 How to Play

1. Game Setup

  • 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]

2. Character Creation

Each player creates their character:

  • Name: 3-10 characters, no duplicates allowed
  • Class: Choose one class, each with a unique ability

3. Gameplay

  • 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

4. Victory Condition

The first player to reach the central room wins the game!

Note

The map is filled with invisible traps... until you step on them ;)


🎯 Character Classes & Abilities

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

🗺️ Implementation Details

Map Generation

The maze is procedurally generated to maximize randomness and variety:

  1. Initialize an NxN square matrix filled with walls
  2. Start from a random position and "carve" paths using Recursive DFS algorithm
  3. At each iteration, randomly decide (10% probability) to create a cycle/loop
  4. Place traps on walkable cells with probability based on distance from center:
    • Outer ring: 10% probability
    • Middle ring: 15% probability
    • Inner ring: 25% probability
  5. Place a 3x3 central room at the maze center
  6. Spawn players at the corners based on player count

Trap Types

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)

Movement System

  • 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

Victory System

  • Checked after every player movement
  • Compares player position with central room boundaries
  • Game ends when condition is met, displaying final statistics

🛠️ Technical Stack

  • 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

📁 Project Structure

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

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.


Enjoy the game! 🎮✨

About

Console multiplayer turn-based videogame with random generated maps developed using C# and Spectre.Console.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages