Inspiration

We are all part of Air Force ROTC, and through one of our groups we all came together as Computer Science students and decided to create a Hack K-State team. We settled on a Unity game incorporating Machine Learning, as that was a good mixture of enough pre-knowledge across the whole team, but leaving plenty of growing room for every individual on the team.

What it does

The AI was trained using Unity's built-in machine learning software, and is trained to fight against the player while trying to avoid being hit.

How we built it

We first created the base game and got basic character controls to work. Once the basic controls were set, shooting was an option, and the various AI controls were implemented, we allowed the AI ~7 hours to train and gain fitness.

Challenges we ran into

We originally wanted to work with a neural network known as NEAT, but it was difficult to incorporate into Unity. So instead, we decided to work with the built-in neural network included with Unity, but this caused an issue that it would not save the network's progress using checkpoints. This caused an issue when we were sleeping when the network's fitness started to decline, and we were not able to recover the progress at the highest peak fitness. Close to the end, the AI found out a way to exploit a mistake in the fitness evaluation function and gain lots of fitness with bad fighting strategy. This made it much worse when fighting human players. Should we have had more time, we would have solved this issue by making enemy gain in fitness directly proportional to self loss in fitness.

Accomplishments that we're proud of

The artwork looks good, we have had a large increase in knowledge of Blender, music creation software (GarageBand and brief tinkering on online tools), using Unity for game creation, creating a base-line AI that was able to successfully complete simple tasks (such as moving to a specified location, or destroying an in place target), and working with the machine learning software to implement a more complex AI.

What we learned

We learned that a shooter may not be the best game to implement machine learning, as once we started implementing it we realized that it was being fed some pretty complex input. If we were to re-do this project, we would likely spend more time on figuring out how to simplify inputs to the AI, as well as creating a game outside of the AI to create a more fun experience for the end user. Additionally, two of us had never used Unity before and three of us had never used machine learning before. This project greatly increased all of our skills in both of those areas. Meshing our skillsets together like this made learning even better as those who had experience were able to guide those without it to learn more than if we all started from scratch.

What's next for The Pit

We likely won't be continuing specifically with The Pit, however we already have plans as a team to get into game creation over winter break, potentially even working on putting something out onto an app store or otherwise.

Built With

Share this project:

Updates