Comments (6)
script:
#!/usr/bin/env python3
import random
from MAMEToolkit.sf_environment import Environment
roms_path = "roms/" # Replace this with the path to your ROMs
env = Environment("env1", roms_path)
env.start()
#while True:
move_action = random.randint(0, 8)
attack_action = random.randint(0, 9)
frames, reward, round_done, stage_done, game_done = env.step(move_action, attack_action)
if game_done:
env.new_game()
elif stage_done:
env.next_stage()
elif round_done:
env.next_round()
If I just hit escape I see:
parallels@parallels-Parallels-Virtual-Platform:~$ python3.6 ./sf.py
Failed to read value from 'dataPipe'
Traceback (most recent call last):
File "/home/parallels/.local/lib/python3.6/site-packages/MAMEToolkit/emulator/pipes/Pipe.py", line 96, in readln
return self.read_queue.get(timeout=timeout)
File "/usr/lib/python3.6/queue.py", line 172, in get
raise Empty
queue.Empty
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "./sf.py", line 13, in
frames, reward, round_done, stage_done, game_done = env.step(move_action, attack_action)
File "/home/parallels/.local/lib/python3.6/site-packages/MAMEToolkit/sf_environment/Environment.py", line 211, in step
data = self.gather_frames(actions)
File "/home/parallels/.local/lib/python3.6/site-packages/MAMEToolkit/sf_environment/Environment.py", line 179, in gather_frames
data = self.sub_step(actions)
File "/home/parallels/.local/lib/python3.6/site-packages/MAMEToolkit/sf_environment/Environment.py", line 190, in sub_step
data = self.emu.step([action.value for action in actions])
File "/home/parallels/.local/lib/python3.6/site-packages/MAMEToolkit/emulator/Emulator.py", line 150, in step
data = self.dataPipe.read_data(timeout=10) # gathers the frame data and memory address values
File "/home/parallels/.local/lib/python3.6/site-packages/MAMEToolkit/emulator/pipes/DataPipe.py", line 27, in read_data
line = self.pipe.readln(timeout=timeout)
File "/home/parallels/.local/lib/python3.6/site-packages/MAMEToolkit/emulator/pipes/Pipe.py", line 100, in readln
raise IOError(error)
OSError: Failed to read value from 'dataPipe'
parallels@parallels-Parallels-Virtual-Platform:~$
from mametoolkit.
The toolkit does not automatically create the graph. If you want to build this graph you will need to take the sum or rewards for every episode. Then you can use the Matplotlib library to build the graph. It's fairly simple to use. Best of luck!
from mametoolkit.
Where is the raw data stored for each episode?
from mametoolkit.
Also each time you start the emulator does the alg start from ground zero each time?
from mametoolkit.
The toolkit does not keep track of overall stats across an episode. You will need to store every reward returned from the step function over an entire episode yourself.
from mametoolkit.
Feature request?
from mametoolkit.
Related Issues (20)
- dead link in README HOT 1
- Enable sound when throttle = True? HOT 3
- MAMEToolkit only supports RGB32 and ARGB32 frame bit format games - Tekken 2 Environment HOT 2
- Emulator error when initializing the environment. HOT 1
- How should I save and load models HOT 1
- Can it train on the server? HOT 5
- duplicated and missing frames HOT 2
- get gemini wing actions fail HOT 1
- gemini wing agents can't work HOT 2
- Have you considered providing a gym interface? HOT 1
- [Q] alternative for older MAME versions HOT 1
- Links from this part of readme aren't working: HOT 1
- Environment() setup time seems very long HOT 1
- get Error "FileNotFoundError: [Errno 2] No such file or directory" HOT 3
- Error No output expected from command 'mem = manager:machine().devices[":maincpu"].spaces["program"]' HOT 1
- compilation failure HOT 1
- Qt platform plugin "xcb" not found --- calling run_cheat_debugger() HOT 3
- I had to modify mamearcade.make - others may need this too. HOT 1
- Emulator() call never hooks and returns - just runs MAME
- Sample code problem
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 mametoolkit.