Turn-based dungeon crawler game playable in the terminal. Navigate through procedurally generated floors, battle enemies, collect equipment, and survive as long as possible!
cd c:\Users\Eleve\Desktop\simple_backend
python -m game.mainSelect language (English/Franรงais), create your character, and begin your adventure!
- Character Stats: HP (200), Attack (10), Speed (10) - all customizable
- Progression: Floor advancement with natural progression (+1/turn) plus event-based floor changes
- Inventory: Equipment slots (weapon, helmet, chest, boots, wings) with auto-equip on pickup
- Currency: Coins collected from events and milestones, used for future shop system
- Persistence: Best run tracking (furthest floor reached, time elapsed)
- Turn-Based Fights: Player vs Enemy with speed-based turn order
- Equipment Scaling: Stats scale dynamically (additive + multiplicative)
- Enemy Difficulty: Floor-based scaling with 10 tiers (multipliers from 1.0x to 8.75x)
- Victory/Defeat: Proper combat outcome tracking and display
| Lucky Events | Unlucky Events | Floor Events |
|---|---|---|
| Heal | Enemy Combat | Floor Up |
| Item Drop | Poison | Floor Down |
| Coins |
- 3 Choices Per Turn: High/Medium/Low risk with different event probabilities
- Deceptive Hints: 10% chance path hint misleads the player
- Contextual Messages: Hint-specific or generic event outcomes
- Milestone Floors: 10, 20, 30, 40... 100
- Scaled Rewards: Coins increase exponentially (40 โ 20,000 at floor 100)
- Variance: ยฑ15% randomization on rewards
- Full English & French Support
- Config-Driven Text: All UI strings in YAML (no hardcoding)
- Language Switching: Menu option to toggle EN/FR at any time
simple_backend/
โโโ README.md # This file
โโโ pyproject.toml # Python project metadata & dependencies
โโโ .gitignore
โ
โโโ game/
โ โโโ main.py # Entry point
โ โโโ engine.py # Core game loop orchestration
โ โโโ builder.py # Factory: player/paths/events/milestones
โ โโโ __init__.py
โ โ
โ โโโ config/
โ โ โโโ loader.py # YAML config loading system
โ โ โโโ helpers.py # Config utility functions
โ โ โโโ en/config.yaml # English UI text & game settings
โ โ โโโ fr/config.yaml # French UI text & game settings
โ โ
โ โโโ gameplay/
โ โ โโโ entities/
โ โ โ โโโ entities.py # Base Entity class (HP, combat)
โ โ โ โโโ player.py # Player class (inventory, timer)
โ โ โ โโโ enemies.py # Enemy class (scaling logic)
โ โ โ โโโ enemies_list.py # Factory for 20+ enemy types
โ โ โ
โ โ โโโ equipment/
โ โ โ โโโ player_equipment.py # Inventory & equipment management
โ โ โ โโโ errors.py # Custom exceptions
โ โ โ โโโ items/
โ โ โ โโโ item.py # Item base class
โ โ โ โโโ items_list.py # 50+ item definitions
โ โ โ
โ โ โโโ events/
โ โ โ โโโ events.py # 9 event handler functions
โ โ โ
โ โ โโโ combat_logic/
โ โ โโโ adventure.py # Turn-based combat engine
โ โ
โ โโโ menu/
โ โโโ menu_terminal.py # Terminal UI & main menu
โ
โโโ logs/
โโโ game.log # Runtime logs
1. Player Creation (set name, language)
2. Game Loop (while alive):
a. Display current floor & stats
b. Generate 3 random paths (risk-based)
c. Player selects path
d. Event executes (enemy/heal/poison/coins/item/floor change)
e. Natural progression: +1 floor (unless floor_up/down occurred)
f. Check milestone (auto-reward coins if applicable)
g. Check death (HP โค 0 โ end run)
3. End Run Display (best floor, time, new record check)
All game settings are stored in game/config/{en,fr}/config.yaml:
- Game Settings: Starting HP/attack/speed, difficulty scaling
- Event Messages: All 9 event types with translations
- Paths & Hints: 12 unique hints across 3 risk levels
- Risk Labels: Localized difficulty names
- Milestone Rewards: 10 milestone tiers with variance
Events return a structured dict:
{
"type": "enemy|poison|heal|coins|item|floor_up|floor_down|random_item|add_coins",
"value": <event_specific_data>,
"report": <optional_combat_report>
}Floor-based multiplier system:
- Tier 1 (floors 1-9): 1.0x
- Tier 2 (floors 10-19): 1.1x
- Tier 10 (floors 90-99): 5.85x
- Tier 11 (floor 100): 8.75x
- Speed determines turn order
- Damage = Attack ยฑ 20% variance
- Escape attempts scale with player speed
- Combat continues until one side dies
- Full game loop with event handling
- All 9 event types functional
- Natural floor progression
- Milestone detection & rewards
- Equipment system with stat scaling
- 20+ enemies with contextual loot
- Turn-based combat engine
- Full localization (EN/FR)
- Terminal UI with menu system
- Comprehensive logging
- Shop System: Spend coins to purchase equipment upgrades
- Persistent Coins: Save/load progression between sessions
- Web Interface: REST API + web UI for gameplay
- Advanced Events: Debuffs, artifacts, temporary boosters
- Difficulty Modes: Custom scaling options
- Leaderboards: Global best run tracking
- Python 3.13+
- PyYAML (included in pyproject.toml)
# Clone or navigate to project
cd simple_backend
# Install dependencies (using pyproject.toml)
pip install -e .python -m game.mainLogs are automatically written to logs/game.log with INFO level and above.
- Total Lines of Code: ~1,200 (core game logic)
- Event Types: 9 (lucky, unlucky, floor progression)
- Enemy Types: 20+ (humanoids + monsters)
- Equipment Items: 50+ (weapons, armor, accessories)
- Unique Hints: 12 (context-specific path descriptions)
- Supported Languages: 2 (English, French)
- Factory Pattern:
create_player(),create_3_paths(),create_event() - Event-Driven: Events return structured data for flexible handling
- Config-Driven: Externalized all text/settings to YAML
- Dependency Injection: Config passed to functions requiring localization
- Separation of Concerns: UI, logic, entities, config all separate
- DRY Principle: No hardcoded strings; all text in config files
- Type Safety: Type hints throughout (mostly) for IDE support
- Logging: Comprehensive INFO-level logs for debugging
Project: Dungeon Master
Author: Vitadevv
Status: Active Development
Repository: simple_backend (main branch)
