To choose the right actions an Q-Table is used to rate each action on a field.
After a few rounds of random exploration, the Q-Table can be used to find the quickest way to reach the goal.
In version 2 the agent has to find a key to open a door that blocks the way to the key, the key can be thought of as an extra dimension in the Q-Table.