Multiplayer Test

Engine | Unity

A screenshot of the project with a single player in the game.

This test game is an adaptation of a small college project I created in my sophomore year. The original concept was a test to try and create a FPS game with 2 different types of Artificial Intelligence. The project was later modified to add multiplayer using Photon Networking.


How To Play

I was able to set up the game, so that players can give themselves a name, then either host or join a room. When the room’s host starts the game, the users are put into a 5-minute game. A player can win the game by either having the most points when time runs out, or by reaching 75 points the fastest. Players cannot destroy each other, but can be destroyed by the enemies.


Artificial Intelligence

The original purpose for this game was to test out different types of AI. My idea was to make one type of AI that would patrol an area, like Metal Gear Solid or Payday. The other AI type I made would constantly chase the player, like in Call of Duty: Zombies
Other than the way the enemy would target the player, both variations would have the same basic process:

  • Enemies have a set HP, with a health bar above showing how much is left
  • Enemies would move towards the player, as long as the enemy could see the player
  • When the Enemies reach the player, the enemy deals damage to the player, and gets destroyed
  • When the player destroys an enemy, the player is awarded with a point

Seeing as I wanted both AI types to preform the same core mechanics, both enemies run off of the same code base. A boolean toggle determines if the enemy would patrol or chase.


Online Multiplayer

Adding multiplayer functionality was troublesome for a multitude of reasons, besides the fact that it was my first attempt at any type of networking. When I decided that I wanted to adapt this project, it was about 2 years after I already finished this creation. Because I didn’t think I would ever go back to this assignment, I didn’t write much (if any) comments into the code. I had to relearn what I programed before I made any alterations.

Another complications that arose during the modification was learning the Photon SKD. The game was originally single player, so I had to figure out how to send and receive data to each player and the server. The Photon SDK is extremely useful, has good documentation and active forums, allowing me to:

  • Have 20 concurrent users for free in Photon’s Cloud networking
  • Send data to and from users, enemies, or the game manager itself
  • Track player score and update it onto room centric statistics