mila-iqia / atari-representation-learning

Code for "Unsupervised State Representation Learning in Atari"
https://arxiv.org/abs/1906.08226
MIT License
240 stars 50 forks source link

Ram annotation of (x, y) are not aligned #64

Closed happywu closed 4 years ago

happywu commented 4 years ago

Hi,

I've tried using the provided AtariARIWrapper to get the 'labels' for MsPacmanNoFrameskip-v4. However, when I draw the locations of player, enemy_sue, enemy_inky..., using ('player_x', 'player_y'), ('enemy_sue_x', 'enemy_sue_y'), there seems to be always certain offsets to the real location.

image

image

How can get the aligned locations? Thanks

eracah commented 4 years ago

Hi, So the wrapper provides just the raw RAM values. The source code of the game then uses those values to render the sprites. Unfortunately, I don't know assembly code well enough to interpret this rendering process. See issue 47 for a longer answer on this topic. One thing you could do is find (by trial and error) what the offset is and then just add this offset to your code that draws the circles. Hope this helps!

ankeshanand commented 4 years ago

@happywu We also found the mapping from RAM values to screen positions to be inconsistent across games, and also across different variables within each game. If you want to do this only for a particular game, you can try to deconstruct the encoding for that game using the disassemblies: http://www.bjars.com/disassemblies.html

happywu commented 4 years ago

Thanks, I think manual hack the offsets for certain game would work.