Barebones RPG Framework
A flexible, code-first RPG framework for building turn-based games with support for procedural generation and AI-driven content.
What is this?
Barebones RPG is a Python framework designed to be a foundation for creating RPG games. It provides all the essential systems needed for an RPG (combat, entities, items, quests, dialog, world management, etc.), but with no content - making it a perfect starting point for your own games.
The framework is code-first (Python classes and functions), fully extensible (hooks and events throughout), and supports both hand-crafted and procedurally generated content.
Installation
Requirements
- Python 3.11+
For Users
# Install from PyPI
pip install barebones-rpg
For Development
# Clone the repository
git clone https://github.com/PierceGov/barebones_rpg.git
cd barebones_rpg
# Install with uv (recommended)
uv sync --dev
# Or with pip
pip install -e ".[dev]"
Running the Examples
# Run the main example
uv run python main.py
# Or run specific examples
uv run python -m barebones_rpg.examples.simple_combat_example
uv run python -m barebones_rpg.examples.mini_rpg
uv run python -m barebones_rpg.examples.tile_based_example
Running Tests
# Run all tests
uv run pytest
# Run with coverage
uv run pytest --cov=barebones_rpg
Documentation
View the full documentation online
The documentation is also available locally in the sphinx_docs/ directory. To build and view:
./build_docs.sh
# Then open sphinx_docs/_build/html/index.html
The documentation includes:
- Getting Started Guide
- Core Concepts and Architecture
- Complete API Reference
- Step-by-Step Tutorials
- In-Depth Guides
- Example Breakdowns
Quick Example
from barebones_rpg import Game, GameConfig, Character, Enemy, Stats, Combat
# Create game
game = Game(GameConfig(title="My RPG"))
# Create characters
hero = Character(
name="Hero",
stats=Stats(strength=15, constitution=12, dexterity=10,
intelligence=8, charisma=10, base_max_hp=50, hp=100)
)
goblin = Enemy(
name="Goblin",
stats=Stats(strength=8, constitution=6, dexterity=12,
intelligence=5, charisma=5, base_max_hp=20, hp=30)
)
# Start combat
combat = Combat(
player_group=[hero],
enemy_group=[goblin],
events=game.events
)
combat.start()
# Example with custom AI
from barebones_rpg import AIInterface, AIContext
class SimpleAI(AIInterface):
def decide_action(self, context: AIContext) -> dict:
if context.nearby_entities:
return {"action": "attack", "target": context.nearby_entities[0]}
return {"action": "wait"}
# Assign AI directly to entity
goblin.ai = SimpleAI()
See barebones_rpg/examples/ for complete working examples.
Project Structure
barebones_rpg/
├── core/ # Game engine, events, save/load
├── entities/ # Characters, NPCs, enemies, stats, AI
├── combat/ # Turn-based combat system
├── items/ # Items, inventory, equipment, loot
├── quests/ # Quest and objective tracking
├── dialog/ # Conversation trees
├── world/ # Maps, locations, tiles
├── rendering/ # Pygame renderer
├── loaders/ # Data loaders (JSON/YAML)
└── examples/ # Example games
Contributing
Contributions are welcome!
License
MIT License - See LICENSE.md for details
Metadata
Release files for barebones-rpg 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| barebones_rpg-0.2.0.tar.gz | 211.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| barebones_rpg-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 321.8 kB
Release files / barebones_rpg-0.2.0.tar.gz
| Download URL | barebones_rpg-0.2.0.tar.gz |
|---|---|
| Size | 211.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
189ec46d686f6bcd38b12a5665130dbcd4a60746faff03208e9017380f1c4adf
|
|
BLAKE2b-256 checksum How to use checksums |
9db9d6e258c6a80125c0a7cac2293d0412f72eaa2f791f732f3cf5441e0e0292
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 8, 2025.
Transparency logRelease files / barebones_rpg-0.2.0-py3-none-any.whl
| Download URL | barebones_rpg-0.2.0-py3-none-any.whl |
|---|---|
| Size | 110.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
52320fb7bbce022c26f7e496bc74e4d0782cd7f745c7b3ebb53300334cde280d
|
|
BLAKE2b-256 checksum How to use checksums |
201a08b148e541c722ec969f319ed1d062411750093b03204af41c835e478cdb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 8, 2025.
Transparency log