Holocity is an augmented reality, city simulation game for the Microsoft Hololens. It was developed over a space of 7 months in a team of 5. The team consisted of 2 programmers and three artists.
Game Outline
Holocity is a city simulation game similar to games like SimCity and Cities: Skylines where the aim is to build and mange a city by keeping residents and businesses happy. It runs using the Unity game engine v2018.2.8.
Holocity allows the player to purchase and place buildings on a 3D grid that exists in 3D space using AR. This can be interacted with via Hololens gestures. Once buildings are placed they can perform tasks such as letting Residents move in, providing resources for buildings to consume and create jobs. These form the basis of the economy.
The game contains 3 time periods which change what buildings exist and how they look visually. All gameplay elements remain the same.
What i worked on
During the development of Holocity, I worked on backend mechanics. These provided the resource sharing, resident and job features.
Tick management and Threading
To perform the simulation updates a tick system was produced to consistently update objects that require it in a cycle. This system was also designed to utilize threading to maintain high performance and good framerates while the game is running.
A tick manager was created to tick all objects added to it of type ITickable. The tick rate was set to every 100ms and this ran on a seperate thread to the main Unity thread
Resident and Job updates are managed using the tick management system. Resource sharing also uses this.
Resources
Holocity contains 2 major resources that most buildings require to operate, Electricity and Water. These resources are produced by certain buildings each tick. Other buildings may consume resources per tick if they have access to any.
Resource Sharing
For buildings to use a resource they first need access to it. Buildings only have access to a resource if they are adjacent to the provider or have a direct connection via other buildings or roads. This means that resources are shared via direct connections.
This system automatically updates and shares resources between buildings. If a building is destroyed then A* is used by adjacent buildings to check if they can still access their resources. This avoids rebuilding the entire resource network.
Buildings
Buildings are a major part of a city simulation and for Holocity this is no different.
Holocity contains many buildings which slightly differ depending on the time period. Most buildings are the same throughout each time period. These are generic businessess that would provide jobs such as a shop or bank. Additionally there are resource providing buildings: Water plant and Power plant. These provide electricity (fire in medieval times) and water. These are named and themed to fit the time period.