Skip to content

mathildari/Flappy-Bird-AI-Reinforcement-Learning

Repository files navigation

Flappy-Bird-AI-Reinforcement-Learning

📌 Description

This project simulates a version of the Flappy Bird game and trains an intelligent agent to play it automatically using reinforcement learning techniques.

At each frame, the agent must decide whether to jump or do nothing. The objective is to survive as long as possible by avoiding obstacles and maximizing rewards.

Different game variants were developed to test the robustness and generalization of the agent:

  • Classic Flappy Bird

  • Complex Flappy Bird (wind, moving pipes, etc.)

  • Flappy Bird with bonus points

  • Flappy Bird with two decisions (jump + power-ups)

  • Flappy Bird with smart batches to improve training stability

🧠 Learning Methods

  • Naive baselines: random policy, rule-based policy

  • Epsilon-Greedy

  • Decaying Epsilon-Greedy (ε decreases over time)

  • Greedy only (no exploration)

Comparison:

Greedy < Epsilon-Greedy < Decaying Epsilon-Greedy

⚙️ Technical Details

The agent’s decisions are based on a set of observable features such as:

  • Distance to the next pipe

  • Vertical gap position

  • Bird’s velocity

  • Altitude

  • Bonus / power-ups (depending on the version)

Decisions are computed with a weighted linear combination of these features.

Weights are optimized using exploration–exploitation strategies.

🎮 Game Variants

  • Classic: stable learning, near-perfect scores.

  • Complex: additional wind and moving pipes.

  • Bonus points: collectible items for extra score.

  • Two decisions: simultaneous control of jumps and power-ups.

  • Smart batches: selecting weights based on consistency, reducing variance in results.

About

This project simulates a version of the Flappy Bird game and trains an intelligent agent to play it automatically using reinforcement learning techniques.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors