ayush-09 / FlappyBird

This repository contains the implementation of two OpenAI Gym environments for the Flappy Bird game. The implementation of the game's logic and graphics was based on the FlapPyBird project.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FlappyBird

This repository contains the implementation of two OpenAI Gym environments for the Flappy Bird game. The implementation of the game's logic and graphics was based on the FlapPyBird project.

In this flappy.py file I train the Neural Network model with reinforcement learning approach.

Performance of trained Agent

pygame.window.2021-06-09.15-42-46.mp4

To check the performance and visualize the agent uncomment the agent.perform() and comment the agent.train() in the flappy.py file.
if __name__ == '__main__':
  agent = DQNAgent()
  #agent.train()
  agent.perform()

Perform Function:

Capture1

Train the Agent

For train the agent uncomment the agent.train() in the .py file.
if name == 'main':
  agent = DQNAgent()
  agent.train()
  #agent.perform()

Train Function:

Capture

After training the model is saved by name "flappybrain.h5" shown in this repository.

Requirements:

  • flappy-bird-gym
  • numpy
  • tensorflow

Fork and Run the flappy.py file to see the result.

About

This repository contains the implementation of two OpenAI Gym environments for the Flappy Bird game. The implementation of the game's logic and graphics was based on the FlapPyBird project.


Languages

Language:Python 100.0%