Terminara is a terminal-based ai simulation game.
To create a terminal-based AI simulation game using Python and the textual library. The game features an AI-driven storyteller that generates scenarios and choices for the player within a customizable world setting.
Read README.md for instructions on how to run the project in production mode. Read CONTRIBUTING for instructions on how to run the project in development mode.
- AI as Game Master: The core of the game is an AI that generates narrative scenarios and player choices based on a predefined world setting.
- Text-Based GUI: The user interface is built with
textual, focusing on a clean, text-centric experience. - Context Caching System: A temporary storage system to provide the AI with consistent memory and context, independent of the AI's own memory limitations.
- Save & Load System: Allows players to save their game progress and load it later.
- World Setting Management: World settings can be exported to a file for sharing and imported to start new games in different worlds.
- Virtual Environment: Always prefer using executables from the
.venvvirtual environment under the project directory (i.e.,.venv\\Scripts\\python.exe). - Package Management: When managing packages, prefer using the
uvcommand over globalpiporpython. Always add dependencies topyproject.tomlfirst, then runuv syncinstead of usinguv add.
- Distributed Structure: Prefer structuring code into distributed folders or modules, avoiding concentrating large amounts of code in a single file.
- Example: Use a distributed structure such as
config/manager.py(logic handling) paired withconfig/models.py(Pydantic BaseModel data definitions), rather than consolidating everything into a singleconfig.py.
- Example: Use a distributed structure such as
- Explicit Types: Always define type hints in detail. Every method's inputs and outputs must have type definitions.
- Data Structures: Prefer using Pydantic's
BaseModelto define data structures; avoid passing complex data using rawdictwherever possible.
- Frequent Logging: Add
loggerstatements at I/O entry/exit points, API call sites, and major operations. Debug-level logging for non-critical items is also encouraged. - Linter & Formatter: When writing or modifying Python code, use
rufffor both linting and formatting (ruff check . --fix & ruff format .).