About
This is a project to teach myself the basics of machine learning with ml5's NeuralNetwork class. It's based on the work I did on tactical pathfinding in games for my Master's thesis (PDF link).
The general thrust of my thesis was examining if AI units could perform better in a team deathmatch scenario by taking into account various factors when finding a path:
- Number of allied deaths near each position;
- Number of reported enemies near each position;
- Exposure (i.e. is this right out in the middle of an open field or next to a wall).
This happened before Unity made pathfinding available to free users, so I had to write my own based off a tutorial from the UnityGems website. The main difference between this and regular A* is that each node also contained the number of deaths for each team, the number of reported sightings, and an exposure weighting (i.e. distance to the nearest wall). One team (Orange) would be configured to use these weightings, while the other (Blue) stuck with A*.
The deathmatches were 20 minutes long, and grouped into tournaments of 20 matches. For the sake of testing, the weights used for the above factors were either 1 or 0, but there's nothing to say they can't be larger.
Control results
The maps I tested on were built by myself in Unity, and one was horrifically unbalanced, as indicated by the results below. I ended using the "Hybrid" map to provide the statistics for the neural network because overall, it seemed to be the most balanced.
Team | Data | Maze | Field | Hybrid |
---|---|---|---|---|
Blue | Total Kills | 2396 | 2211 | 2556 |
Average | 119.8 | 110.55 | 127.8 | |
Maximum | 138 | 126 | 156 | |
Minimum | 107 | 96 | 111 | |
Orange | Total Kills | 1675 | 2142 | 2546 |
Average | 119.8 | 110.55 | 127.8 | |
Maximum | 93 | 115 | 146 | |
Minimum | 72 | 93 | 106 |
So how does this work?
The neural network is trained against the weightings and scores for each match on the Hybrid map. Once it's ready, you can enter your own values and see how it should affect the Orange team's performance.
TODO: dig up the executable I made for it and attach for verification.