Comments (5)
Hello,
You need to import the roms they are not provided by default.
- Download zip file from http://www.atarimania.com/rom_collection_archive_atari_2600_roms.html
- Open Roms.rar > ROMS.rar
- Extract all
- python -m retro.import . (don't forget the point)
Taken from here #53
Have a great day !
from retro.
@simoninithomas Thank you very much! That works. Yesterday I tried to find the ROMs, but I failed.
from retro.
Hello,
You need to import the roms they are not provided by default.
- Download zip file from http://www.atarimania.com/rom_collection_archive_atari_2600_roms.html
- Open Roms.rar > ROMS.rar
- Extract all
- python -m retro.import . (don't forget the point)
Pls help a TRUE novice out: Where are we typing in the pythonmretroimport. Right click the folder? command line, etc
from retro.
Pls help a TRUE novice out: Where are we typing in the pythonmretroimport. Right click the folder? command line, etc
@waltdrexler perhaps this "starter guide" I've put together can help and if there's an error maybe @endrift or @christopherhesse can point it out. Step 3 refers to importing ROMs.
You'll need to work in Jupyter (type your commands with a "!" in the cells) or use a command line (no need for "!").
- If you haven't already, install
retro
:
pip install gym-retro
Alternatively, you can also git clone a fresh version of the repo with git clone https://github.com/openai/retro.git
and then run python setup.py install
.
-
To run Sonic you should ideally get the game from Steam. Download the Steam app, create an account, purchase and download the game. The Retro Gym Contest run by OpenAI in 2018 worked on three version of Sonic: the original Sonic The Hedgehog, Sonic 2, and Sonic 3 And Knuckles. You should get at least one of these games before moving on to the next step.
-
Once the game(s) are downloaded, import the game ROMs from the installed Steam directory, which hosts the Steam-purchased games, with:
python -m retro.import '/STEAM-DIRECTORY-PATH/Steam'
(Note: on MacOS, the path would be somewhere under '/Users/USER-NAME/Library/Application Support/Steam'
). The output should look like this:
Importing 7422 potential games...
Importing SonicAndKnuckles3-Genesis
Importing SonicTheHedgehog2-Genesis
Importing SonicTheHedgehog-Genesis
Imported 3 games
Note: to list all supported game ROM environments before choosing the one(s) you have already: retro.data.list_games()
(it's quite a long list).
- The Sonic game environments you need to take note of are:
'SonicTheHedgehog-Genesis'
'SonicTheHedgehog-Sms'
'SonicTheHedgehog2-Genesis'
'SonicTheHedgehog2-Sms'
'SonicTheHedgehog3-Genesis'
'SonicTheHedgehogRandomLevels-Genesis'
I'd recommend using Genesis
- Also, take note of the game levels (ignore ".state"—these are just the file types). You can view them all here:
GreenHillZone.Act1.state
GreenHillZone.Act2.state
GreenHillZone.Act3.state
LabyrinthZone.Act1.state
LabyrinthZone.Act2.state
LabyrinthZone.Act3.state
MarbleZone.Act1.state
MarbleZone.Act2.state
MarbleZone.Act3.state
ScrapBrainZone.Act1.state
ScrapBrainZone.Act2.state
SpringYardZone.Act1.state
SpringYardZone.Act2.state
SpringYardZone.Act3.state
StarLightZone.Act1.state
StarLightZone.Act2.state
StarLightZone.Act3.state
- Test it with a nice viz of the game. First, check if you have matplotlib installed, and if not—"pip install matplotlib
. Add a cell in Jupyter or create a
sonic-rl-test.py` file:
import retro
%matplotlib inline
import matplotlib as mpl # For visualization
import matplotlib.pyplot as plt
mpl.rc('axes', labelsize=14)
mpl.rc('xtick', labelsize=12)
mpl.rc('ytick', labelsize=12)
# Instantiate the Sonic 1 environment and level 1 as follows:
env = retro.make(game='SonicTheHedgehog-Genesis', state='GreenHillZone.Act1')
obs = env.reset()
for i in range(100): # For 100 steps
random_action = env.action_space.sample() # Take random actions
obs, reward, done, info = env.step(random_action) # Progress the game (an agent's action is fed into `env.step()` and a new `obs` is sent to the agent)
if done:
obs = env.reset() # Reset the environment if "game over" (done)
plt.imshow(obs)
Run it and you should see a snapshot of what the agent was up to.
-
Add
env.close()
to shut the environment's window and free up the resources. -
Consider using a neat package called
retrowrapper
to run multiple instances of envs as subprocesses (pip install retrowrapper
):
import retrowrapper
env_greehill_act1 = retrowrapper.RetroWrapper(
game='SonicTheHedgehog-Genesis',
state='GreenHillZone.Act1')
env_labyrinth_act1 = retrowrapper.RetroWrapper(
game='SonicTheHedgehog-Genesis',
state='LabyrinthZone.Act1')
from retro.
worked like a charm
from retro.
Related Issues (20)
- End environment after a level is complete
- can we have a tutorial video for adding custom cores ? HOT 3
- Rom Import
- Create Save State HOT 1
- UnboundLocalError: local variable 'ext' referenced before assignment HOT 3
- I get errors when i try to install gym-retro how do i solve this issues HOT 4
- SimpleImageViewer Import not found HOT 2
- Playback_Movie: [WinError 2] The system cannot find the file specified HOT 1
- Installation fail on Mac M1 HOT 11
- Hexadecimal memory locations for data.json HOT 1
- AttributeError: 'RetroEnv' object has no attribute 'em' HOT 4
- Can't install on Debian 11
- Can't load roms in gym HOT 3
- Variables constantly changing when they shouldn't? HOT 1
- two agent competing environment
- Add support for Python 3.9
- Issue with installing gym-retro (python 3.8) HOT 1
- support double dragon Neo-Geo(MAME Emulator) or PS ? HOT 2
- Sonic Down from steam store HOT 1
- subprocess.CalledProcessError: Command '['/usr/bin/make', '-j12', 'retro']' returned non-zero exit status 2. HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from retro.