File size: 4,492 Bytes
7a4812b |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 |
# 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!**
|