en:vci:component:sdk:subitem:owned

Table of Contents

Ownership and synchronization of SubItem

Relationship between ownership and synchronization of SubItems is explained here.

Summary

VCI items need to be synchronized between multiple players through network.
The network synchronization is done through a server.
Note: “Synchronization” in here is to make the position, rotation and scale of an object the same in all clients.

VCI is synchronized per SubItem.
The number of SubItems can be 0 (Things that doesn't move, like a background), 1 (a single item) or 2 or more (A set of multiple items).

Also, you have to understand the concept of a parent (a user who has the ownership of a VCI or a SubItem) and a child when creating a VCI item.
The parent submits the result of physics calculation and update function,
the child receives the result and replicate it. (The child is ignorant of the processes that took place in the parent and just receives the result)
When a VCI item is grabbed, its ownership is transferred.

Other characteristics are as follows.

  1. Synchronization is not done every frame, it takes place once in a few frames
  2. As submitting position, rotation, and scale directly will make the movement clumsy, the movement is interpolated by Virtual Cast

(Dexterous movements or quick movements may appear strange to other users after synchronization) - As the synchronization involves delay, the synchronized movement may not be exactly the same and may contain some deviations.

Ownership

Ownership is a right to change the position, rotation and scale of a SubItem.
For each SubItem, only one user in a studio can be the parent. The synchronization is done one-way from the parent to children.
Note: The ownership here doesn't refer to the author of the VCI, it's just the ownership in the context of network synchronization.

Acquire the ownership

In Virtual Cast, anyone can grab an item to acquire the ownership.

Ownership of VCI and SubItem

In addition to the ownership of SubItems, there is also ownership to VCI.
The ownership of a VCI is held by the user who spawned the item in the studio. It will not be transferred by grabbing.

Update function and ownership

The update function in a VCI script is executed only in the VCI item.
Therefore, when you do not have the ownership for a SubItem in a VCI item, the change to the position, rotation and scale in the update function will not affect the position, rotation and scale of a SubItem without the ownership.
(The state of position, rotation and scale is overwritten by the player with the ownership)

Physical behavior

Ownership and physics have a deep relationship with each other. Physical items behave physically only when its ownership is held by a player.
For items without its ownership, the calculation result is copied from the owner.
The result of physics calculation is submitted after being culled, which may cause strange behavior after being interpolated.
The issue becomes more noticeable when the object is moving fast.

en/vci/component/sdk/subitem/owned.txt · Last modified: 2021/06/29 19:22 by t-daihisa

Page Tools