Game Core

Gameplay Mode

Main script that controls gameplay and evaluates win conditions. Part of the GameplayMode is the processing of player kill/death and writing to player’s statistics.

Deathmatch

Most basic gameplay mode with standard deathmatch functionality.

Back To Top

Elimination

Players have a limited number of lives. The last player standing wins. This gameplay mode features a Shrinking Area that reduces the available map space over time.

Shrinking Area
Shrinking Area in the Elimination gameplay mode

Back To Top

Battle Royale

Players start in the airplane that circles around the shrinking area. After the drop starts, the plane enters the active map area, and players can drop and land with their jetpacks. Players have only one life, the last man standing wins.

While in the airplane, the player's input is processed by the AirplaneAgent.

Battle Royale Airplane

Note: The server can control when the drop will start by either starting the drop right away or prolonging the automatic start countdown.

Back To Top

Shrinking Area

Shrinking Area is a circular area that shrinks over time and damages players outside of this area. Shrinking happens in multiple steps. Before every step a warning and a remaining time is displayed in the UI. The time between shrinking steps is based on active players - the less alive players, the faster the area shrinks.

Announcements

Shrinking Area is enabled in the Battle Royale and Elimination modes.

Back To Top

Announcer

The Announcer system is a simple system that informs players about in-game events such as multi-kills, remaining time, remaining players, and more. Every gameplay mode can define a different set of announcements that are being evaluated and presented to the player.

Announcements
Announcements in the Battle Royale gameplay mode

An Announcement is a scriptable object defining an in-game event. Every announcement object has custom evaluation logic and contains what message or audio clip should be presented to the player once triggered. Announcements can have different priorities and can be played in specific channels. When two announcements in the same channel are triggered at once, only the one with higher priority is presented. This ensures that for example only the Triple Kill announcement is shown even though both Double Kill and Triple Kill announcements were activated.

Back To Top

Level Generation

Since creating meaningful levels for 200 players is time-consuming, we opted for generating levels semi-procedurally by code.

GenArea 7
GenArea 7 scene contains seven colored areas

Every level is generated based on runtime specified parameters when the server loads the scene. Some randomness is involved in the generation process, so every run is different.

Scenes GenArea2 - GenArea 7 differ only in the parameter setup located on the Gameplay/NetworkGame gameobject.

GenArea7 Generation
Values used for GenArea 7 generation

The level generation specifics are out of this documentation's scope, but in a nutshell, the level is divided into areas (colored sections). Every area is constructed from blocks (premade prefabs), and blocks are connected with connectors (premade prefabs - ramps, a pile of boxes). The center of each area is defined by a special tower block. The values controlling the generation can be found in the LevelGenerator script.

Level Generator
Level Generator inspector

Every block can define possible player spawn positions and positions of the item boxes. Item boxes are spawned into the level as part of the generation process.

Back To Top

NetworkGame

NetworkGame handles joining and leaving of connected players and spawns a Player prefab for each client. Disconnected players are saved, so their data can be recovered in case of a reconnect. NetworkGame spawns GameplayMode during the initialization process.

Back To Top

Scene & SceneContext

Scene handles scene-specific functionality and services (SceneService) such as UI, camera, music, minimap, and others. Scene services are updated manually from the Scene, so that they can be initialized, activated, deactivated, and updated at any time.

SceneContext provides safe access to common services or other information that is needed across the codebase without using statics. Scene context is automatically passed to scene services and assigned to networked objects in Gameplay and NetworkObjectPool. Inheritance from ContextBehaviour and ContextSimulationBehaviour instead of NetworkBehaviour and SimulationBehaviour is needed for access to the SceneContext.

Back To Top

Game Core

The following image illustrates the application loop:

Application Loop
Application loop

The following diagram shows the lifespan of core game scripts:

Game Core
Lifespan of core game scripts

To Document Top