Class Concepts

The big players

  • Game.cs (NetworkBehavior)

  • Simulation.cs (standard class)

  • Subject (abstract base class (NetworkBehavior))

  • HarmonyPlayer.cs (Subject)

  • Avatar.cs (Subject)

Game

This class is the local client interface for the basic game things and hosts the Simulation, as well as offering methods to interact with it.

Simulation

Responsible for Tick(). Tracks ITickable objects and sends Tick() to any ITickable registered for it. Tries to run at a fixed rate, but since that's impossible without RTOS it just does its best to stay as close to possible to the target time on average.

Subject

Subjects are things that are tracked by the simulation across clients. If something is not a Subject then how it behaves will be calculated based on the state of the Subjects in the system. Subjects all have Input, both as a queue and a history list so that they can be rolled back. When deciding if something is a Subject, keep in mind the processing and bandwidth cost of one.

HarmonyPlayer

This is the 'player' object as far as mirror is concerned. The local client version will create and push inputs to it's Avatar. The remote versions hold shared data about this player. Inputs are pushed on local clients immediately, and sent to the server for processing/relay. The server gets the inputs and forwards them to the designated Avatar.

Avatar

This is a class specific to Player Avatars. It expects to get input from the HarmonyPlayer and will map it locally to it's environment.

Last updated

Was this helpful?