Aller au contenu

Behavior syncing

Data synchronization in behavior graphs is possible in VRmaze. However, it is not automatic, and without special considerations, behaviors are not synchronized when using a computer cluster.

In general, behavior graphs are independent of each other, however, it is possible to synchronize some data, and perform some actions only on the master computer or slave computers.

"IsServer" node

VRmaze Sim provides a node that lets you know if the computer running the behavior is the server, or a slave.

!

The Node IsServer linked to the useful nodes.

This node allows you to create differentiated behaviors between the server and the slaves. With this node, it is possible to perform actions and commands on the server and reflect them on the slaves.

Repercussions on slaves and shared data

By default, there are no repercussions on the slaves, because there is no shared data. For data to be shared and synchronized with slaves, it is mandatory to go through specific Cave variables, which are shared on the network.

Image title 2

Synchronized variable types.

The variable types are as follows:

  • Networked Number
  • Networked Vector2
  • Networked Vector3
  • Networked Color
  • Networked Bool
  • Networked String

The procedure is as follows. The Master computer executes a number of actions, leading to the modification of one (or more) synchronized variables. On their side, the slaves use the synchronized variables, only in accession, without modifying them (the modification is done on the server). The access to this synchronized data allows an identical execution of the graph on all the slaves.

Synchronized variables

In the current version, there is no specific synchronization node for such or such property (for example, a position synchronization of a 3D object). It is necessary to pass through a synchronized variable to then assign the value of the variable to a property of a given object.

Example

!

Example of text synchronization based on the number of keyboard presses made on the master computer.