Miffyli / ToriLLE

Toribash Learning Environment
GNU General Public License v3.0
49 stars 7 forks source link
deep-learning gym machine-learning reinforcement-learning-playground toribash

Mating-ritual of two random agents PPO ripping a Uke a new one, and feeling the scene Another PPO attacking Uke in more random situations

ToriLLE

Toribash Learning Environment. Extra "L" to make words more memorable for Finns ("Torille" = "To the marketplace").

ToriLLE provides learning agents an interface to video-game Toribash, a humanoid fighting game. Toribash provides environment for MuJoCo-like humanoid control, specifically aimed for competitive gameplay. This makes ToriLLE suitable for e.g. self-play experiments.

ToriLLE comes with a Python interface and pre-made OpenAI Gym environment with various tasks. Following white-paper includes baseline experiments and benchmarks conducted using ToriLLE: https://arxiv.org/abs/1807.10110

Requirements

Tested to work on Windows 10, Ubuntu 16.04 and MacOS 10.13. Tested on Python versions 3.5 and 3.6, and will likely not work on 2.7.

Quickstart

Remember to install Wine if you are on Linux or MacOS. Make sure wine command is defined.

Following will download ToriLLE with stripped down version of Toribash:

pip install git+https://github.com/miffyli/torille

Random agent:

from torille import ToribashControl
from torille.utils import create_random_actions

# Show gameplay
toribash = ToribashControl(draw_game=True)
toribash.init()

# Random agent
while 1:
    state, t = toribash.get_state()
    if t: break
    toribash.make_actions(create_random_actions())
toribash.close()

OpenAI Gym environment:

import gym
import torille.envs

env = gym.make("Toribash-DestroyUke-v0")
# Show gameplay
env.set_draw_game(True)

initial_state = env.reset()
t = False
# Random agent
while not t:
    s, r, t, _ = env.step(env.action_space.sample())
env.close()

Manual installation

:warning: Following instructions are old and may not work with current versions of Toribash. :warning:

You can install ToriLLE without PyPI/pip with the following:

Playing in multiplayer

:warning: Multiplayer does not work on Linux Wine, and may not work with the new version :warning:

Want to try your agents against human players in multiplayer? Check how manual remote control works.

Documentation

Examples in examples provide quickstart to how to use ToriLLE, and also show how to apply settings or record replays.

For references see:

For troubleshooting, see the FAQ.

If you wish to modify ToriLLE or use other language to control Toribash instance, see hacking and documentation on protocol.

Repository structure

Related work and useful links

Citing

We wouldn't mind a citation if you find ToriLLE useful in your work. It also helps us to see what people have been up to!

@inproceedings{kanervisto2019torille,
  title={ToriLLE: Learning Environment for Hand-to-Hand Combat},
  author={Kanervisto, Anssi and Hautam{\"a}ki, Ville},
  booktitle={2019 IEEE Conference on Games (CoG)},
  year={2019},
}

Special thanks & Acknowledgements

License

Code original to ToriLLE is licensed under GNU GPL 3.0. Toribash is property of Nabistudios. Toribash binary in this package is shared with the permission of main developer "hampa".