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.2.0.tar.gz (100.3 kB view hashes)

Uploaded Source

Built Distribution

decapitate_the_spire-0.2.0-py3-none-any.whl (102.6 kB view hashes)

Uploaded Python 3

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