SAILabSiena Artificial Intelligence Lab

Bulding an RL Agent to play FlappyBird

In this page, you can see some videos of the RL agent playing Flappy Bird.

We show the agent at 3 different stages of learning, i.e. after 100, 1000 and 20000 episodes of learning (roughly after 5k, 50k and 1.5M iterations, respectively).
It is interesting to note how the strategy of the agent changes with experience. In the beginning (100 and 1000 episodes of learning) the strategy is very similar to what a human would do: try to pass in the middle of the space between the top and the bottom pipes. The agent becomes more and more precise in this behaviour from 100 to 1000 episodes.

However, after a much longer exercise, the agent develops a very peculiar strategy: it tries to get very close to the bottom pipe and, then, using a diagonal trajectory, pass through the hole. This is very interesting since, using this strategy, the agent is capable of facing also cases in which the first pipe is the very bottom of the screen and the next pipe is in the very top of the screen, which are the most common failure cases in the previous strategies.

We inserted also some trivial failure cases to illustrate the fact that the model is not trained enough to generalize to any situation.

Videos

100 learning episodes

1000 learning episodes

20000 learning episodes