Git Product home page Git Product logo

gym-snape's Introduction

Super Nifty Auto Pets Environment (SNAPE)

EDIT (August 7, 2022): I decided to switch to implementing my own simple auto battler in C++ (which is not going to be a particularly faithful adaptation of Super Auto Pets), called A C++ Auto Battler (ACAB). When ACAB is in a playable state, I'll create another repo to wrap ACAB in an OpenAI Gym environment. That's the plan anyway.


I'm tired of losing consistently in Super Auto Pets, so I made this environment to train an RL agent to play for me.

This repository comes with a playable version of Super Auto Pets. See gym-snape/gym_snape/game/README.md for details.

Installation

$ conda env create -f environment.yml
$ conda activate snape
$ pip install -e gym-snape

Example

Pit two basic agents against each other.

>>> python example.py

Sample output:

This game has ended. No further actions can be taken.
This game has ended. No further actions can be taken.
PLAYER 1
+----------------------------------------------------------------+
| TURN: 82 | LIVES: 1  | TROPHIES: 10 | GOLD: 0  | ACTIONS: 3366 |
+----------------------------------------------------------------+
 ___         _
|   \ ___ __| |__
| |) / -_) _| / /
|___/\___\__|_\_\
4----------43----------32----------21----------10----------0
|HIPPO     ||          ||          ||          ||          |
|hp:  27   ||          ||          ||          ||          |
|atk: 23   ||          ||          ||          ||          |
|fct: ...  ||          ||          ||          ||          |
|exp: 0/2  ||          ||          ||          ||          |
|lvl: 1    ||          ||          ||          ||          |
4----------43----------32----------21----------10----------0
 ___ _
/ __| |_  ___ _ __
\__ \ ' \/ _ \ '_ \
|___/_||_\___/ .__/
             |_|
0----------01----------12----------23----------34----------45----------56----------6
|RHINO    *||COW       ||SCORPION  ||RHINO    *||TURKEY    ||PIZZA     ||MUSHROOM  |
|hp:  44   ||hp:  24   ||hp:  19   ||hp:  50   ||hp:  22   ||          ||          |
|atk: 41   ||atk: 22   ||atk: 19   ||atk: 50   ||atk: 21   ||          ||          |
|fct: ...  ||fct: ...  ||fct: Psn  ||fct: ...  ||fct: ...  ||          ||          |
|exp: 0/2  ||exp: 0/2  ||exp: 0/2  ||exp: 0/2  ||exp: 0/2  ||          ||          |
|lvl: 1    ||lvl: 1    ||lvl: 1    ||lvl: 1    ||lvl: 1    ||          ||          |
0----------01----------12----------23----------34----------45----------56----------6
You won!
PLAYER 2
+----------------------------------------------------------------+
| TURN: 82 | LIVES: 0  | TROPHIES: 9  | GOLD: 0  | ACTIONS: 3372 |
+----------------------------------------------------------------+
 ___         _
|   \ ___ __| |__
| |) / -_) _| / /
|___/\___\__|_\_\
4----------43----------32----------21----------10----------0
|          ||          ||          ||          ||          |
|          ||          ||          ||          ||          |
|          ||          ||          ||          ||          |
|          ||          ||          ||          ||          |
|          ||          ||          ||          ||          |
|          ||          ||          ||          ||          |
4----------43----------32----------21----------10----------0
 ___ _
/ __| |_  ___ _ __
\__ \ ' \/ _ \ '_ \
|___/_||_\___/ .__/
             |_|
0----------01----------12----------23----------34----------45----------56----------6
|CROCODILE*||SCORPION  ||ROOSTER  *||LEOPARD   ||TIGER    *||PEAR      ||MELON     |
|hp:  50   ||hp:  33   ||hp:  50   ||hp:  36   ||hp:  35   ||          ||          |
|atk: 50   ||atk: 33   ||atk: 50   ||atk: 42   ||atk: 36   ||          ||          |
|fct: ...  ||fct: Psn  ||fct: ...  ||fct: ...  ||fct: ...  ||          ||          |
|exp: 0/2  ||exp: 0/2  ||exp: 0/2  ||exp: 0/2  ||exp: 0/2  ||          ||          |
|lvl: 1    ||lvl: 1    ||lvl: 1    ||lvl: 1    ||lvl: 1    ||          ||          |
0----------01----------12----------23----------34----------45----------56----------6
You lost!

gym-snape's People

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

gym-snape's Issues

Empty "self._friends[]" edge case in tier1.py

Got the following after running a few times:

AttributeError: 'NoneType' object has no attribute 'attack_buff'

image

Error arises in self._friends[index].attack_buff += 1 from tier1.py. May need to check the array size beforehand?

Empty "self._deck[]" edge case in tier4.py

Got the following after running a few times (seems related to Issue #2 ):

AttributeError: 'NoneType' object has no attribute 'attack'

image

Error arises in self._deck[index].attack += self.health from tier4.py.

Whale doesn't die

image

Error found on the error_handling branch. Whale seems to just keep going further into negative HP instead of dying and proceeding to next turn.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.