In FrooxEngine, an update refers to execution of the main engine loop. During an update, physics are calculated, synchronization packets are sent, permissions are re-evaluated, and many other events and checks are performed. An update comprises both engine events and the update loop in a world. Every user in a session has their own local update time, or the time that it takes to step through an update. This value can be received with the DeltaTime ProtoFlux node.
As of the time of writing, the time to perform an engine update is limited by the framerate of the Unity renderer. This may change with the implementation of inter-process communication and eventual switch to a new rendering engine.
World update loop
Every world that is open will refresh as part of the update loop. If the client is focused on a world or if the host is a headless without autosleep, it will run a full update cycle. Otherwise, it will run a partial update cycle.
The general world update loop is sequential and runs as follows:
- Update stream values
- Calculate physics
- Run world events
- Handle input
- Perform worker updates
- Run most ProtoFlux
- Run worker change events
- Run destructions
- Run a 2nd round of ProtoFlux change events
- Pose the user
- Update audio system
- Update particle system
- Run connectors (e.g. Unity)
- Validate permissions
- Run synchronous actions