Skip to content
Basic genetic algorithm designed to learn to beat a basic AI opponent.
C++
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
AIGen.cpp
AIGen.hpp
README.md
main.cpp
map.cpp
map.hpp
player.cpp
player.hpp
turnResolver.cpp
turnResolver.hpp

README.md

GeneticSoldiers

An experiment in basic genetic algorithims.

This project will run two AI units against each other in a basic game. The game consists of 3 moves: Move towards enemy, Shoot, and Melee. The first AI is created with a basic if/else decision making process. If can attack: then attack; else move closer. Second, an generation of AI based on a genome is created with random mutations introduced. All of these bred AIs are run against the basic one and the 2 with the highest score are bred to create the next generation's base genome. As the program progresses, the bred AI will approach a 100% victory rate against the basic AI.

Building

run

 g++ -std=c++11 *.cpp -o main

execute

./main
You can’t perform that action at this time.