davidtjones / melee-env

A gym-esque environment for Super Smash Bros. Melee.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow for circumventing the action space so that "dumb" bots will work with melee-env

davidtjones opened this issue · comments

Problem

Currently, all agents are required to obtain controller inputs from the action space, which are then executed via ControllerState instances. While this behavior is desirable for learning agents, non-learning agents are unable to be implemented on melee-env. See this section of code.

Possible fix

Separate AI-agents into two groups, where learning agents (LA) utilize the action space and non-learning agents (NLA) are allowed to execute on their own controllers. This may be relatively simple.

Some thoughts

This would be a good point to reconsider whether the observation returned by MeleeEnv will be a numpy array or just the whole gamestate from libmelee, which may just make a lot more sense and allow LA's observations (probably heavily filtered/modified versions of libmelee's gamestate) to not affect other agents (currently all agents are forced to accept the same observation space).

One big issue here is that the current implementation can keep track of when players are defeated and provide the correct information to fill in to the observation. gamestate just drops the player entirely, which is problematic when the agent expects an observation of a given size. I think libmelee should really handle this better, but it may be a slippi thing. Idea: Agents can keep track of their last observation (last_observation), and perhaps there can be some indication to agents when other agents have been defeated so that rows from last_observation can be inserted into current_observation or something.