Skip to content

Latest commit

 

History

History
79 lines (58 loc) · 3.35 KB

README.MD

File metadata and controls

79 lines (58 loc) · 3.35 KB

NEAT Chrome Dino Game

Preview

A.I. Chrome Dinosaur in Python using Pygame and NEAT Algorithm! 🦖

Show support:
Star 🌟 the Project: GitHub stars
Follow 🤝 on GitHub: GitHub followers

Made by maxrohowsky

Table of contents

Description

This is the Chrome Dinosaur Game using NEAT and Pygame written in Python. NEAT stands for neuro evolution of augmenting topologies and is a genetic algorithm that creates artificial neural networks.

In this project, NEAT is used to train an AI to play the Chrome Dinosaur Game. The Chrome Dinosaur Game is a simple infinite runner where the player has to jump over cacti and avoid birds. The game gets progressively harder as the player's score increases. See how far your AI can run!

YouTube Videos

  1. Python A.I. Tutorial (with NEAT) - Part 1 - Setup & Display Dinosaur
  2. Python A.I. Tutorial (with NEAT) - Part 2 - Finishing the Game
  3. Python A.I. Tutorial (with NEAT) - Part 3 - Adding the A.I.
  4. Python A.I. Tutorial (with NEAT) - Part 4 - Final Touches

Installation

Requirements: You must have Python installed and preferably a code editor like PyCharm.

  1. Clone the repository
  2. In the terminal, navigate to the directory where the repository was cloned, e.g., C:\Users\Max\PycharmProjects\neat-chrome-dinosaur
  3. Create a virtual environment, activate it, and install pygame by running the following commands in the terminal:
    python -m venv venv #This creates a virtual environment
    venv\Scripts\activate #This activates the virtual environment
    pip install -r requirements.txt #This installs the required libraries
  4. Run the game by running the following command in the terminal:
    python main.py

Note on PyCharm: Often PyCharm detects the requirements and asks you to install them and create a virtual env.

Controls

  • You don't need to control the dinosaur. The AI will do that for you :)

Libraries

  • pygame: Pygame is a cross-platform set of Python modules designed for writing video games.
  • NEAT: NEAT is a method developed by Kenneth O. Stanley for evolving arbitrary neural networks.

FAQ

Contact

Feel free to reach out to me on Twitter if you have any questions or feedback! Hope you find this useful!