Syncing
Usefulness of synchronization
Synchronization is only useful when using a distributed rendering system on multiple machines. In cases where the display is handled by a single computer, synchronization is not useful.
Synchronization by default
When creating Cave-compatible experiments, a number of entities are converted to synchronized entities transparently. Running these entities on a single projector system is not a problem.
Debug mode
Debug mode allows the display of time shared by computers on the network.
Principle
The principle of synchronization is as follows: in VRmaze Sim, entities are not synchronized by default, so each entity has its own behavior on each machine in the rendering cluster.
There are two ways to synchronize objects: the automatic and transparent way, which consists of using entities that are already synchronized, or the manual method, which consists of using behavior scripts.
In both cases, the principle of operation is as follows: the master computer sends the state of the entities to the slaves at regular intervals. The slaves interpret the data they receive in order to remain synchronized.
Time reference
Time is synchronized and it is the time of the master computer that is used.
Automatic synchronization
Some entities are specially designed for synchronization. Some lists are directly integrated to take care of synchronization, it is the case for example of the conditions of success of a test. Indeed, some lists have a state corresponding to a compilation of all the states of the children that compose it. Thus, by synchronizing the state of the list, we do not need to synchronize all the children.
There are 2 synchronized lists:
- The experimentation control list
- The list of success conditions
Interest of synchronized lists
The interest of synchronized lists lies in the fact that they are able to use all components even those initially not designed for synchronization.
Property animations
Property animation is a powerful tool in VRmaze. It is quite possible to synchronize a property animation so as to synchronize the state of an entity on the slaves.
Synchronizing property animations
To synchronize a property, you need to use the Networked Float/bool property animation
node, which is used like the Float/bool property animation
node.
Synchronizing triggered property animations
The Networked Trigger Float/bool property animation
entity allows for synchronization of triggered property animations.
Synchronized trial end
The synchronization of the end of trial is handled by the list of success conditions in an automatic and transparent way. There is no need to manually handle the end of trial management.
Synchronized geometry
3D objects can be synchronized in terms of position and orientation. Adding a Networked Tranform
behavior script allows the selection of synchronized object properties.
Synchronization of other properties ?
In the current version of VRmaze, only the position and orientation properties are synchronizable via behavior scripts. The other properties will be in a future version.
Synchronizing properties
In VRmaze Sim, it is possible to synchronize the position of a 3D object (via the Networked Tranform
script which is direct) but it is also possible to synchronize any property of any entity. Indeed, it is possible to add one or more attributes of type Networked Number Property
to an entity. Thus, the slaves will take the value of the property of the master computer.
Behavior on the master computer
Synchronizing the slaves to the master is obviously not enough to produce any animation/interaction. This interaction must be programmed, with the behavior graph system for example.
Starting the run
Be careful, the start of the run is not synchronized between the master and slave computers. In the case of a multi-trial experiment, it is necessary to create a first buffer trial which will give time to all the slaves to start on their side. Another solution is to use the synchronized Networked Start On Demand Instruction
.
Synchronization of interactions
The use of the VRPN protocol allows synchronization of interactions between the master and slave computers. The use of a device supported by VRPN is therefore crucial when using VRmaze Sim in a distributed rendering environment.