| # DCE | |
| # πΉοΈ Dungeon-Crawler-Engine | |
| Modular dungeon crawler simulation for **AI-driven gameplay**, **pathfinding experiments**, and **cryptographic save testing**. | |
| **Under development** by **YSNRFD** | |
| --- | |
| ## π§ DCE_ysnrfd β Procedural Dungeon Crawler Engine with AI & Secure Save System | |
| [](https://www.python.org/) | |
| []() | |
| []() | |
| --- | |
| ## π Overview | |
| **DCE_ysnrfd** is an extensible, modular dungeon crawler simulation built in pure Python. | |
| It includes a secure save/load system using cryptographic HMACs, procedurally generated dungeons, an intelligent A\* enemy AI, and a structured turn-based system. | |
| Perfect for prototyping **game mechanics**, **AI behavior**, and **simulation loops**. | |
| This project is for **educational purposes**, AI/ML pathfinding demos, and ethical development only. | |
| --- | |
| ## β¨ Features | |
| - π§± **Procedural Dungeon Generation** | |
| Uses recursive division with controlled randomness to generate interconnected dungeon layouts. | |
| - π§ **A\* Pathfinding** | |
| Enemies use a priority queue with Manhattan heuristics for navigation and targeting. | |
| - βοΈ **Component-Based Entity System** | |
| Players, enemies, and items are all modeled with clean, modular class structures. | |
| - π **Cryptographic Save/Load** | |
| Uses HMAC-SHA256 to verify save integrity. Saves are rejected if tampered. | |
| - β±οΈ **Turn-Based State Machine** | |
| Robust finite state system for clean transitions (menu β gameplay β endgame). | |
| - π§ **Inventory & Items System** | |
| Supports armor, weapons, potions, and quest items with metadata and effects. | |
| - π **Type-Hinted & Extensible** | |
| Fully annotated for IDE support and future expansion. | |
| - π **Verbose Logging System** | |
| Game states and events are logged to `dungeon_crawler.log`. | |
| --- | |
| ## π¦ Installation | |
| **1. Clone the repository** | |
| ```bash | |
| git clone https://github.com/ysnrfd/DCE.git | |
| cd DCE-main | |
| ``` | |
| **2. Run the program** | |
| Linux: | |
| ```python | |
| python3 dungeon_crawler.py | |
| ``` | |
| Windows: | |
| ```python | |
| python dungeon_crawler.py | |
| ``` | |
| ## π§ Usage Examples | |
| **Run the main game loop** | |
| ```python | |
| python dungeon_crawler.py | |
| ``` | |
| **Use the map generation module alone** | |
| ```python | |
| from dungeon_crawler import DungeonGenerator | |
| map_data = DungeonGenerator(width=40, height=20).generate() | |
| print(map_data) | |
| ``` | |
| **Save and verify game state** | |
| ```python | |
| from dungeon_crawler import SaveSystem, GameState | |
| state = GameState(...) | |
| SaveSystem.save(state, "game_state.encrypted") | |
| verified = SaveSystem.load("game_state.encrypted") | |
| ``` | |
| ## π Project Structure | |
| ```structure | |
| dungeon-crawler-engine/ | |
| βββ dungeon_crawler.py # Main game engine | |
| βββ #dungeon_crawler.log # Log output | |
| βββ #game_state.encrypted # Cryptographically signed game save | |
| βββ README.md | |
| βββ LICENSE | |
| ``` | |
| ## π Save System Details | |
| - **Based on HMAC-SHA256 with secret key** | |
| - **Includes timestamp and anti-replay protection** | |
| - **Invalid or tampered saves are automatically discarded** | |
| ## π§ Algorithms & Internals | |
| - **Pathfinding: A with open/closed sets, priority queues (heapq)** | |
| - **Dungeon Generation: Recursive division + random room linking** | |
| - **State Machine: Enum-based game states and transitions** | |
| - **Secure Save: JSON serialization + hmac + secrets** | |
| ## π£οΈ Roadmap | |
| **β Cryptographic save/load system** | |
| **β Procedural generation engine** | |
| **β A pathfinding and enemy AI** | |
| **π² GUI version with Pygame or Pyxel** | |
| **π² Quest/dialogue system** | |
| **π² Plugin API for modding** | |
| **π² Fog of war and minimap** | |
| ## β οΈ Ethical Usage Notice | |
| This engine is intended for learning, game prototyping, and academic experiments only. | |
| You are not permitted to use this code in unethical simulations or closed-source game repackaging without preserving attribution. | |
| ## π License | |
| This project is licensed under the **YSNRFD License.** | |
| You are free to fork and build upon it with proper credit and within ethical guidelines. | |
| Redistribution without credit is strictly forbidden. | |
| ## π¨βπ» Author | |
| **Developer: YSNRFD** | |
| **Telegram: @ysnrfd** | |
| ## β Support This Project | |
| **If you enjoyed this project or learned something useful, please star it on GitHub and share it with others!** | |