Generic Open AI Gym Agents, wrappers and tools for Nintendo/Famicom ROMs.
BYOR (Bring your own roms)
Both of these libraries must be installed.
It's recommended that they are cloned as repositories and installed from git repos using:
python -e .
This allows for extensibility.
mkdir nes-ai-root
cd nes-ai-root
git clone https://github.com/openai/gym.git
cd gym
pip3 install -e .
cd ..
git clone https://github.com/Kautenja/nes-py.git
cd nes-py
pip3 install -e
cd ..
git clone https://github.com/omardelarosa/nes-ai.git
cd nes-ai
pip3 install -r requirements.txt
To run any with human keyboard control agent, run:
python . -a RandomAgent --mode human --rom roms/rom.nes
To use the random sample agent
python . -a RandomAgent--mode random --rom roms/rom.nes
To add an agent:
-
create a file in the
agents
directory using the naming conventionAgentName.py
. -
The file must implement and export a class matching this signature:
class AgentName():
def __init__(self, args)
# do stuff here
- Register your class in
agents/__init__.py
as follows:
from . import AgentName
__all__ = [
'AgentName'
]
Some ROMs require header corrections. Please see tools/ directory for instructions on fixing your ROM files.
- Create a feature branch
- Complete changes
- Open a PR against
master
branch - Merge PR.