Overview
The FPS Template divides application scripts into 3 main layers:
- Game: script instances living as long as the application is running;
- Scene: script instances living only within a single scene; and,
- Simulation: script instances related to a single Quantum simulation.
This separation can be clearly seen in the Main Unity Classes section.
Main Unity Classes
Game
: the main entry point and is responsible for initialization, deinitialization and ticking.Game Services
: holds references to global services (single instance, always available)Log
: Custom loggingSceneDirector
: responsible for initialization, deinitialization and ticking of scene objects, holds references to scene servicesGameplayDirector
: Inherited from Scene Director, holds reference to Simulation Context and reacts to events from simulationSimulationContext
: Holds data relevant to a single simulation, holds references to simulation context servicesGameplay Info
: Contains all information needed to run single simulationEntity
: Represents Unity counterpart for a specific Quantum entity, holds mandatory data about entity, manage transform synchronization, holds references to entity components and manage their tickingEntityComponent
: Represents Unity counterpart for a specific Quantum component, or Unity-only componentRegister
: Contains cached properties which are frequently used on Unity side
Game Services
Analyzer
: Game service for performance recording and analysisNetwork
: Game service maintaining the connection to Photon RealtimeMessages
: Game service maintaining the connection to Photon ChatParty
: Game service for party management (requireMessages
)Lobby
: Game service for connection to custom lobby (requireMessages
)Matchmaking
: Game service to find match and maintain connection to the room (requiresNetwork
andMessages
)RemoteSettings
: Game service for Unity Remote ConfigSceneLoader
: Game service for scene loading
Scene Services
SceneInput
: Scene service for polling input from devices and sending to simulationSceneCamera
: Scene service for camera managementSceneUI
: Scene service for UI managementSceneAudio
: Scene service for Audio managementSceneMatchmaking
: Scene service to run specific matchmaking processSceneCache
: Scene service for caching objects
Simulation Context Services
Simulator
: Simulation context service which ticks Quantum simulationEvents
: Simulation context service for registering/unregistering to Quantum eventsCallbacks
: Simulation context service for registering/unregistering to Quantum callbacksEntities
: Simulation context service for Quantum ⇔ Unity entities synchronization, is responsible for Entity initialization, deinitialization and tickingReplay
: Simulation context service which maintains replay simulations based on the main simulationRegister
: Simulation context service which contains information about local player, caches frequently accessed references (entities / components) and sets prediction area
View Architecture Diagram
Main Quantum Classes
The Main Quantum Classes are all part of the simulation layer.
Generic Quantum
The following sections cover the main classes from the generic Quantum SDK used in the FPS Template.
Data Structures
Globals
: Holds state data for global data structuresMap
: Contains baked map data and reference to custom map assetSignals
: Used to fire signalsEvents
: Used to fire eventsRNG
: Random number generatorFrameContext
: Contains data shared across multiple frames, holds reference to FrameContextUserFrameContextUser
: Contains custom user data
Systems
CullingSystem3D
: Default Quantum system for cullingPhysicsSystem3D
: Default Quantum system for 3D physicsNavigationSystem
: Default Quantum system for navigation
Framework Specific
The FPS Template extends the Quantum SDK with its own infrastructure; the most important classes are presented here below.
Data Structures
Gameplay
: Holds state data for Gameplay systemTeams
: Holds state data for Teams system
Systems
ActorSystem
: System for generic entity logic executionMapEntitiesSystem
: System for map entities managementPredictionAreaSystem
: System for prediction area managementResetComponentDesiresSystem
: System for resetings all component desires structuresPreProcessComponentDesiresSystem
: System for making early changes in component desiresPostProcessComponentDesiresSystem
: System for making late changes in component desiresAISystem
: System for entity AI calculationPlayerSystem
: System for player managementAttributesSystem
: System for calculating entity attributesLookSystem
: System for entity lookMovementSystem
: System for entity movementBodySystem
: System for entity body managementAutoTargetSystem
: System for automatic target entity lookupEffectsSystem
: System for entity effects managementProjectilesSystem
: System for projectilesWeaponsSystem
: System for entity weapons managementAbilitiesSystem
: System for entity abilities managementInteractionsSystem
: System for handling entity interactionsControlsSystem
: System for handling controllable entitiesGameplaySystem
: System for gameplay state managementHitSystem
: System for hit resolving and calculationsHealthSystem
: System for Health/Shield managementTeamsSystem
: System for team managementNavigatorSystem
: System for complex 3D navigation