Skip to main content

Decapitate the Spire

PyPI

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.

Demo

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
  • Dungeons
    • Mechanics (map, room traversal, etc.)
    • Content
      • Exordium
        • Monsters
        • Events
        • Shops
      • The City
      • The Beyond

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.

  1. Fork it (https://github.com/jahabrewer/decapitate-the-spire/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. 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.

Release files for decapitate-the-spire 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for decapitate-the-spire 0.2.0
File Size Uploaded
decapitate_the_spire-0.2.0.tar.gz 100.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for decapitate-the-spire 0.2.0
File Interpreter ABI Platform
decapitate_the_spire-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 202.9 kB

Release files / decapitate_the_spire-0.2.0.tar.gz

Download URL decapitate_the_spire-0.2.0.tar.gz
Size 100.3 kB
Tags Source
SHA-256 checksum
How to use checksums
65bd54205dbb8b47bc1f54960eb25951d8fa9525542fdeb582078e496afd806d
BLAKE2b-256 checksum
How to use checksums
5a6fbd3b2f010c01c357fc606f179d4837c8c79f461b5c773e2104b0d85c893c
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / decapitate_the_spire-0.2.0-py3-none-any.whl

Download URL decapitate_the_spire-0.2.0-py3-none-any.whl
Size 102.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a965ac53d89948b1b5ea25ec0ee14b6d77ea9f6995676950b2dc4be52f6c93d1
BLAKE2b-256 checksum
How to use checksums
cea807a6b9b7e85a9042b6f05aac77fe283e79f468892481daedb2f619be41d6
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page