Skip to content

Scene structure of locations

Ciro Continisio edited this page Jul 29, 2021 · 8 revisions

We have recurring elements in all location scenes, divided into categories by empty separator GameObjects.

[TODO: ADD HIERARCHY PIC]

Table of Contents

Manager prefabs

In this category we have some prefabs that act as global managers, who are generally necessary to play the game, and only exist in one copy. Many of these managers are waiting for an event (see Event System) called OnSceneReady to start. This event is fired by the SceneLoader script present in the scene PersistentManagers, once a location is fully loaded.

Editor initialiser
A "hack" script that takes care of initialising the scene and the game when pressing Play from the editor (something that we call "cold startup"), as if the player came through the main menu in a normal gameplay flow. This script is totally useless in the build, and in fact it is stripped from it thanks to being tagged as EditorOnly.

Spawn system
Takes care of spawning the player when the event OnSceneReady is fired. It uses the last path taken in the PathTakenSO Scriptable Object to determine in which of the many location entrances to spawn the player Prefab (see Scene entrance and exit below).

Camera system Contains the Camera (as in, the actual Camera component) and also the Cinemachine FreeLook Virtual Camera (VCam) that acts as the main gameplay VCam. Since this VCam needs to frame the player Prefab but this is not instantiated at the beginning of the game, the Camera System script listens to an event called PlayerInstantiated which notifies it and also carries information on the Transform to frame.

It also acts as a proxy to propagate shake events, receiving the impulse on the CameraShake event channel coming mainly from combat actions in the State machine of the characters.

Music player
Fires an event on an AudioCueEventChannel to notify the AudioManager script (located in the PersistentManagers scene, which is loaded at the same time at runtime) to play the music associated to the current location.

Home
Video materials

Basics

World building and Graphics

Game architecture

The game systems explained, with API examples. For programmers.

Game design

How-tos for designers to expand the game's gameplay.

  • Adding quests
  • Adding items
  • Creating dialogues
  • Making a cutscene
Clone this wiki locally