The Combination of Flappy Bird and Reinforcement Learning Using Q-learning

Authors

  • Xinlu Dong
  • Xiaole Fan
  • Chenhao Sun
  • Zhengyang Xu

DOI:

https://doi.org/10.54097/hset.v34i.5480

Keywords:

Flappy Bird, Reinforcement Learning, Q-learning, Artificial Intelligence.

Abstract

The development of artificial intelligence has expanded application fields gradually. In recent years, the combination of artificial intelligence and games attracted much attention. In this case, reinforcement learning is often chosen as an effective method to let the computer play the game by itself. In this study, the Q-learning algorithm from reinforcement learning was applied to Flappy Bird. There are the important factors of Q-learning, including state (S), action (A), reward (R), policy (π), time (t), Epsilon Greedy policy and Q-table. After that, a python class called “bot” was used, and it is used as an intelligent agent in the project. In order to implement the Q-learning algorithm, the state of each element of the game was adjusted continuously through the “mainGame” function of the Flappy Bird game. Finally, the survival reward was set to 1 and the death reward to -1000 to increase the survival rate. In addition, coins with different reward values were added to increase the difficulty of training. After training, the survival rate of the bird is improved, and it is clear that the reward value of gold coins will affect the agent's choice tendency. To combine artificial intelligence and games means that computers can be trained to deal with the complex and changing situations in games, and the progress will affect the application of artificial intelligence in real life more deeply.

Downloads

Download data is not yet available.

References

IBM Cloud Education. Artificial Intelligence (AI) [R]. Retrieved from https://www.ibm.com/cloud/learn/what-is-artificial-intelligence, 2020

Piyush Verma, Stelios Diamantidis. What is Reinforcement Learning? [R] Retrieved from https://www.synopsys.com/ai/what-is-reinforcement-learning.html, 2021

Gibney, E. Game-playing software holds lessons for neuroscience [J]. Nature 518, 465–466 (2015). https://doi.org/10.1038/518465a

Li, Junjie, et al. Suphx: Mastering mahjong with deep reinforcement learning [R]. arXiv preprint arXiv:2003.13590 (2020).

Simplilearn. What Is Q-Learning: The Best Guide to Understand Q-Learning Lesson 23 of 33 [R], 2020 Retrieved from https://www.simplilearn.com/tutorials/machine-learning-tutorial/what-is-q-learning

Cihan, ZeeWanderer. Flappy Bird Bot using Reinforcement Learning in Python [R]. https://github.com/chncyhn/flappybird-qlearning-bot, 2019.

Mike Bertha, Philly.com. Everything you need to know about your new favorite cell phone game, ‘Flappy Bird’ [R]. Philly.com. 2012.

Ingenito, Vince. Flappy Bird Review [R]. IGN. Archived from the original on February 23, 2014. Retrieved February 26, 2014.

Flappy Bird Tips: How to Get a High Score Without Cheats [R]. Huffingtonpost.co.uk. 2014.

Melo, Francisco S. Convergence of Q-learning: A simple proof [J]. Institute Of Systems and Robotics, Tech. Rep (2001): 1-4.

Downloads

Published

28-02-2023

How to Cite

Dong, X., Fan, X., Sun, C., & Xu, Z. (2023). The Combination of Flappy Bird and Reinforcement Learning Using Q-learning. Highlights in Science, Engineering and Technology, 34, 250-254. https://doi.org/10.54097/hset.v34i.5480