Skip to content
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

Filtered Actions #245

Open
onaclov2000 opened this issue May 29, 2021 · 4 comments
Open

Filtered Actions #245

onaclov2000 opened this issue May 29, 2021 · 4 comments

Comments

@onaclov2000
Copy link

Issue summary

I am having issues with the start and select keys being operational for SNES.

in retro_env.py printing "action" prior to filtering, shows a value for select and start, however if you print action after filtering it will show 0.

action = self.data.filter_action(action)

While most games may not require start or select, the game Super Metroid requires both, (one for selecting weapons, and the other for menuing to turn items on and off).

commenting out the filter_action seems to work, but I'm not sure what the larger implications are.

@onaclov2000
Copy link
Author

A better question might be "What does filtering actually do?" I think if I understood the goal up front, it might make sense and I can figure out the more "correct" solution.

@endrift
Copy link
Contributor

endrift commented Jun 12, 2021

The point of filtering actions is to prevent your agent from attempting key presses or combinations that aren't useful in the game, to reduce the search space. For example, in Super Mario Bros, unfiltered actions will include the Start button, which pauses the game, but filtered actions won't.

@onaclov2000
Copy link
Author

onaclov2000 commented Jun 28, 2021

@endrift is there somewhere you can (or rather are supposed to) edit the filtered actions per game? For Super Metroid for example it's important you can access the start screen during the game, so you can turn on and off different upgrades occasionally. (or refill health as that is one operation that is useful).

@endrift
Copy link
Contributor

endrift commented Jun 28, 2021

Yes, they can be overridden per game in the scenario.json, see https://github.com/openai/retro/blob/98fe0d328e1568836a46e5fce55a607f47a0c332/retro/data/stable/KidChameleon-Genesis/scenario.json for an example. Each top-level is a set of buttons that can be pressed independently of each other one, so you can press up, down or none × left, right or none × all of the variants in the bottom row.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants