openai/gym

Get the agent position (x axis and y axis) of atari games

Closed this issue · 4 comments

Hi, is it okay to directly get the agent position from RAM (e.g. which IDs of the 128 vector represent the current position of the agent)?

I would like to directly get instead of using CNN to train.

Thanks

Yeah it should be fine to get that, but you will have to figure out which ram locations map to the position of the agent.

ram = env.unwrapped._get_ram()  # get emulator RAM state
cpu_score = ram[13]  # computer/ai opponent score 
player_score = ram[14]  # your score
cpu_paddle_y = ram[21]  # Y coordinate of computer paddle
player_paddle_y = ram[51]  # Y coordinate of your paddle
ball_x = ram[49]  # X coordinate of ball
ball_y = ram[54]  # Y coordinate of ball
ram = env.unwrapped._get_ram()  # get emulator RAM state
cpu_score = ram[13]  # computer/ai opponent score 
player_score = ram[14]  # your score
cpu_paddle_y = ram[21]  # Y coordinate of computer paddle
player_paddle_y = ram[51]  # Y coordinate of your paddle
ball_x = ram[49]  # X coordinate of ball
ball_y = ram[54]  # Y coordinate of ball

Very good to see how to get the code. But how to see the mapping of specific meaning of different values in the array for other games?

Very good to see how to get the code. But how to see the mapping of specific meaning of different values in the array for other games?

Maybe its late but you can check out this ram_annotations