Update
More actions
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 RawDeltaTime ProtoFlux node.
The engine update time will always be at least the amount of time it takes to render a frame. When the renderer is not decoupled, the engine update time will match the frame time. When the renderer is decoupled, the engine update time may be significantly longer than the frame time.
World update loop
Every world that is open will refresh as part of the update loop. This can either be a full or partial update cycle depending on world focus.
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