Comments (2)
I'v gone through the code visually, and I can't see anything that might cause this.. but I know to little still.
- Maybe it has to do that the MAME frame rate and the game frame rate is different? That might cause frames to skip/repeat due to aliasing of rate differences?
Another thing related to this that puzzles me is :
- each environment step returns a list of 3 frames instead of a single frame.
In the datapipe code I see np.frombuffer(ptr).reshape(hight,width,channels) and that should return a single RBG frame, not a list of 3 frames? Or is it intended to return 3 frames in each step?
from mametoolkit.
Sorry for the slow response. Something you have to bear in mind when using this framework is that you need to match up the framework with the games frame rate. There are 3 parameters to the environment which affect frame delivery: frame_ratio, frames_per_step, frame_skip.
Frame skip is used internally within the emulator, it can increase the play speed of the game, as only every nth frame is returned.
Frame ratio is similar, but internal to this library. So the frames will still be rendered to screen, but the libarary will only interact with MAME every nth frame. The reason for the distinction is to allow human viewing without skipping rendered frames.
Frames per step is used to determine how many emulator steps should be taken before the next action is sent to the emulator. So if this is set to 3, then the emulator will collect 3 frames, and on the 3rd frame send your action to the game. The reason you might want to capture groups of frames at a time is so that you can show time progression to your reinforcement learning algorithm.
The problem you are seeing with the duplicated frames is kind of complicated. The game itself is running at 60 fps, however the gameplay seems to run at around 30 frames a second. And then on top of that the character animations are done at around 12 frames per second. So to get the optimum performance without losing gameplay information your want to set: frame_ratio=1, frames_per_step=2, frame_skip=5. This would return 12 frames per second, and capture two frames at a time before acting.
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
- 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.