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/

Owner
Henri
German high school student interested in Machine Learning :)
Henri
A simple script which allows you to see how much GEXP you earned for playing in the last Minecraft Hypixel server session

Project Landscape A simple script which allows you to see how much GEXP you earned for playing in the Minecraft Server Hypixel Usage Install python 3.

Vincenzo Deluca 4 Dec 18, 2021
AXI Combat is a networked multiplayer game built on the AXI Visualizer 3D engine.

AXI_Combat AXI Combat is a networked multiplayer game built on the AXI Visualizer 3D engine. https://axi.x10.mx/Combat AXI Combat is released under th

. 0 Aug 02, 2022
A networking library for multiplayer games.

Aerics A networking library for multiplayer games. Getting Started Install Python Open cmd/terminal and type: pip install Aerics Examples Creating a

Yusuf Rençber 3 Jan 04, 2023
游戏中按TAB键查看所有玩家分数的小程序

DDNet-show-points-in-game DDRaceNetwork 游戏中按TAB键查看所有玩家分数的小程序

3 Oct 13, 2022
Basic Python physics library.

pythonPhysics Basic Python physics library. Must have pygame installed. How to: Sketon program is included. for p in env.particles: pygame.draw.circle

1 Jan 16, 2022
Wordle - Wordle Clone With Python

Wordle Clone Python This is a cli clone of the famous wordle game developed by J

Shivam Pandya 20 Jul 07, 2022
This is game 2048 created with moudle of python tkinter and OOP.

Game 2048 This is game 2048 created with moudle of python tkinter and OOP. This game build on classes. For start this game run: If you have python ver

0 Nov 02, 2021
Quantum version of the classical Nim game. An automatic opponent allows to game to not be as easy as it seems.

Nim game Running the game To run the program just launch : python3 game.py Rules This game is inspiring from the Nim game. You are 2 players face to f

Michaël 1 Jan 08, 2022
j-chess implementation in python

j-chess-client-python This repository aims to be a starting point for implementing a chess ai for the j-chess-server in python. To start, you can copy

Jonas 1 Dec 25, 2021
An ongoing process to make a physics engine using python.

Simple_Physics_Engine An ongoing process to make a physics engine using python. I am using this goal as a way to learn python in and out. I am trying

Jon Sherrick 1 Jan 18, 2022
A Tetris Game for programming education

Tetris Game プログラミング学習を目的とした、ブロックを操作してスコアを競うゲームです。 FAQはこちら。 tutorialはこちら。 実行環境準備 Mac環境 Finder→Application→Utility→Terminalから、ターミナルを起動して以下コマンドを実行する。 # i

11 Dec 01, 2022
A little python script for finding the best word choice in a Wordle game

A little python script for finding the best word choice in a Wordle game, by assuming that at each step you want to minimise the average number of possible answers left after guessing that word (note

zeb 26 Mar 16, 2022
An old time game Tic-Tac-toe

A Tic Tac Toe Bot This is the code repository for my article on Medium - Playing Games with Python - Tic Tac Toe, where I have tried to take the famou

Jigyanshu 0 Feb 25, 2022
This is a simple rock paper scissor game created with python.

This is a simple rock paper scissor game created with python.

Fayas Noushad 3 Feb 04, 2022
Discord based board game, Sneks and Ladders

sneks-and-ladders Discord based board game, Sneks and Ladders intro This is the code-base for the Discord based game, Sneks and Ladders, as used for s

Yohei Nakajima 3 Nov 04, 2022
Yo-Snake - A blend of yolov5 and deepsnake

Yo-Snake A blend of yolov5 and deepsnake 结合了yolov5和Deepsnake模型 Deepsnake 模型代码比较复

7 Apr 01, 2022
Flappy Bird clone utilizing facial recognition to move the

Flappy Face Flappy Bird clone utilizing facial recognition to move the "bird" How it works Flappy Face uses Facial Recognition to detect your face's p

Brady McDermott 1 Jan 11, 2022
Hexagon game. Two players: AI and User. Implemented using Alpha-Beta pruning to find optimal solution for agent.

Hexagon game. Two players: AI and User. Implemented using Alpha-Beta pruning to find optimal solution for agent.

Anton 1 Oct 18, 2021
Nerdle - a nerd's approach to solving Wordle

Nerdle - a nerd's approach to solving Wordle

4 Nov 28, 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 08, 2022