A headless clone of Mega Crit's Slay the Spire
Project description
Decapitate the Spire
A headless clone of Mega Crit's Slay the Spire.
Have you ever wanted to play Slay the Spire, but with no graphics, an inscrutable TUI, and lots of bugs? Probably not. Computers like it, though.
Installation
pip install decapitate-the-spire
Usage example
To play in a console:
python3 -m decapitate_the_spire
If you want to control the game from your own code, start with a core loop like this:
from decapitate_the_spire import game as dg
def main():
# Also consider dg.SimpleDungeon and dg.MiniDungeon for testing.
game = dg.Game(dg.TheSilent, dg.Exordium)
is_terminal = False
while not is_terminal:
# You'll be determining the actions; this is a placeholder. See the
# wiki for details on the action space.
action_0, action_1 = (0, 0)
# This is the core gameplay loop.
_, is_terminal, _ = game.step((action_0, action_1))
Current state
This is very much a work in progress. The code is littered with TODOs and bugs. I'm focused on getting Exordium playable with Silent and with full content.
- Characters
- Silent
- Relics
- Cards
- Ironclad
- Defect
- Watcher
- Silent
- Dungeons
- Mechanics (map, room traversal, etc.)
- Content
- Exordium
- Monsters
- Events
- Shops
- The City
- The Beyond
- Exordium
Development setup
# If you don't have pipenv, get it.
pip install pipenv
# Clone this repo.
# git clone ...
# Enter the new repo dir.
cd decapitate-the-spire
# Start pipenv. It'll pick up the Pipfile in the repo. Notice that you're in a
# new shell after this.
pipenv shell
# Install dev dependencies.
pipenv install --dev
# Run tests to verify.
pytest
Contributing
Pull requests are very welcome. I'm focused on completing Exordium and gaining confidence in my cloning of the original game. Tests are required when practical.
- Fork it (https://github.com/jahabrewer/decapitate-the-spire/fork)
- Create your feature branch (
git checkout -b feature/fooBar
) - Commit your changes (
git commit -am 'Add some fooBar'
) - Push to the branch (
git push origin feature/fooBar
) - Create a new Pull Request
Motivation
A while back, I was watching jorbs and got jealous because he plays so well. I knew I could never best his play with my brain, so I decided to try my hand at creating an agent that could beat jorbs for me.
I opted to use reinforcement learning to create the agent, inspired by its success with, well, everything lately (especially SC2LE). Reinforcement learning is great in that you don't need to tell the agent how the game works; it learns the game. The problem/tradeoff is that it needs to play the game a whoooole lot before it's smart at all.
Initially, I hooked up a reinforcement learning trainer to Slay the Spire via ForgottenArbiter's very cool CommunicationMod. This worked... but at human speed. It was obvious that I needed a fast, headless version of the game.
aaaaaand here we are.
Credits
Very big thanks to Mega Crit for allowing me to release this publicly.
This package was created with Cookiecutter and the sourcery-ai/python-best-practices-cookiecutter project template.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file decapitate_the_spire-0.2.0.tar.gz
.
File metadata
- Download URL: decapitate_the_spire-0.2.0.tar.gz
- Upload date:
- Size: 100.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65bd54205dbb8b47bc1f54960eb25951d8fa9525542fdeb582078e496afd806d |
|
MD5 | cd76316b01cfb677215fccbcbdcd8de2 |
|
BLAKE2b-256 | 5a6fbd3b2f010c01c357fc606f179d4837c8c79f461b5c773e2104b0d85c893c |
File details
Details for the file decapitate_the_spire-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: decapitate_the_spire-0.2.0-py3-none-any.whl
- Upload date:
- Size: 102.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.0 requests/2.22.0 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a965ac53d89948b1b5ea25ec0ee14b6d77ea9f6995676950b2dc4be52f6c93d1 |
|
MD5 | a32a93a2c5fdf96aa1d2753f822b2adf |
|
BLAKE2b-256 | cea807a6b9b7e85a9042b6f05aac77fe283e79f468892481daedb2f619be41d6 |