Skip to main content

A headless clone of Mega Crit's Slay the Spire

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

decapitate_the_spire-0.1.0.tar.gz (100.5 kB view details)

Uploaded Source

Built Distribution

decapitate_the_spire-0.1.0-py3-none-any.whl (102.6 kB view details)

Uploaded Python 3

File details

Details for the file decapitate_the_spire-0.1.0.tar.gz.

File metadata

  • Download URL: decapitate_the_spire-0.1.0.tar.gz
  • Upload date:
  • Size: 100.5 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

Hashes for decapitate_the_spire-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d62a1d89f1171a568488bb5ab500cfee87a30ded384c713886b00e8da0475a0c
MD5 a58e5c683f547d3b2ec6cb999f487ab7
BLAKE2b-256 2eb6ce85aae68a9d8edbf786a61fb9cd32efa6e96efa86a97694f7535ec510e7

See more details on using hashes here.

File details

Details for the file decapitate_the_spire-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: decapitate_the_spire-0.1.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

Hashes for decapitate_the_spire-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9c8f6cc4068a0890a582b97ba1a9937d2e06e1a4eb4c8b21884b2c08d9fee432
MD5 90f90cf16eeb97165bae825defa0dabc
BLAKE2b-256 aeb846e5f052423f056a7b8bfb498998777f74091ff086132e86a7a11e42867c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page