This document is about: QUANTUM 2
SWITCH TO

Overview

The FPS Template divides application scripts into 3 main layers:

  1. Game: script instances living as long as the application is running;
  2. Scene: script instances living only within a single scene; and,
  3. 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 logging
  • SceneDirector: responsible for initialization, deinitialization and ticking of scene objects, holds references to scene services
  • GameplayDirector: Inherited from Scene Director, holds reference to Simulation Context and reacts to events from simulation
  • SimulationContext: Holds data relevant to a single simulation, holds references to simulation context services
  • Gameplay Info: Contains all information needed to run single simulation
  • Entity: Represents Unity counterpart for a specific Quantum entity, holds mandatory data about entity, manage transform synchronization, holds references to entity components and manage their ticking
  • EntityComponent: Represents Unity counterpart for a specific Quantum component, or Unity-only component
  • Register: Contains cached properties which are frequently used on Unity side

Game Services

  • Analyzer: Game service for performance recording and analysis
  • Network: Game service maintaining the connection to Photon Realtime
  • Messages: Game service maintaining the connection to Photon Chat
  • Party: Game service for party management (require Messages)
  • Lobby: Game service for connection to custom lobby (require Messages)
  • Matchmaking: Game service to find match and maintain connection to the room (requires Network and Messages)
  • RemoteSettings: Game service for Unity Remote Config
  • SceneLoader: Game service for scene loading

Scene Services

  • SceneInput: Scene service for polling input from devices and sending to simulation
  • SceneCamera: Scene service for camera management
  • SceneUI: Scene service for UI management
  • SceneAudio: Scene service for Audio management
  • SceneMatchmaking: Scene service to run specific matchmaking process
  • SceneCache: Scene service for caching objects

Simulation Context Services

  • Simulator: Simulation context service which ticks Quantum simulation
  • Events: Simulation context service for registering/unregistering to Quantum events
  • Callbacks: Simulation context service for registering/unregistering to Quantum callbacks
  • Entities: Simulation context service for Quantum ⇔ Unity entities synchronization, is responsible for Entity initialization, deinitialization and ticking
  • Replay: Simulation context service which maintains replay simulations based on the main simulation
  • Register: Simulation context service which contains information about local player, caches frequently accessed references (entities / components) and sets prediction area

View Architecture Diagram

fps template unity architecture diagram
FPS Template Unity 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 structures
  • Map: Contains baked map data and reference to custom map asset
  • Signals: Used to fire signals
  • Events: Used to fire events
  • RNG: Random number generator
  • FrameContext: Contains data shared across multiple frames, holds reference to FrameContextUser
  • FrameContextUser: Contains custom user data

Systems

  • CullingSystem3D: Default Quantum system for culling
  • PhysicsSystem3D: Default Quantum system for 3D physics
  • NavigationSystem: 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 system
  • Teams: Holds state data for Teams system

Systems

  • ActorSystem: System for generic entity logic execution
  • MapEntitiesSystem: System for map entities management
  • PredictionAreaSystem: System for prediction area management
  • ResetComponentDesiresSystem: System for resetings all component desires structures
  • PreProcessComponentDesiresSystem: System for making early changes in component desires
  • PostProcessComponentDesiresSystem: System for making late changes in component desires
  • AISystem: System for entity AI calculation
  • PlayerSystem: System for player management
  • AttributesSystem: System for calculating entity attributes
  • LookSystem: System for entity look
  • MovementSystem: System for entity movement
  • BodySystem: System for entity body management
  • AutoTargetSystem: System for automatic target entity lookup
  • EffectsSystem: System for entity effects management
  • ProjectilesSystem: System for projectiles
  • WeaponsSystem: System for entity weapons management
  • AbilitiesSystem: System for entity abilities management
  • InteractionsSystem: System for handling entity interactions
  • ControlsSystem: System for handling controllable entities
  • GameplaySystem: System for gameplay state management
  • HitSystem: System for hit resolving and calculations
  • HealthSystem: System for Health/Shield management
  • TeamsSystem: System for team management
  • NavigatorSystem: System for complex 3D navigation

Simulation Architecture Diagram

fps template simulation architecture diagram
FPS Template Simulation Architecture Diagram.
Back to top