A single UdonSharpBehavior with VRC Enable Persistence cannot store more than 108 bytes of the same variable type
tracked
toh_csecb
Steps to Reproduce
- Create a GameObject with VRC Player Object and VRC Enable Persistence
- Create an UdonSharp script that have 27 or more [UdonSynced] int fields (27 int is 108 byte)
- Attach it to the GameObject
- Build & Test the world
- Change field value and save by RequestSerialization
- Rejoin
- [UdonSynced] fields are not restored
Additional Information
* Serialization succeeds with OnPostSerialization
* It does not output any errors, so I am unsure if it is failing to save to the server or if it is failing when restoring
* ClientSim does not have this issue
* 14 or more double fields also leads the same issue
* I attached UdonSharp script that reproduce the issue
Proposal
This limit is easily reached, and I would like to be able to handle more fields if possible.
Also, this limitation is not written in the documentation and should be added.
Log In
ぽよたろう
I encountered the same issue.
I did a further investigation and found that this might not be limited to the same variable types but related to the amount of serialized data.
I prepared some UdonSynced fields which have long, int and float mixed up, and I added or remove some fields to see where is the limit.
As you mentioned, total 104 bytes worked but 108 bytes failed.
But when I added 1 short variable type, which is the size of 2 bytes as a synced variable, it didn't work though the total size is 106 bytes.
I checked SerializationResult.byteCount and found that byteCount less than or equal to 144 bytes works, but more than or equal to 152 bytes fails.
The total size of serialized data sent seems to change by 8 bytes, so it's not exactly 108 bytes in total but yeah, almost around 108 bytes.
I want devs to
- fix it if it is a bug
- write on documents if it is the intended limitation
- extend the limitation because it is too easy to reach
- make SerializationResult.success to be false when it exceeds the limit
StormRel
tracked