-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can I reset the game without making fceux close and open again ? #5
Comments
dont use the reset when an agent is stuck, use env.change_level(new_level=LVint). feel free to ask more questions |
But I should reach enough score to change level, or it would say env has no attribution:change_level. How to solve it ? |
I had these same issues, I am using this for a genetic algorithm and specifically need to train on each level, getting to a base score as this env does now is of no use to me. I have a branch on my repo that has as few changes as I could to achieve the functionality I needed. The only reset indicator I use is if the distance increase in a number of steps.
I use this is a chunk of code from my current project (you can find this code in my jobtrainer function) to reset and change levels through all 32 levels as well as save scores through pipes, it is rather complicated because the only way to tell if mario has warped through a pipe is checking if his distance jumps more that 50 units, there might be a better unit but this works in practice. again this is using the env branched on my repo, it is hacky and gross but it works. In the future I would like to rewrite this to not have a base score needed to move to the next level and have windows support... big dreams here. |
@koltafrickenfer I have tried your branch and solve this problem perfectly, but there are some little issues:
|
I believe only my instructions in my readMe specify to use the tiles version, just remove "-tiles-" from the env string. If it is running slower than the original I have not noticed??? I run this in a 12 core opteron server with a gtx 1080 and if there is some issue with my branch causing a drop in performance I would love to resolve that. In |
I merge the original NesEnv class and your MetaNesEnv class and solve the speed issue. And is there no way to change the source code of the game, such as set mario in a specified position? Or I can implement this via lua script? |
you could implement that in the lua script. |
Are you familiar with this lua script? I tried to modified its |
I am familiar with the script but I have almost zero knowledge of the inner workings of the emulator/nes hardware. |
Oh, I have solved this problem by reading fceux help files. Thank you very much! |
How did you solve it? @shinshiner A code snippet would be very appreciated! |
Sometimes the agent gets stuck. So if the agent does not make any improvement in say 200 frames, I want to reset the game. But doing so closes the fceux and opens it again. This reduces the speed. I am using the gabegrand branch.
Thank you
The text was updated successfully, but these errors were encountered: