Networked RTS Pirate Game

About

A networked Real-Time-Strategy (RTS) game using the Unity Engine and the Photon 2 Networking Library. Up to 4 players can build their pirate village and conquer the surrounding islands in attempt to either win 1 of 3 victory conditions: Money, Wonder, Elimination. It using Rooms and Lobbies to connect players during matchmaking and to setup map conditions.

Systems

I have implemented many systems in this game the core one being the networking, but this connects with plenty of the other systems.

Drag Selection
Drag across the screen to form a box which then casts 4 rays to the terrain and then creates a custom collision box (trapezium shape to the floor from camera space) and selects all owned player units that are within the custom collider.

Resource Gathering/Resource Manager

Resource manager holds a list of actively gathering unit scripts and displays the gather rate per 30/secs within the UI resource box. This also handles whether player can buy certain items or not. If the player tries to buy something it will blink red 3 times with the resources they are short and play an audio cue.

Placing Buildings

A building placement system which casts rays and checks tags of surrounding terrain checking if building can be placed, it also checks if building is colliding with other objects/terrain. Some certain buildings can only be placed once inside the city radius, for example the market, as it generates 10 gold can be placed once per city.

UI

The UI has 3 build menus and when you hover each item will display the cost and explains its uses.

Their is also a mini map which shows discovered terrain, its a simple 2d camera placed above the map and black hexagon tiles placed above the terrain.

A pop down menu with hints and tips on how to play the game which can be disabled for experienced players. It implements a queue system for messages so none overlap.

Audio Manager

The audio manager implements scriptable objects and sound banks which makes it easier to add new sounds and adjust specific sounds depending on use case. e.g. 2d or 3d space, volume, audio mixers so in-game volume can be separate from music and ui sounds.

Source Code