[1259] Synced variables can be changed from owner's `RequestSerialization()` before Later-Joiner's `Start()` at specific situation.
LefTonbo
On Later-Joiner's client, synced variables can be changed and OnVariableChanged will be fired without
OnDeserialization()
before Start()
at the specific situation. Then usual OnDeserialization()
will fire that causes desynchronization between the object owner.The specific situation is: The Owner uses
RequestSerialization()
at OnPlayerJoined()
or within some frames later, and The Later-Joiner is the first instance in its client.(otherwise, it won't happened)
It can be critical problem because it makes
Start()
is not be guaranteed before any Udon events: firing OnVariableChanged
before Start()
can break Udons that implementing initialization at Start()
.----
I've created the world for reproduction. Tested on local build, but couldn't test for remote.
World Mechanics: Front UI is main console. Joining a player increases synced int.
Sync timing is different between 4 consoles. (upper-left: Nothing, upper-right: Start only, lower-left: OnPlayerJoined only, lower-right: Both)
----
Reproduction:
- Join above world (called Player A) this could be later instances in Player A's client.
- Check log message about Sync_JoinCount.
- Another player join same instance (called Player B). The player MUST use the first instance in Player B's client (Use direct link!!).
- Check log message about Sync_JoinCount.
Expected Results:
At Player B log, Value Change log should be after
Start()
log.Actual Results:
At Player B log, Value Change log happens before
Start()
log. (Picture is in local build test)(If the instance is not the first in Player B's client, expected result will happen.)
----
Build: 1259
SDK World: 3.1.10
Log In
Tupper - VRChat Head of Community
open
LefTonbo
Even on live version, early
OnVariableChanged
before Start
can still be happened if the GameObject with synced udon is initially inactive in its scene then it becomes active. (initially active GameObject seems to have no problem.)LefTonbo
At another test (not the above world), I've reproduced early
OnVariableChanged
can also be occurred if the object frequently serialize variables even if the instance is second or more on its client.(1st picture: owner, 2nd picture: later-joiner)
HK
in progress
Phasedragon
tracked bug