Skip to main content

Raspberry Pi Plays Flappy Bird With the Power of AI

Raspberry Pi
(Image credit: Dmytro Panin)

Playing Flappy Bird on the Raspberry Pi is a simple feat in itself but this project takes things a step further by using artificial intelligence to play it for you. Created by maker Dmytro Panin, also known as Dr2mod at Reddit, this project acts as a standalone display that continuously plays through the classic game.

ai_powered_flappy_bird_for_rpi_3b_and_spi_display from r/RASPBERRY_PI_PROJECTS

Sometimes the best Raspberry Pi projects have simple inspirations. Dr2mod explained the project idea derived from a desire to create something interesting and decorative to look at alongside the window by his desk. The end result was this self-playing Flappy Bird project.

The project relies on an SPI display for video output. It implements an AI algorithm from a paper known as Evolving Neural Networks through Augmenting Topologies, often referred to as NEAT, to navigate the map and guide flappy bird through the course of pipes. This Flappy Bird game is actually a clone designed by Panin just for the NEAT AI to operate.

According to Panin, the AI has a chance of failure. During some test runs, one agent failed to clear a pipe with a score of around 9,000. That said, he’s also seen some reach scores as high as 30,000.

Panin was kind enough to share the source code at GitHub for anyone interested in checking out the project in greater detail. If you enjoyed this project, be sure to follow Panin for more cool Raspberry Pi projects.