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 Delta Time 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 (only during a full update cycle)
- Run world events
- Handle input (only during a full update cycle)
- Perform worker updates
- Run most ProtoFlux
- Rebuild changed node graphs
- Run events
- Run update events (only during a full update cycle)
- Process continuous changes
- Run a 1st round of discrete change events
- Run worker change events
- Run destructions
- Run a 2nd round of ProtoFlux discrete change events
- Pose the user
- Update audio system
- Update particle system
- Run connectors (e.g. Unity) (only during a full update cycle)
- Validate permissions
- Run synchronous actions