During a final year module at University I was tasked with an assignment to add AI and networking capabilites to a simple domination-style game written by a lecturer.

The AI portion of this assignment involved writing an state machine based AI using the state design pattern that could beat the other team (that used a simple AI written by the lecturer). This involved first building a state machine that would allow states to be easily switched between and then writing the individual states and identifying and implementing the conditions under which they would be switched between.

I chose to implement my AI with a play style in which it would capture and hold 2/3 points in order to score more points than the opponent rather than aiming to capture all 3 points as this is how I personally play domination style game modes. I was able to properly implement this strategy with a high win percentage. The video above shows the game playing out, my AI is written for the Red team.

I also wrote A* pathfinding for the bots and a node system.

The networking portion of this assignment involved being able to set one computer up as a server that would play out the game while setting up other computers as clients that would spectate it. The client computers would be able to move the camera and zoom in and out.

I achieved this by connecting the server and clients using a TCP socket. The server would regularly send out all the data necessary to display the game in its current state and the clients would use that data to update what was happening on screen.

A selection of code from the AI and network can be located here.

  • Using C++