A car learns to drive in a small 2D environment using the NEAT-Algorithm with Pygame

Overview

Self-driving-car-with-Pygame

A car learns to drive in a small 2D environment using the NEAT-Algorithm with Pygame grafik

Description

A car has 5 sensors ("eyes") to detect and learn the distance to the road boundary. Using these sensors and Python's Neat library, cars are trained to steer and stay on the road. Neat is a genetic algorithm that starts with a simple neural network and increases its complexity over the next few generations. In each generation there are many cars, each car having its own neural network. Once a generation is over (all cars are "dead"), Neat constructs the neural networks of the new generation based on the neural network of the best car of the previous generation. With this technique, the algorithm learns how to drive and gets better and better over the generations.

Modes

Run training_the_car.py to see what the training process looks like. Once training is complete, the program saves the trained version of the best car to a file. loading_trained_car.py loads a pre-trained model and lets the car drive based on the loaded model.

Setup

You need to have python, neat and pygame installed in order to run the program. Installation of pygame: https://pypi.org/project/pygame/ Installation of Neat: https://pypi.org/project/neat-python/

You might also like...
A simple matrix code rain created using Python with Pygame.

Matrix4_code_rain A simple matrix code rain created using Python with Pygame. To run the code you will need Pygame and MS Mincho font. Create a projec

This is an amazing game make using pygame.

This is an awesome balloon game. It is made in python using Pygame library. It is a project game while learning game development.

 Pendulum Simulation using Pygame
Pendulum Simulation using Pygame

Pendulum project, built using pygame and math modules.

A Pygame application which generates mazes using randomized DFS (Depth-First-Search)
A Pygame application which generates mazes using randomized DFS (Depth-First-Search)

Maze-Generator-with-Randomized-DFS A Pygame application which generates mazes using randomized DFS (Depth-First-Search)-(Iterative implementation). Ra

Made to help you create UI using pygame in python, gonna add way more to this project

Pygame visualizer Made to help you create UI using pygame in python, gonna add way more to this project. As of now, this is only hours worth of work.

This is a 2D Link to the Past-esque game made using Python 3.2.5 and pygame 1.9.2

Queen-s-Demise Queen's Demise This is a 2D Link to the Past-esque game made using Python 3.2.5 and pygame 1.9.2 I made this for a game development cla

N-Queens game made using pygame library
N-Queens game made using pygame library

N-Queens N-Queens game using pygame for AIML201 Testing: 1. git clone https://github.com/python-game-dev/N-Queens.git 2. cd N-Queens 3. python main.py

A didactic GUI chess game made in Python3 using pygame.
A didactic GUI chess game made in Python3 using pygame.

Chess A didactic GUI chess game made in Python3 using pygame. At the moment, there is no AI. The only way you can test the game is by playing against

Owner
Henri
German high school student interested in Machine Learning :)
Henri
PyGame-Tutorial - Refrence for building games in pygame

PyGame-Tutorial How to build games using the python library PyGame End result Ho

St. Mark's Computer Science Club 2 Jan 9, 2022
AI that plays Flappy Bird Game using the python module NEAT.

Flappy Bird AI [NEAT] AI that plays Flappy Bird Game using the python module NEAT. Instructions Install Python Modules: pip3 install -r requirements.t

Abhisht 5 Jan 26, 2022
Small game I made in 2019 using python/pygame.

Kill-The-Blokk // Shoot or Die This is a small game I made in gr.10 (2019) for my high school computer science class; the game was coded in python usi

null 1 Nov 13, 2021
OS Algo Visualization - Operating system algorithm visualization using python pygame library

OS_Algo_Visualization Operating system algorithm visualization using python pyga

Krushang Satani 2 Feb 17, 2022
A small, Pygame-based library project intended for personal use.

EzyGame Version 0.0.1 A simple library project intended for personal use with Pygame. Warning: I am a very amateur programmer, so the code will probab

Dorbell 1 Jan 8, 2022
SelectionSortVisualization - This pygame project is helping you to understand the selection sorting algorithm

SelectionSortVisualization (If you have any comments or suggestion, please conta

Berkay IPEK 3 Feb 17, 2022
AutoPilot is a game where the player controls a car and tries to get the highest score he can while not dying under falling cement blocks.

AutoPilot AutoPilot is a game where the player controls a car and tries to get the highest score he can while not dying under falling cement blocks. C

Enoc Mena 1 Nov 17, 2021
Racers-API - a game where you have to go around racing with your car, earning money

Racers-API About Racers API is a game where you have to go around racing with yo

null 3 Jan 9, 2022
A Gomoku game GUI using pygame where the user can choose to play against another player or an AI using minimax with alpha-beta pruning

Gomoku A GUI based Gomoku game using pygame where the user can choose to play against another player or an AI using minimax with alpha-beta pruning. R

Mingyu Liu 1 Oct 30, 2021
This is a simple game made using pygame.

Ball breaker This is a simple game made using pygame game view The game view have been updated wait for the new view to be uploaded Game_show.mp4 Lear

Rishikesh Kumar 3 Nov 5, 2021