What is observation_n in universe exactally?

48 views Asked by At

I'm playing around with OpenAI's Universe module and am having trouble understanding what the observation_n is exactly and how it works. On their website it just says, "Universe allows an AI agent to use a computer like a human does: by looking at screen pixels..."

I modified some code that was meant for a gym game called "CartPole-v1" and tried applying it to "flashgames.DriftRunners-v0". However I keep getting an index error, so I assume observation_n is not an index.

def get_action(self, observation_n):
        turn_angle = observation_n[2]
        action = [('KeyEvent', 'ArrowUp', True), ('KeyEvent', 'ArrowRight', True)] if turn_angle > 0 else [('KeyEvent', 'ArrowUp', True)]
        return action


agent = Agent(env)
observation_n = env.reset()

I'm getting this error,

line 19, in get_action
    turn_angle = observation_n[2]
IndexError: list index out of range
0

There are 0 answers