Update

From Resonite Wiki
This article is about the general FrooxEngine-wide concept. For the ProtoFlux node, see ProtoFlux:Update

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:

  1. Update stream values
  2. Calculate physics (only during a full update cycle)
  3. Run world events
  4. Handle input (only during a full update cycle)
  5. Perform worker updates
  6. Run most ProtoFlux
    1. Rebuild changed node graphs
    2. Run events
    3. Run update events (only during a full update cycle)
    4. Process continuous changes
    5. Run a 1st round of discrete change events
  7. Run worker change events
  8. Run destructions
  9. Run a 2nd round of ProtoFlux discrete change events
  10. Pose the user
  11. Update audio system
  12. Update particle system
  13. Run connectors (e.g. Unity) (only during a full update cycle)
  14. Validate permissions
  15. Run synchronous actions