Play the game

Play the game manually

Now that you know how the environment works, it’s a good idea to play the game manually a few times to get a feel for how the game works. Although the goal is to train an agent to play the game automatically, having some intuition about the game will help you develop an effective training strategy. And although the strategy is obvious with slippery mode turned off, the non-deterministic response to the agent’s actions changes the approach.

  1. Use the play_manually() function from the frozen-lake package to play the game with slippery mode off. You can move the cursor by clicking the buttons that get rendered in the Jupyter notebook:

    # Try both with and without is_slippery
    env = FrozenLakeEnv(is_slippery=False)
    play_manually(env)
    

  2. Now try the game with slippery mode on by changing the is_slippery argument to True in the above code and re-running it. Play the game a few times.

    Notice the difficulty of the game in slippery mode – the game performs the action requested with 1/3 probability. The way it determines the next state is by assigning equal probabiliy to three actions and then choosing one at random. For example, if you tell the agent to move right, which is action 2, the game will actually move down (action 1), right (action 2) or up (action 3) with equal probability.