- Rust 75.1%
- Python 16.2%
- C++ 5.3%
- C# 2.4%
- Dockerfile 0.6%
- Other 0.3%
| ai_fighter | ||
| evolved-npcs | ||
| extract_fann_data | ||
| fann-builder | ||
| images | ||
| .gitattributes | ||
| .gitignore | ||
| analyze_data.py | ||
| docker-compose.yml | ||
| Dockerfile | ||
| LICENSE | ||
| parameter_analysis.py | ||
| README.md | ||
| visualize_networks.py | ||
| visualize_simulation_tree.py | ||
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
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 beneficial mutation happened within this population and over the next couple of generations it makes up a majority of the population.
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.



