A gym-esque environment for Super Smash Bros. Melee.
Project description
melee-env
This repo contains an implemention of Melee as a Gym-esque environment.
Code example:
from melee import enums
from melee_env.env import MeleeEnv
from melee_env.agents.util import ActionSpace, ObservationSpace
from melee_env.agents.basic import *
players = [Rest(), Shine(), Random(enums.Character.FALCO), CPU(enums.Character.LINK, 3)]
env = MeleeEnv(
"path/to/iso",
players,
ActionSpace(),
ObservationSpace(),
ai_starts_game=True,
fast_forward=False,
blocking_input=True)
env.start()
episodes = 10; reward = 0; done = False
for episode in range(episodes):
observation, reward, done, info = env.setup(enums.Stage.BATTLEFIELD)
while not done:
for i in range(len(players)):
if players[i].agent_type == "AI": # only process AI players
players[i].act(observation, env.action_space)
observation, reward, done, info = env.step()
This library has been designed with flexibility in mind. The action space, observation space, and the agents are completely modular, and there are only a few requirements to build your own. For more information on these topics, see the README in the agents folder.
Note
This library requires Slippi, which in turn requires an SSBM 1.02 NTSC/PAL ISO. This library does not and will not distribute this. You must acquire this on your own!
Installation
Install from pip: pip install melee-env
. Test by running the above example.
Platform support
- Linux
- Windows (planned)
Some notes:
- If you notice that controllers aren't working, check the config in dolphin and verify that the controller profile is setup correctly. The automation steps should take care of this. You can verify the controller config for the bot is correct by checking Controllers -> [port X] -> Configure and verifying that the resulting window looks like this. You should be able to load the slippibot profile to fix this. Unsure if this is still an issue.
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
Built Distribution
Hashes for melee_env-0.21.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 694f023332522d360c1fa1c40024f2a1e9c5fe34e377c474047748eb8576db25 |
|
MD5 | a6f32aafbc813c6fa7372cdc775c32b3 |
|
BLAKE2b-256 | 897fe132b0b284326a278aebb93723eda34a8a1eb700f4dbb37b685a2bb91013 |