Home!
About
 
 
Computer Plays Capture the Flag with Evolution
 Date: November 18, 2020 → December 12, 2020
 Type: Personal Project, Machine Learning and Computer Science
 
Basic Explanation  

Basic computer evolution is an almost direct simulation of the evolution that exists among real biological species. I wanted to apply this process for learning the optimal way to win a game so I wrote some software for a computer to play capture the flag.

The rules of this game are simple, each team is made up of 5 people. Their goal is to get to the other side and touch the opponents flag. If a player is on the opponent's turf, they can be tagged and taken out of the game, that is what the grayed-out blocks mean. The game ends when the time runs out (about 5 seconds) or the player reaches the opponent's flag.

What you will notice below is that there is a massive explosion of players once the game starts. This is because we are simulating every single game at the same time just to save time. Each player can still only see their 5 teamates and their 5 opponent's teamates.

Web Version

This algorithm take hours if not days before the computer gets incredibly intelligent, but below is a video taken after 24 hours of continuous training. It looks like a lot at first but the computer has learned both defense techniques, such as the red team crowding the door waiting for blue to arrive, as well as techniques to get to the other side and dodge their opponents.