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

bug in flappy bird game #52

Open
adibyte95 opened this issue Jul 26, 2018 · 3 comments
Open

bug in flappy bird game #52

adibyte95 opened this issue Jul 26, 2018 · 3 comments

Comments

@adibyte95
Copy link

adibyte95 commented Jul 26, 2018

position of the keys in state (where state = p.getGameState() and is a dictionary of key value pairs ) changes every time the game is re run

lets us say that in one instance player_vel is the first key as shown in the figure below
image

but in another run this changes
image

how one is supposed to train an reinforcement learning algorithm with this type of observation inputs

@adibyte95
Copy link
Author

if you have the same problem take a look at this pull request

@ntasfi
Copy link
Owner

ntasfi commented Jul 28, 2018

@adibyte95 in python the order of a dict's keys will not be the same between runs. This is because it uses a hashmap under the hood. I would recommend explicitly referring to a quantity you require by the key name. Eg: state["next_pipe_top_y"].

@adibyte95
Copy link
Author

adibyte95 commented Jul 28, 2018

@ntasfi by using an ordered dictionary as compared to ordinary dictionary the keys will be in the same position as they were inserted and will not change during different runs. i know that in an dictionary a value can be easily found through its corresponding key, but if someone tries to use only the values as in my case they will get confused, so i think this is more elegant this way.

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