ysn-rfd's picture
Upload 3 files
7a4812b verified

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

Python Game Engine Save System


πŸš€ 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

git clone https://github.com/ysnrfd/DCE.git
cd DCE-main

2. Run the program

Linux:

python3 dungeon_crawler.py

Windows:

python dungeon_crawler.py

πŸ”§ Usage Examples

Run the main game loop

python dungeon_crawler.py

Use the map generation module alone

from dungeon_crawler import DungeonGenerator
map_data = DungeonGenerator(width=40, height=20).generate()
print(map_data)

Save and verify game state

from dungeon_crawler import SaveSystem, GameState

state = GameState(...)
SaveSystem.save(state, "game_state.encrypted")
verified = SaveSystem.load("game_state.encrypted")

πŸ“‚ Project 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!