Field Linkage

From Resonite Wiki
Revision as of 10:47, 7 September 2024 by JackTheFoxOtter (talk | contribs) (Added information page regarding links, drives and hooks)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

A Field on the Data Model can be Linked, Driven or Hooked. These are different ways of specifying the type of control a system can have over fields it is influencing. In the Scene Inspector, linked fields are highlighted blue, and driven or hooked fields are highlighted purple. There you can also easily find the source of a linked / driven field by clicking on the hamburger menu button on the left side of the field, and choosing "open link / drive source". You can also break the linkage by choosing "break link / drive", which will set the active link / drive / hook reference to null.

Links

Links are exclusive references to fields. There can only be a single thing linking a given target field at the same time. This is often used when systems need some sort of exclusive control over the target and make sure no other copy of that system will operate on it. Linked fields are highlighted blue in the Scene Inspector.

Drives

Drives are an extension of links that on top of ensuring exclusive control also give the drive source control over the value of the driven field. This excludes the field from the implicit synchronization by the Data Model, meanings its value gets locally computed by every client, and changes to it are not networked. Driven fields are highlighted purple in the Scene Inspector.

Drives are the fundamental building block that allows creating Local Systems (systems that aren't implicitly synchronized). By utilizing drives, fields can have different values for different users, which is required for things like culling systems to function. Drives can also be used to reduce network impact of systems, by locally computing values on every client, instead of computing them on one client and implicitly synchronizing them to all other clients by writing them to a non-driven field on the Data Model.

Hooks

Hooks are an extension of drives that on top of ensuring exclusive control and control of the value of the driven field also allow systems to inform the drive source when something externally tries to change the value of the driven field. This allows systems to react to external changes, for example to create "writeback" behaviors. Just like normal drives, hooked fields are highlighted purple in the Scene Inspector.