Free HTML5 Bootstrap Template by FreeHTML5.co

CS 491 - Project 3

Introduction

Introduction

For 3rd project of CS-491, we decided to work on an Augmented Reality game which is engaging and is based on the collaborative experience design principles. While deciding for the project, we wanted to create something that is popular and something that non tech savvy people can also use. Keeping that in mind, we decided to create battle royale themed tank fighting game. This game is inspired by the combination of a legacy game titled Battle City and the theme of battle royale of popular multi player game PlayersUnkown's Battleground. Owing to its design, this game provides the nostalgic experience of a game which we grew up playing in a modern game design. Since this is based on arcade styled game, most of the users would be able to understand its controls and play it with ease

What is this game about ?

As mentioned earlier, this game is inspired from Battle City, each player will be assigned a tank. The motive of the game is to kill opponent tanks.Each player will start with 3 lives and every time the player dies, the number of lives decrease. When the number of lives are exhausted the player dies and can now spectate the game. The last man standing will be declared the winner. The game will spawn many power ups which when collected by a player will provide some advantages. Also, there are different kinds of obstacles in the game which will have impact on the tactical approach to the game.

Game features

Following are the key features of the game:

  • iOS only
  • Immersive Experience using Augmented Reality
  • AdHoc multiplayer experience using MultiPeer Framework
  • Supports 2-4 players
  • 4 different Arenas

For a detailed demo see below:

Game Guide

How to install the game

To install this game, download the game source code from here. Unzip the file and open the project in xCode. Make sure you have Apple developer account. If you do not have the account then you will need to create one. After loading the code into the system, attach your iOS device where you want to install the game. Click on run button and the game will be installed on your iOS device. Repeat the process for other devices as well. You might need to change the application identifier to install the game.

How to start the game?

When you start the game, game room screen will pop-up containing the list of players in your room and the players who are available for playing. Please see below a screenshot.

Game room screen

When you click on available players, the player will be added to your room and will disappear from the list of available players. When you have more than 1 player in your game room, you can move to next screen by clicking on start game button. The next screen is the level selection screen. The game offers 4 different arenas to choose from. The user can click on the desired arena to start playing the game. Please see the screen shot below for the level selection screen.

Level Selection Screen

After clicking on the start play button the game will take you to camera feed of your phone. If it is first time when you are playing the game, the game will ask for access to the camera. After that, you need to find a horizontal surface to play the game. Make sure that there is enough light on the area as the surface detection does not really work well with poor lighting. When the phone detects a surface, it shows a blue colored grid to highlight it.

Surface detection

If you do not want to play on that surface, just change your position and the game will detect a different horizontal surface and will show a overlay at that surface. When you are ready with the surface to play with, just tap on the blue overlay and system will start to set up the game.A message will appear stating waiting for other players to join the game.

Player wait screen

When the surface is selected, the other players will also need to point the camera at the surface where the game is supposed to be played. The other players might need to move a little bit as the shared surface detection algorithm is not robust enough to handle vast changes in the position of player. When the appropriate surface is detected by all the players, the game will start. This is the part where you need to take care of the feature extraction. Try to point the camera in the same angle as per the original host camera. For improved results, you can use a printed sheet of paper with contrasting features so as to make the computations easy for the framework and get quick results.

Gameplay

Tank identification

When the game is started, the players will see an arena with differently colored tanks depending on the number of players the players playing the game. The layout of the arena will vary depending on the arena selected during setting up of the game. There will be a circular white marker on the player's tank to identify the tank. Please see the screen shot below:

Game start screen

Controls

To control your tank, the system provides buttons whose functions are as follows:

  • Forward: On pressing this button, the tank starts moving forward. If the button is kept pressed the tank will keep on moving. On unpressing the button the tank will stop.
  • Rotate Left: On tapping this button, the tank will rotate left by 90 degrees.
  • Rotate Right: On tapping this button, the tank will rotate right by 90 degrees.
  • Backward: On pressing this button, the tank starts moving backward without changing its direction. If the button is kept pressed the tank will keep on moving. On unpressing the button the tank will stop
  • Shoot: On tap of this button, the tan will shoot a bullet in the direction of the face of the tank. The user will need to tap this button multiple times to shoot multiple bullets
The player movement, bullet speed and the bullet abilities will change based on the power ups collected by the player over the course of the game. Also, the player tank will not be allowed to move beyond the arena walls.

Terrain

There are 3 different types of terrains that game uses:

  • Brick Walls: The brick walls are red in color and are brittle. On shooting them, they are destroyed. The players are not allowed to pass through the brick wall.
  • Steel Wall: The steel wall are gray in color and are strong. The tank bullets are not able to destroy them unless the player has accumulated enough number of star power ups.
  • Grass: Grass is camouflaging environement to add tactical advantage to the player using it. When the player is in grass environment, other players cannot see the tank. The bullets pass through the grass environment and hence can be used to ambush.

Brick Wall

Steel Wall

Grass

Power ups

The game spawns 1 of 5 different power ups randomly at different locations after in game designed set of time. Following is the list of power-ups and their abilities:

  • Cross: This power up provides a bonus life to the player who collected this powerup.
  • Bolt: This power up increases the speed of the tank for a limited time.
  • Shield: This power up makes the tank invulnerable to any damage. Also, a spherical particle effect will appear on the tank signifying that the tank has collected the given power-up
  • Grenade: On click of this power up 5 bullets will be fired from randomly selected locations which can damage other walls and players
  • Star: This power up increases the rank of the tank. The rank of the tank defines the tanks speed and bullet patterns. Also, when a tank is shot, its rank is decreased. When the rank of tank goes less than one, only then the player loses the life. The description of the ranks of the tank is as follows:
    1. Rank 1: This is the base rank of the tank. Every player starts the game with rank 1. Getting shot at rank 1 will make the player lose its life.
    2. Rank 2: At rank 2, the tank will have faster bullets and faster speed. Getting shot at rank 2 will reduce the rank of tank to rank 1
    3. Rank 3: At rank 3, the tank will shoot two bullet at a time/ Getting shot at rank 3 will reduce the rank of the tank to level 2
    4. Rank 4: At rank 4, the tank bullets can now destory steel walls. Getting shot at rank 3 will reduce the rank of the tank to level 2.

Star

Bolt

Grenade

Shield

Cross

Technical Discussion

Challenges faced

Creating a multiplayer augmented reality game is a daunting task. We faced numerous challenges while developing the game. We would like to highlight few of those challenges that we believe every game developer will face while creating a game which supports shared state capability:

  • The first challenge that we faced was to make sure that each player is pointing towards same point to start playing the game. To elaborate more, the initial euler angles of each player in each of the device had to be same.
  • The second biggest challenge for us was to make sure that network latency does not put the game state out of sync across different players. So, we had to implement a lot of modular designs to create a consistent experience across all the devices
  • We also faced the challenge of managing the device performance. the game does utilise lots of animations and particle effects. We had to make sure that this does not result in device freezing up or act very slowly

Key features implemented to make sure that game works well

To make sure that game does well, we had to take certain game architecture design decisions which in our opinion would work great. Following are the features that deserve a mention :

  • To make sure that every player is looking at the same point, we shared the world coordinate system across all the players. Also, we made sure that there is only one anchor being tracked by the system so that everyone knows at which horizontal plane the system should show the game.
  • When thinking about the networking architecture, we could have employed master slave relationship between the players where the most of the work is done by the host and rest of the players receiving the result of the processing done by the host. However, this would have resulted in the large network latency. So we chose to use the multi peer connectivity architecture where all the players send their movements to the other players and then each system simulating those movements at their end.
  • To make sure consistency in game state, we periodically send crucial game state information from each user to other users so that they can update that players data accordingly.
  • To make sure that there is not much load on the bandwidth of the network, we also implemented the event based message system. For example, if a bullet if fired by one of the players then an event of firing a bullet is sent to all the peers and the interactions of that bullet with all the entities are handled respectively in all the devices.
  • Since, there has to be a consistent state across all the devices, we chose not to use the physics based system to get more control over the player movements. However, for bullet system we did utilise physics based approach as we do not really need to track the movements of the bullets but their end state.

Assets and resources

Tank

Link

Star

Link

Flash

Link

Bomb

Link

Wall texture

Link

Steel Texture

Link

Shield (Handmade)

Link

Health Sign(Handmade)

Link

Grass 3d model(Handmade)

Link

Sound Effects

Shoot sound effect

Link

Fire sound effect

Link

Grenade sound effect

Link

Player die sound effect

Link

Bullet Destory sound effect

Link

Extra Life sound effect

Link

Power up spawn sound effect

Link

Shield power up sound effect

Link

Speed up power up sound effect

Link

Star Collection powerup sound effect

Link

Wall destroy sound effect

Link

Learning and Insights

Since, the duration of the project was small(1 month), there is a lot of room for improvement. Given that we have enough amount of time and resources, we could have done things a lot differently and made this small project into a complete app store publishable game. Here are the following things that we plan to integrate into the game in the future:

  1. Bug removal: We took utmost care to design our system consistently. But like every complicated system, we might have missed some boundary cases and there might be bugs in the systems. For example, there are definitely a few areas where ensuring thread safe environment will make the game even more stable.
  2. Joystick type control system: Right now, there are only 4 buttons to control the player there by giving it the grid like playing experience. In future we can add joystick type controller where the tank can move in 360 degrees depending on the where the player is standing with respect to the game board.
  3. Reduce network latency: We can reduce network latency by designing a specialised optimised messaging structure which will reduce the data load across the network while sending messages.
  4. More power ups: We have chosen a set of power ups from the original game which we thought would make the game intersting. However, we can borrow game play elements from other games as well and implement those.
  5. Co-op mode: For now, 4 players are playing against each other. In future we can implement a team of 2 players and thereby adding another dimension to the game play. Multipeer networking supports limit of 8 players. Hence at a single time, 4 teams can play against each other.
  6. Newer arenas: So far, we have implemented only 4 arenas. We can add newer arenas with strategic designs to improve the tactical thikning among the players