Attempting to use Evolutionary computation to create interesting combat in video games
  • Rust 75.1%
  • Python 16.2%
  • C++ 5.3%
  • C# 2.4%
  • Dockerfile 0.6%
  • Other 0.3%
Find a file
Jacob VanDomelen d68ccc4e98
Adding images
2026-04-16 12:35:22 -07:00
ai_fighter Getting linux export working 2025-09-10 16:40:21 -07:00
evolved-npcs Removing warning logs 2025-09-12 12:04:46 -07:00
extract_fann_data Migrating files over and getting a working build 2025-09-05 13:51:16 -07:00
fann-builder Granting builder permissions to output folder 2025-09-19 11:49:33 -07:00
images Adding images 2026-04-16 12:35:22 -07:00
.gitattributes Adding unreal engine project 2025-09-08 22:59:59 -07:00
.gitignore Adding images 2026-04-16 12:35:22 -07:00
analyze_data.py Migrating files over and getting a working build 2025-09-05 13:51:16 -07:00
docker-compose.yml Adding docker files and adjusting path 2025-09-11 11:45:11 -07:00
Dockerfile Final adjustments for simulations 2025-09-12 12:02:09 -07:00
LICENSE Initial commit 2025-09-05 12:14:40 -07:00
parameter_analysis.py Migrating files over and getting a working build 2025-09-05 13:51:16 -07:00
README.md Update README.md 2026-04-16 12:25:16 -07:00
visualize_networks.py Formatting code 2025-09-07 22:08:20 -07:00
visualize_simulation_tree.py Migrating files over and getting a working build 2025-09-05 13:51:16 -07:00

EvolvedNPCs

Using Evolutionary Computation to create engaging AI's for video games. Currently the project is still an early proof of concept with phase 1 just demonstrating the feasibility of gradual improvement purely by genetic algorithms, but it has laid the groundwork for what's to come.

Simply put, the program creates a completely random population of neural networks that drive the behavior of these NPCs. The effectiveness of each individual is evaluated by simulating 1v1 combats against other individuals and scoring them based on their performance. The best performing individuals remain while poor porforming individuals are removed. We then replace the individuals who were removed by crossbreeding the good performing individuals and mutating the offpsring.

Demo

Watch the video

This video shows an example of two evolved NPCs fighting against each other using only 50 neurons. And this example is missing the most powerful learning technique that will be implemented, reinforcement learning. The behavior is purely emerging from random mutations, and crossbreeding in the neural networks.

Visualizations

The following image shows how the size of the networks changed overtime. It begins with a wide array of network sizes early on at the bottom, but a beneficial mutation occurred in a population on the lower end and we see that population thrive.

A chart that shows how neural network size changes overtime.

A beneficial mutation happened within this population and over the next couple of generations it makes up a majority of the population.

A chart showing a dramatic increase in score after a beneficial mutation occurs.

Here's an example of one of the neural networks of a well performing individual, with positive weights in green and negative weights in red. Here we see some inputs have a substantial effect on the score and are reinforced as a result. In this case, the inputs control how far the camera is from the opponent.

A diagram showing a neural network graph with connections between nodes.