Dungeon Generation - Grim-/MagicAndMyths GitHub Wiki
Dungeon Generation System
Overview
The mod features a dynamic dungeon generation system that creates unique exploratory experiences for your colonists. These dungeons function like instanced zones in MMOs - they exist only while being explored and offer valuable rewards for those brave enough to overcome their challenges.
Generation Technique
Dungeons are procedurally generated using a combination of advanced techniques:
- Binary Space Partitioning (BSP) - Creates the overall layout by recursively dividing space into rooms and corridors
- Critical Path System - Ensures that every dungeon has a navigable path from entrance to the final objective
This approach creates dungeons that are both random and balanced, ensuring no two expeditions will be exactly alike while maintaining playability.
Room Types
Each dungeon consists of various room types, managed by specialized "room workers" that determine what appears in each space:
- Combat Rooms - Filled with hostile NPCs that must be defeated
- Trap Rooms - Contains various hazards that must be navigated carefully
- Treasure Rooms - Holds valuable loot with varying degrees of protection
- Boss Chambers - Contains powerful enemies guarding significant rewards
- Puzzle Rooms - Requires solving environmental challenges
The distribution and arrangement of these rooms varies with each dungeon, creating unique challenges every time.
Obstacles & Challenges
Throughout the dungeons, colonists will encounter numerous obstacles:
- Locked Doors - Require finding the corresponding key (always accessible somewhere in the dungeon) or can be pick-locked with sufficient skill
- Fake Walls & Doors - Deceptive passages that hide alternate routes
- Gaps - Can be bridged or jumped over with the right equipment or abilities
- Interactive Traps - Mechanisms that can be disarmed, avoided, or triggered
- Guardian NPCs - Hostile entities protecting valuable areas
Each obstacle is designed to be overcome with the right preparation or approach, encouraging tactical thinking.
Map Modifiers
Dungeons can have special modifiers that affect the entire map, adding an extra layer of challenge:
- Environmental Hazards - Random fires, floods, or other natural dangers
- Hunter NPCs - Special enemies that actively pursue colonists through the dungeon
- Time Distortion - Effects like accelerated aging requiring careful management
- Temperature Extremes - Abnormally hot or cold conditions requiring special gear
- Custom Atmospheres - Special effects like toxic air or magical radiation
These modifiers can dramatically change how a dungeon must be approached, encouraging different tactics and preparations.
Dungeon Mechanics
The dungeon system operates on the following principles:
- Portal Access - Dungeons are entered through portals that maintain the instance
- Temporary Existence - The dungeon only exists while the portal remains open
- Objective-Based - Each dungeon has a primary goal (defeat boss, retrieve artifact, etc.)
- Non-Persistence - Once completed and exited, the specific layout is lost forever
- Variety - Some dungeons are completely random, while others have fixed elements
The temporary nature of these dungeons means that decisions made during exploration have permanent consequences.
Difficulty & Preparation
Dungeons vary significantly in difficulty:
- Scaling Challenge - Higher difficulty dungeons offer greater rewards but require more preparation
- Environmental Preparation - Some dungeons require specific countermeasures (fire resistance for fire realms, cold protection for ice domains, etc.)
- Equipment Requirements - Certain obstacles may require specific tools or abilities to overcome
- Resource Management - Limited resources within dungeons require careful planning
Successful dungeon expeditions depend on proper preparation matched to the specific challenges of each environment.
This system continues to evolve with updates to the mod. Check back for more information as new dungeon features are added.