Note: This project is currently in active development.
A Data-Driven Text-Adventure Engine
Lair of Xaldern is a technical portfolio project developed to demonstrate proficiency in modular software design, relational data management, and automated ETL (Extract, Transform, Load) pipelines. Originally created as a foundational project ahead of Computer Science coursework at Pikes Peak State College, this engine focuses on decoupling narrative content from execution logic.
The engine follows a modular architecture to adhere to the Single Responsibility Principle:
lair_of_xaldern: The main package containing:__main__.py: - Module entry point used bypython3 -m lair_of_xaldern.main.py: - Core game loop and initialization logic.movementinventorycombatUI modules
tools/: Contains the Data-Sync Pipeline, a custom utility that parses Obsidian Markdown files (YAML frontmatter) and synchronizes them with the production database.design/: The "Source of Truth" for game content. By utilizing Markdown, the world-building process is kept distinct from the codebase.data/: The persistence layer, housing the SQLite database. (Note:.dbfiles are git-ignored to maintain local state integrity).
This game requires Python 3.10+ and SQLite3 to manage world data and item persistence.
- Windows: Download from python.org. Ensure "Add Python to PATH" is checked.
- macOS: Use Homebrew (
brew install python@3.10) or the official installer. - Linux:
sudo apt update && sudo apt install python3.10
To check installation, run sqlite3 --version in your terminal.
- Windows: Usually bundled with Python.
- macOS/Linux: Almost always pre-installed. If missing on Linux, use
sudo apt install sqlite3.
To avoid "Externally Managed Environment" errors, utilize a virtual environment:
- Create venv:
python3 -m venv .venv - Activate venv:
source .venv/bin/activate(Windows:.venv\Scripts\activate) - Install Dependencies:
pip install pyyaml
- Sync Data: Every time you modify a Markdown file in the
design/folder, sync the database:python3 tools/data_sync.py
- Launch Engine:
python3 -m lair_of_xaldern
This section communicates the high-level technical skills utilized in the project.
The engine utilizes a relational SQLite database. This allows for complex queries, such as Join Tables for room-item relationships, ensuring that game state changes (like picking up an item) are persistent and memory-efficient.
Implemented a custom parser in data_sync.py that automates the transition from narrative design to structured data. This pipeline handles:
- Sanitization: Cleaning YAML frontmatter for database entry.
- Mapping: Converting Markdown internal links to relational Foreign Keys.
- Filtering: Excluding draft content to ensure a stable production environment.
The engine features a robust text-parser that handles case-sensitivity, whitespace, and "fuzzy" matching. The HUD is dynamically rendered to provide real-time feedback on player vitals and spatial positioning.
- Relational Migration: Transitioned from flat-file JSON to SQLite.
- Design-to-Data Pipeline: Created Obsidian-to-SQL synchronization tools.
- Inventory Persistence: Implementing relational item tracking.
- Object-Oriented Refactor: Transitioning room and player entities into Class structures.
Author: Dominiq Barbero