#world-persistence
1 messages ยท Page 1 of 1 (latest)
Hooray! ๐
Hello
heyyy
Boo
finally :)

they said it wouldn't come out....
woooo it's happening
is the persistance beta network compatible or no?
exciting update!
yaaay
Finalllly
ah
they didn't say it isn't, and the default is that it is, so...
Better safe than sorry :]
What worlds currently have persistence?
What a pleasant surprise out of nowhere.
Patience paid off
Oh my god hi guys ๐
I'm really excited to see where this goes, save data is a really big component that I feel like VRChat games have been missing for a long time
Whispers.
I'm so excited.
will worlds uploaded with persistence sdk work with live clients?
ta-da!

๐
Woke up, see open beta, smile
Only examples and internal test worlds, really. If people have some that they're willing to share, they're welcome to post them here or on social media!
@granite river oh look your favorite feature is here
most likely none for a little while, creators have got to figure out how to use persistence and actually make things with it
Wake up, Samurai. Itโs time for Persistence Open Beta.
time to get back to world-building
some worlds have had workarounds, I have seen one save system I think and another using a "pass code" save system like the NES but it certainly has been very rare
Il push the settings saving for lsm tomorrow
You should be able to join those worlds but the features won't work and may break

finally a way to save in idle home easily!!
Less gooo
The worlds mentioned in the Sep 19 dev update, do those work with the persistence beta right now?
a
gues i tried to switch too early, still not showing
You know how painful it was to manually record stats and re apply it via code and scripts. now we can save space without all that BS.
Yes, but you'll have to wait for people to release them
I'm already predicting stats and leaderboards on every world. Whoever has the most of something, or perhaps a leaderboard for the amount of hours someone's stayed in a world, lol. Things're going to get competitive.
Unity why do you take so long to upload 
If you go to installed files and click verify integrity, it'll fetch the latest version
me and a friend did mario kart and recording win stats and Time trial stuff was really hard! Thank you for making this possible
If anyone want's to try some persistence:
https://vrchat.com/home/world/wrld_65b1db37-cce6-48d8-b57e-58c3f31b2c93
does that fetch new branches though?
roblox queue games time
yes
๐ค
On my way
whelp now to update the pool table
idk about the verify method, but the standard methods: wait longer or just restart steam. i could change to it just fine a moment ago
Btw is the persistence build network compatible like the open beta?
https://vrchat.com/home/world/wrld_ab2961d9-7f3d-436b-9d85-6bb4264a6b87 for another world that has persistance
yes it is. You can safely use the persistence beta in live environments. However if people from live try to follow you back to a world that uses persistence, the persistence features won't work for them
Is persistance just a toggle you can assign to any world statistic now without hassle?
I'm predicting that this will kick off the creator economy and we'll start having microtransactions literally everywhere. The Robloxification of VRChat
Quick question as a world creator: is there an easy way to detect if persistence is available on the client in udon? Feature detection/version checking/something like that.
it's a bit more complicated than that, but not by much! The documentation has the details
I actually don't see a way to save "world global" data like leaderboards
Unfortunately not, sorry
Ngl that is quite impressive
balls
Also what happens if you wanna reset your data. I hope a delete persistence toggle is added to the Menu for worlds.
Oh actually in this case, what happens? Does the script just straight up crash, are components unavailable, etc?
Yep, there's a button to delete both per-world and all worlds at once, both in the client and the web!
WAHOOO
I can possibly use a script crashing as a feature flag
Legends
Now there will be more sense to add way more complex customisation to worlds, even moving around the world furniture or even worlds that allow building your own world with a preset of objects to create ur own space
yippie
I think it's for the best, honestly. Imagine the amount of content and incredible creations we'll be getting in the coming months. Fun VRChat games you can just pick up to where you left off at. I know a few RPG games which will drastically benefit from this. It's gonna be sick. >:]
Finally a year and 3 months after the expected window
Um, I want persistance as a CC addon not a picture loader
So the persistence open beta is or isn't live compatible?
For playerdata, the script will crash. For playerobjects, the objects won't get instantiated. I suppoooose you could detect it through one of those two things
The main one I would say folks should do first will be to get their various cozy home worlds updated so that their settings are persisted.
Works for me.
i won't mind saying goodbye to save codes. those were a hassle
I think for now handling things through a separate branch will have to do until you are ready to merge to your mainline build
If there's no way to differentiate between beta and stable (at least as easily)
yep, good starter project. Just a simple playerdata write/read
Anyone?
Sidenote; whilst persistence itself is an important thing here, you lot should not sleep on player objects.
what do you mean by CC?
Creator companion you should know this
If it doesnโt get instantiated I guess that could be a pretty easy check to just see if it exists
Also makes sense that there isnโt any versioning or feature check code as once it properly launches it would be made immediately redundant
it.... already is?
It's in the SDK!
I just grabbed the beta :slugcatnod:
Then why is BlackRat giving us Persistance CC addon with a picture loader ๐
I can't believe I can't nodders here. The humanity.
also the acronym is VCC not just CC. CC could be lots of things, credit card, closed captions, etc
cheese cycler
creative cloud ๐คข
People can release prefabs that support persistence
Cause I just posted my update for it lol
Persistence is built into the SDK, people can release their own addons. Not quite sure what you're asking
But yeah uh player objects are there to solve the constant pain point game devs have had with "I need to just have per-person data, why is this so flaky and horrible"
Even if you don't use persistence you should be migrating game code to them.
Why can't those just be built into the normal addon as an extension. We certainly need a community Tab in VCC to download these extras for addons without external downloads. Something I should make a canny for but cba...
Persistence isn't a community made thing, it's from VRChat
Read above
because if we did that then we'd have dozens of different addons for all the different features in the SDK, which would make everything complicated and annoying for everyone involved
Filters, tags exist. Make good use of it
Persistence is not an external download, it already is part of the VCC. It's just a beta SDK
how would you prevent people uploading malware to this "community tab"
text files are extremely small
It's time.
there's a 100kb limit per person
100kb compressed.
so could you use that to keep track of individual users' scores in a game?
You can fit many Bee Movies into that
:p
Wellโฆ one bee movie script, at least uncompressed (itโs 80k characters, so around 80kb)
You could definitely save a bit with compression
Really cool world to showcase it! I think having more personalized home worlds would be amazing, lol. Like a room editor to shape stuff just how you like it. It'd be neat to have like a picture book area or something with uploaded screenshots of friends, etc. Custom posters to decorate a room, idk. There's genuinely a lot you could do.
Hope someone gets on that, honestly.
That's the idea behind it :p
You can use it for that, yes, but at a basic level: suppose a player joins your world. You want to, say, give them a trigger collider so your spoopy monster can hit and KO the. You need one trigger collider per person only, and you need that collider to be able to talk to other Udon code and do stuff over the network so they can play your game.
can't wait for worlds that already have string-based saving to implement regular saving via just saving that string themselves. A cool use case I can think of would be going to VRBricks and making a home world for yourself, and having that home world creation load in every time you hop in game.
The old way was using player object pools and either hoping the prefab you got is stable over the network, or you rolled your own.
The new system just goes "nah it's natively supported, and you never have to worry about network ownership or any of that nonsense"
for anyone who saw the openflight features and wants to test them, the world is now in labs https://vrchat.com/home/world/wrld_cda718e6-35f8-4049-8ea6-ec1065ac9e1e
Basically this update isn't just persistence, it's the biggest Udon networking update since manual sync
hence why Phase and co have summoned me back from the void
(bare in mind there is known bugs both in the VRC client and some of my implementation. Feedback is still appreciated ๐ )
Interesting. Well I've been working on a game world (translation: visuals are done but I'm just banging rocks together when it comes to udon coding), so player objects should be a huge help for me.
yes, it will make things far easier for you and far more stable.
i hope that a button for saving the current position as a persistent spawn point becomes as ubiquitous as the mirror toggle
We just don't need network ownership for player-scoped objects.
Where would these be located at in the client? Not seeing it on the worlds page.
allows for better udon security level prefabs too since ownership literally cant be taken if its a playerobject, its literally enforced server side
yuppers
so no way to sneakily steal udon objects anymore during ownership transfers
You're on the right page but you aren't able to delete user data while you're in the same world (for now)
They only show up if you aren't in the world
should really have the button and have it greyed out and give a popup explaining this
This also should hopefully allow for things like targetted RPCs eithout faff
yeah the routing becomes player based instead of all the additional overhead of cyanplayerpool
because everyone has a guaranteed player object, it's not going to need anywhere near the level of cruft
Ooooh fair okay!
I for one welcome being able to show off games at Community Meetup without the lobby system guaranteed crashing.
Speaking of: is the lobby system official demo prefab gonna be updated
Would someone like to make a canny on this? I'm literally about to go to sleep. :v
ill do it rq
inb4 the canny gets flooded because of the very obvious known issues
LOL
Anyway here is a video I made showcasing the persistence stuff for my prefab (as well as some other changes that got into that update)
https://youtu.be/2j-NbM8QwFM
This is the biggest update for my VRChat Picture Loader yet!
Download: https://github.com/DrBlackRat/VRC-Picture-Loader
- Added Persistence Support!
- Added Persistence Prefab which allows you to add URL Inputs you want to use Persistence for
- The Instance Creator can Save & Load Images
- Added a Tablet Downloader
- Compatc all in one s...
this is a vrcprefabs demo, not a vrc one, right?
smh, the mirror quality setting in the VRC Home World doesn't have persistence. :v
we did
JoinZoneWithDisplay etc
yeah
Just checked the code. I was wondering if that was going to get updated/replaced by a more robust player objects thing
ah yes - I wanted so badly to make all the Spookality demos with Persistence but it wasn't ready yet
am i the only one with no sticker emoji submenu icon in the beta
Yes, we'll revisit those demos for possible updates once Persistence gets a full release
Nice. Good to hear.
It's finally here!!
this is a known isue
Persisting for you!!
there is no showcase world like with physbones also?
not really now
You can just visit worlds others have made already
we should probably make a list
a list or a playtest group might be fun!
A row? ๐๏ธ ๐ ๐๏ธ
row is old nomenclature fsp, they're ~categories~ now

oh my god finally persistence im so happy
If anyone has a world with persistence in it feel free to drop a link in here, I'll try my best to pin them!
heres some. No promises lol
https://vrchat.com/home/world/wrld_b0317ed4-a270-47cf-9f8f-3e02183b1b98
https://vrchat.com/home/world/wrld_98cdf0cb-73ee-4c7f-b8ee-4349c8d51190
https://vrchat.com/home/world/wrld_cda718e6-35f8-4049-8ea6-ec1065ac9e1e
500 vrchatillion years before this releases to live
you have no idea chief
if anyone is curious how any of my stuff works under the hood just ask, im willing to provide as much source code as you need lol
I can't believe the zoomers did this
huhh...how about thread, as....number of worlds maybe going to double soon.
(I mean thread only with world links)
thxxx
Also good idea!
World Link
my database code for OF may be like 1500 lines long...... ๐
actually rn 1135 lines
got trimmed with some recent SDK updates
Is there any available documentation on player objects and how to use those?
Persistence is in open beta. You can test it by following the steps below:
@loud jungle im gonna be a jump pro
Ouhhh a list of worlds with persistence, I like it
Honestly this system will be god send for game worlds like terrors of nowhere
Being able to load in ur items/achievements/etc- instantly without using codes
yep
Is OnPlayerDataRestored fired if you or a joinee has no data?
Yes, you can use the struct to tell if you actually reatored anything IIRC
It's onplayerrestored though, no data. Did the docs still have the wrong word somewhere?
Nah I mistyped, it's 2am
Looks like my Udonsharp isn't picking up the override.
ah
I am stupid.
how long does it take for a feature like this to eventually land in stable release?
Hard to say since we don't do features like this very often. But it's closest to networking betas and those usually take a month or two
checks types supported by persistence
wow, no byte[]
I can't believe you don't just want people to be uploading arbitrary data blobs ๐
alr then, I'll be waiting
they are supported in player objects tho
my blobs!
Eh just means I'll probably just have to encode arbitrary data as JSON or something
for note, if you don't report bugs while in beta, it means bug not exist. fyi
best part is the codes can be repurposed as the information persistence is saving
I already have a really stupid idea for a world
Huh no, they're supported both by playerdata and playerobjects
Playerdata.setbytes
Fair
it should be setbytearray
Bit late to be suggesting api changes
๐
Yeah "trygetbyte", "trygetsbyte", "trygetbytes"
Use a LSP lol
Btw if your working on a prefab, use player objects
Player data isnt really appropriate for prefabs for a variety of reasons
For most of it, yes, but considering this is VRCBCE I'm working on
I'm going to need to support world-scoped data to an extent.
I'll test the crap out of this api in open beta, because its the kind of thing that cannot break, so it has to basically work perfectly, and I'll report bugs if I find any
? Why ? Player objects are world scoped too
This shouldn't be greyed out, just literally give a popup saying it'll be cleared then rejoin the instance.
I suggest against player data as its less explicit since its global and not object tied
Yes but I don't know how many pool tables someone is gonna have in their world
(also any changes to any player data cause the whole thing to restync, while changes to individual player ovjects only sync that object
But I'll need to properly design the real system
^ then this is even more relevant
I'm anticipating world-scoped pool player data being in a separate pile of data to specific table data.
That may well end up turning out unwise
the main problem is that the easiest API to use is most easy to shoot yourself in the foot with
Right but you dont know how large the world users playersata is
True.
You might be synching a massive ammount of data by just changing a int
There's lots of places it's still appropriate, a good example might be a simple mirror toggle.
If your making individual world scripts i agree
I just disagree for any prefab creators since the world use case is unkown and you may cause massive network loads unintentionally
Maybe a small warning from the SDK when a prefab contains save data parameters?
Wouldnt really be a way to do that
If you're dragging in a prefab yeah
Right but you dont know if thats the users prefab or a packages
And I'm sure you can detect when a package gets imported
This is just moreso something prefab creators need to realize. Either that or player data gets fixed to not sync the whole thing everytime
To be clear; I'm doing a full systematic rewrite of VRCBCE and sandboxing both networking and persistence inside of their own code, so I can put off deciding on a pattern firmly until later.
You can always just have a "don't show again for this prefab" type thing too
Or just like
Have it be a onetime thing
Yeah, just thought id make you aware of the pitfalls since you havent engaged with the beta yet and its useful to know before you have to re architect it all due to network loads of certain worlds ๐
The entire point of the VRCBCE refactor is to avoid tying hard-to-change code into infra.
Infra and domain live in two boxes and I define communication between them. I'm extremely done with omega classes
I mean yeah im using the same architechture for my setup. 1113 line database manager system lol
Wish I had interfaces but eh, I'll cope with abstract classes
Skimming the logic for playerdata: it looks like it's entirely possible to clock how calamitious a data sync push would be
Ig you could if you really wanted to
So to code defensively, it would be best to do a scan of how much data is synced
Perfect timing to lose power for a few weeks 
Gonna have a lot of fun with this when it returns
Still waiting on the part of the api that lets us know when synching will be finished and how much world space is left :flop:
Kind of vital for prefabs imo since without it you cant inform the user if a save even worked or has finished and is safe to leave sadly
It wasnt as critical as it is now
If i save a certain ammount of bytes, it can take up to a minute to save and theres no way to tell the player how long to wait reliably
I somehow survived before the networking rewrite, too :v
video players do seem broken between stable and persistence beta
no one on stable sees the videos i put in, nor are they able to add urls
Could persistence allow a global world leaderboard eg. Points scored in a game?
(All players that ever played the game across instances)
Local leaderboards would be pretty easy. I know that
Sadly not at the moment
You only get data for users in your instance
I think it would be neat to have a way to access all the data of every player that ever joined the world. But I can see this causing security and trust concerns
I mean not even that, that could just be alot of data
True that
one second, backend engineer hat on
Remember a world can store about like 10000 bytes IIRC compressed (dont trust the number i have here it may be higher, in bed rn lol)
world-scoped dynamic data is probably actually easier than player-scoped data.
Well yeah if its world scoped
But a leaderboard wouldnt work with that since it then becomes player scoped again essentially in size
You're just saving a blob next to the manifest and assetbundle for the world and allowing read-write through some API.
Its the potential size thats moreso the concern. All player data is stored on server, not locally
so wait I don't understand the difference between player data and player objects. Whats an example of what you would use one over the other?
Yep, and potentially a very high read volume that would hurt if the blobs were on something like DDB.
Player data is non-object specific, all scripts see it without a direct reference
Your main problem would be accepting legal ingest.
Player objects are the way to go 90% of the time imo for reasons ive listed here already
You can't really allow a scrote to hack the client and replace your world's persistent data with a dickbutt ascii.
Player objects are duplicated for each player, and are owner locked aerver side to always be owned by their respective player. Any network synched variable is atuomatically saved on individual serialization of that player object, compared to player data that serailizes everything in it at once when anything in it changes
Player data is essentially the lazy quick way to do persistence TLDR (atleast in my opinion for most cases)
I don't actually agree there from a architectural standard
I can agree on the technical debt/limitations side, that's a good point
But player data is agnostic of world setup
Yeah the idea is good its just limited by its execution of player data
If it was diff based it would be way nicer
Suppose I'm refactoring a world I'm working on and I want to maintain all the data my players have.
If it's stored on a player object, that object has to remain rigid.
Ehhh thats moreso a issue with the network id stuff being weird but yeah i get your point
Yeah so just in general I think the model they've got is fine
yeah versioned object persistence is quite hard
Again as a seasoned practicioner of coping with VRChat world code
Important thing is to work flexibly
Itd be nice if we could just have like string based network ids so i could namespace my objects and have them always be linked :/
Something like a playerdata key
I mean that's what the global persistence data is, the API is just bad because every time someone wants to use it you need to tell them not to
yeah it is amusing they put out persistence when the network id tool is still broken after the last update
Yeah if it was diffs it was sending my main gripe with it would be solved
Its really just the unkownkness of what data cascade you might cause
cant wait for infinite loops based on player data being updated by one script making another script try to update its player data lol
Not sure if thats possible but sounds funny and that it might be
To be fair, I think world creators will need to be the ones to have to worry about player data overload more than prefab authors
I'll need to very clearly outline what the persistence layer does and how it works regardless of what methods I implement
I feel like they need a "stupid mode" where you just put [persistent] or something before a variable and it figures out all the stuff in the background for how best to actually accomplish that
Yeah but given the.... Competency? Ive seen some times in worlds is what worries me is all โค๏ธ
Yeah we wanted a seperate attribute from networksynced ๐ฆ
I'd anticipate editor scripting people to step in and go "hmmmmmm" at this
(mainly because rn all networked data is also saved, which isnt entirely ideal in certain cases)
There's some aspects of the problem I think can be spotted by automation, but given player data accepts unbounded strings and arrs
will be quite spoopy
I mean im already doing cursed things, im just storing raw json string in a player object for the settings database
I suggested that, offered to help integrate it, got talked to for not agreeing
Interesting bug.
If you're on the beta using persistence, and someone creates an instance for a world with persistence and you join them, you're unable to join said instance - "world version incompatible with this instance"
I'm going to go report a canny, but oops
huhh...maybe need to check
https://feedback.vrchat.com/persistence/p/instance-breaks-when-persistence-beta-user-joins-persistence-enabled-world-creat
Btw it doesn't matter who creates the instance, it's whoever joins first (i.e. master).
Also interestingly, when you have synced objects with non-beta users, they get the object instantiated, but never get OnPlayerRestored() called. Which makes some sense, but feels a little weird.
Sidenote on the player data stuff
They can't just only fire diffs off to people
Diffs are inherently contextful. You have to issue complete sets of data or clients cannot guarantee data correctness
So instead you would need to break up PlayerData into individual items that have independent clocks etc. I can understand why that is hard.
Especially given this has to hook into the underlying world netcode which is already under massive pressure
Hm. One iffy thing - there's no way to declare persistent data that's not shared with other players. I want to ask for it but I assume there's a reason this hasn't been made available.
No support for targeted network sync in Udon
No, I mean no network sync
Persistence that's uploaded to vrc's servers for the world, but isn't sent to other players at all
You are still using the network, that is why it uses the same throttling code etc
I can only guess tho
Even if it is to prevent spamming uploading data to vrc, I feel like we should really be able to have persistent data/settings that aren't network replicated to users other than yourself.
Like if I have my own local playlists for a video player for example, and I wanted that to be private. (contrived example)
We're tracking this somewhere, check if there's a Canny for it!
Oh there is? I'll go look!
I'm not 100% sure that it got created, but we discussed this feature quite a bit during Closed Beta and agreed to look into it further.
It will be needed; it woukd actually solve the network dump problem with using PlayerData.
Can't find it, so will create it
doot
that's been asked for a ton, I expected there to be a canny for it
it'd be better if it was the default
Not that I could find, at least not what I have access to
2 cannys and I've only touched the beta for like 15 minutes... This has to be a record for me. Usually it takes at least half an hour l m a o
there were some comments on the canny for the persistent data feature https://feedback.vrchat.com/udon/p/save-load-persistent-world-data I know I asked for it a ton
Fair, though I'd imagine it'd be easier to track as a separate canny.
yeah it's good to have a canny for it
Oh, worth clarifying these behavioral questions btw - these all are exclusively for PlayerObjects, not PlayerData:
- When you join an instance (as a non-master player), and get
OnPlayerRestoredon objects that aren't yours, can you generally be sure that the data has been received (and written to the heap) for all of that player's udon behaviors, or is this only valid for those objects that have had the event called on them thus far? (i.e. is the call deferred until all udon instances have had the data populated) - Is user data for other players in the instance loaded from vrchat's servers every time, or just read off the network for those already in the instance? It talks about state being overwritten if you read/write too early, but the exact lifecycle of data isn't clear here.
- What is the actual event lifecycle when it comes to
OnDeserializationvsOnPlayerRestored? Is there any guarantee of ordering for late joiners when it comes to these two events? - When saving data in pool objects, are all pool objects saved to vrc in one batch, or individually? Individually here mirroring how udon network sync works.
- Will a failed serialization always also cause a save failure, or are there cases where one can succeed while the other fails?
is the persistence beta based off open beta or live?
ik live and beta are same currently but for future open beta updates
also is the SDK based on the current beta (b3 I think?) or the release version?
persistence will track live releases, not other open betas.
ty ^.^
Yes, the persistence sdk is up-to-date with 3.7.2-beta.3
(in retrospect, I'd give this about 80% confidence. It might only be up-to-date with beta.2 and I'm not on my work pc to check)
Good to know ๐
I'm not sure if this is reportable, cus it's technically correct, it's just confusing. If you have a persistent object that loads data, but it has never been changed in the instance, you get a restored event but not a deserialized event.
While this makes some sense, I feel like this is going to be a footgun for anything that's meant to apply some behavior based on property changes after data has come in from a remote.
I'm not sure it should be changed, but might be worth a "heads up" somewhere in the docs? Though I don't know if others would agree with me on that.
Question regarding PlayerObject, lets say I have weapon A and weapon B, The root of the objects have their own scripts, but there is a child object in each that has a component called 'weapon_data' with persistence enabled, does it get affected per object or is it per component script?
so like
-Weapon A
--Data
-Weapon B
--Data
Only the objects with the persist component and all recursive children of that get persisted. If the persist component isn't on the root, you can choose what gets persisted piecemeal
It's still recursive, but only from the persist component downwards (as far as I can tell from my own tests)
What I am asking is it isolated from one another or do they share save data because same component
It works by network ID
So the logic that applies to network sync here is also used to pair up synced data (with some asterisks to personalize it per-player)
Ah, so how do I make sure the network ID is consistant to make sure save data isn't lost?
Assuming network IDs change
As far as I can tell, as long as the network ID tool has the original objects the same, data won't be lost. Clientsim-side it seems to add a prefix per-player, not sure what happens vrc-side but it seems to behave in a similar fashion
This even remains working if you change what objects have the persist object on - say you persisted the entire tree, and then moved it to a child - the child would still retain its old data, the parent just won't load it.
Not sure if this means that the data will be deleted server-side after serializing data with the new layout, but based on the documentation I would assume so. Haven't tested that example yet.
You're absolutely right, that's an excellent use case for knowing how much data is stored. We have a feature already on the way out to the next update which which will be ideal for making that exact observation
Wheee more cannies. One being wasteful with data for builtin components (vrcobjectsync saving far more data than it really should be), another being misbehavior on restoring (should sync really lerp on load? I don't think so :P)
hey, i own a world i bought on gummroad, I'm wondering can someone do a easy explain how i add it to the world?
You will likely need prefabs that already have persistence in them, or write stuff yourself. It's early days, there's not a lot of pre-built persistence stuff, and the only thing you can persist without udon here is pickup positions - but only within the new player object system, which behaves differently to standard pickups/object pools, so you're going to want to wait for some prefabs to come out.
The behavior is likely to change too, so implementing anything for now is likely to break/change behavior in future up until release.
If you fully deleted the structure and then re-created it with new objects, then it would lose all those network IDs and the next time you make a build, it will generate new, different IDs for all those objects. Once you do that, it will no longer be able to load the data that was associated with the old IDs.
That said, there are many ways you can reorganize the structure without breaking network IDs.
Once network IDs have been generated for a set of objects at least once, they will be stored in the VRCWorld as an array containing an integer and the reference to the gameobject. This means that it's natively resilient things like name changes, changing parent, adding children, or any other kind of change operation that is still the same object.
Even if you do delete some object with a network ID, that's still not the end of the world because you can always manually edit the VRCWorld's network IDs to reassign that ID to a new object, if you know what it was supposed to be.
Similarly, the network ID tool does the exact same thing except just faster and automatically, by encoding one set of IDs into some json and then using that json to automatically assign the objects in the world to the ID it's supposed to be. that said, there are known issues with the network ID utility right now, so it can't really be used. But rest assured that there's nothing the network ID utility is doing that can't be done manually.
Also, in regards to the persistence-specific behavior about what happens to your saved data - you're exactly correct, only the latest saved record will be stored, and so if you override an old save with a new one that didn't have those IDs, then the data associated with the old IDs will be lost for any player that visited the world on that build of your world.
Is using persistence to enforce moderation actions against users prohibited by the TOS of VRChat?
I personally could see alot of people using persistence for this specific reason
Say if someone made a world with a "blacklist" that made it so if certain users joined, they would be forced to a sort of "jail" area away from other users?
You don't need persistence for that
and yes it's already been done/abused with Udon
yes but Udon blacklists or "ban lists" are against the TOS
your example is just the normal udon blacklist
I wouldn't see how persistence can make it abusable even more
I guess
like persistence data is use user deletable so that would be bad for moderation
Is there the ability to cause a data race between loading persistence and getting network data as a late joiner?
Like say I was serializing data constantly, and a user joins. They start loading persistant data from VRC, and before they get it, data is published on the network that differs. They then get the deserialization for that different data, and then get the data loaded from persistence.
After this occurs, will the player see the network's state, or the persistence state for the remote player doing this? To me they should see the network state, because otherwise you end up with a desync.
It's not clear if the load state is safe to deal with before you get remote data for remote players - if not, this seems like a potentially problematic bug which can't easily be worked around without a bunch of unnessecary code to restore network state.
Testing this is difficult given you need to cause a race condition, so I'm wondering if there's any word on how this works for remote players.
I want to raise a canny for this if it is an issue, but it's extremely annoying/difficult to test.
I guess the two sources, "owner client" and "data holding server" (I named them temporarily), are not placed in parallel but in series. If so, a race condition could not happen.
Anyway, I also want to hear from the dev team to clarify.
It's more a question of how the vrc client resolves this situation - I'd hope they'd drop server data if data comes in from the instance state.
I guess like:
- The Owner client communicates only with the server. Also, the late joiner client communicates only with the server. (In other words, they are in series structurally)
- When The server receives the variable value from the owner client, it saves it and distributes it to other clients.
- When the late joiner client connects to the server, it receives the latest saved value.
So, from the view of the server
- If the joining is before receiving new value, the joiner client will receive the old value first and soon receive the new value.
- If the joining is after receiving the new value, the old value no longer exists on the server, so the joiner client will receive the new value only.
I'd rather hear from someone on the vrc team than speculate, given this is around a potentially quite problematic source of bugs.
I would imagine there's actually 3 sources for persistent data: the client, the realtime networking server and one for storage. The storage would basically be just an extension of what manual sync currently does, so it can also save data if the instance is not running, while the realtime networking server would just send the last data it receives
what do you mean by this btw? what file? the persistence isn't saved in a file locally, it's saved on the servers
Oh I misunderstood that, my bad
Was under the impression that it was stored on user's PC
Disregard my question
You didn't need to delete it, it would still be a valid question for modifying the data stored in memory, but thats much harder now
This world is a neat proof-of-concept for persistence.
https://vrchat.com/home/world/wrld_a396c393-30f4-41de-a0d5-41d6632e4877
This is my assumption. VRC instance servers as a model are basically scriptable application load balancers
They don't do a tonne, they just make sure that the networking between clients is passed about; over the years VRC has thrown more functionality onto them, but the servers don't really do much.
VRC data sharing in Udon over the network involves making a commit to a document on the network instance and that then gets replicated out. I'd assume that persistent information is schlepped around via this too, rather than working via client read-write to a backend service (which is how I'd write it, tbh)
Udon networking has always been quite painful just due to the nature of needing to make sure that server costs stay under control, and what at least appears from the outside to be tech debt; Unity, especially when VRChat wrote its older systems, was very bad at networked games.
nvm it loaded xD
I believe you will get them in order, that is you will first get the persistence data at the time of joining in the restore callback, then every networked update from then on. I'm not sure how else you'd want to handle this, you can't wait for a "final" state if the remote is syncing continuously. You will never reveive inconsistent data though, per-object.
It's beta.3, but actually not - it's newer. Has a few VRC Constraint fixes and one for Standard Lite. But sshhh, just pretend it's beta.3 ๐คซ
I can't believe VRCConstraints got ported to worlds, praise the scholars
( ๐ )
oh awesome, I was hoping for the fix for the constraints in prefabs. Thanks for checking!
Might be in there, but no guarantees. Really, treat it as beta.3+persistence, but due to git branches getting mixed up here and there it may just contain some other stuff.
(We checked it's nothing bad or large enough to need announcements, to be clear, just didn't get to making a full changelog since we wanted persistence out)
hi guys, iโm so sorry if this is the wrong place to put this but, iโm not sure where else to look or ask..
is there any documentation on the persistence stuff at all?
It's in the announcement, you can find it here: https://vrc-beta-docs.netlify.app/worlds/udon/persistence :)
Persistence is in open beta. You can test it by following the steps below:
thank you sm!!
Okay! That bug is really annoying me ๐
Am I wrong or is there no way to make a global leaderboard? There is no way to get information about players who are not in the instance, and there is no player agnostic world data saving right?
persistence currently works on a player bases so no
You can only compare it to other people in the instance
My plan is to sync and save other people's highscores when you are in the same instance. Basically "infect" them lol
spread the highscore disease
Thatd work only in active instances. I guess you still need an external server and make people open some specially formed links, to submit score
Well yeah, as stated above we don't have world persistency (which would be cool btw), so that's just what I plan on doing for now. It might actually encourage active instances
"with death of this instance the highscore will fade away until you meet the legend..."
Kinda, but I feel a lot of potential in the idea because it only takes one friend who visited a lot of publics to come to your friend instance and infect anyone who has not.
Like real life disease
Highscore Infection Virus (HIV)
that sounds so cursed xD
In that particular question, the answer is it shouldn't even be possible to do in the first place because you are not able to set playerdata for someone else or take ownership of someone else's playerobjects. This is not just an API lockout, but rather these objects are under a whole different photon mode where that is literally impossible. Moreover, if you are actively in the instance and serializing, the person joining will not get anything from storage about your data because it only does that when you first join.
That said, the race condition that is actually interesting would be you joining and then immediately spamming your data, and then worrying that you wouldn't get your own save data back. Even then, that should still work because the expected behavior of this is that:
- other players already in the instance will receive your storage state before you ever have a chance to change it. Once you start changing it, it will override the storage state
- late joiners will just see the most recently sent state
- even if you're spamming outbound you should still receive back the storage deserialization because it was already on the way to you before you ever should have been able to start spamming
As for how this works in the backend, some of the speculation here is indeed already very close. You can think of it in two components:
- the system that provides data from the vrchat API is not unlike another player who temporarily takes ownership over all your objects and sets the state to what it should be, then hands ownership back to you. This only needs to happen once when you join.
- the server just holds onto the most recent state, and passes it on to the late joiner when they join. This most recent state may be the state from you, or it may be from vrchat. It doesn't care, it handles both the same.
Btw, I also had this question if player object instantiation is working on live or not. I assume it's not, but it would be really helpful if it did, for smoothly transitioning my worlds.
Just keep in mind you only have 100kb total in the world and udon sync speed is really slow, lower than writing to a floppy disk
Oh yeah, name strings might take some space, but 100kb sounds more than enough
Definitely need some kind of cap on it
Interesting, I checked the docs and it looks like it's 100kb on data AND 100kb on objects? And on top of that they compress it on their side. That's honestly a lot to work with
I guess it depends on what you want to do. I don't think you need 50k highscore entries for example. But you could probably fit a thousand or two if you really wanted to. That's honestly enough
what extent of persistence is being added? will it be hard for creators to make full on save systems?
How do I get the persistence beta? It isn't showing under steam, only open-beta, do I need to restart my steam to see it?
also I remember back when roblox had much earlier save systems that there were issues where data could randomly be completely lost, will there potentially be issues where save data gets wiped without the player doing it?
You can either restart steam or go into "installed files" and click verify integrity
At the moment, this form of persistence allows data to be associated with players and can be accessed only when that player is in the instance. That's the exact type you need for personal save systems, so yes. What is not being added right now is saving the state of an entire instance (like a minecraft realm), or viewing save data of other players not in the instance (like a global leaderboard).
Thatโs a lotta data
- Yep, OnPlayerRestored is designed to say "all data for this player has been received from storage" or at least "if they had data, it would be here by now". This means that it should come after all OnDeserialization's for any player objects which had a saved state, and by the point you receive OnDeserialization it should be fully safe to read synced data from playerobjects and playerdata.
- User data for other players is only loaded once when that player joins. The server then holds onto the most recent state, whether it came from you or loading from storage. If you send data too early, it will replace the data which came from storage, which will cause it to be lost.
- OnPlayerRestored always comes after all other OnDeserializations that came from storage. If there is no data, you may not get any OnDeserializations but you will still get the OnPlayerRestored.
- Each object inside a playerobject will sync independently. If you have multiple udonbehaviours on one object, they will go together. When you leave the instance, all of the data from those different objects are packaged up by the server into a single bundle and sent off to storage. Playerdata is also packaged up, and has a separate bundle.
- Failing serialization means it fails to send. If it fails to send, then the server never gets it and it will not affect your saved data at all.
viewing save data of other players not in the instance
I'm sure there's probably a simple explanation but reading that and seeing this world makes me wonder how it does that if you can't really see save data of others currently.
https://vrchat.com/home/world/wrld_a396c393-30f4-41de-a0d5-41d6632e4877
For context
Pretty sure that world is just using string loader and some server sided shenanigans to do that lol
Ah figured. Didn't think to check there~
Yeah I think the timing is just a coincidence and that's a totally different system. Probably works on live
ah
Hello, I read a bit the channel and just to be sure, it's really not possible to do a scoreboard with persistance ? In the documentation it's confusing me because it's saying "each world may store 100 KB of Player Data"
You can, but you can only access the data of players in the world
In this specific situation, the data race doesn't involve any kind of ownership transfer.
An example experimental setup here would be a single int on a script incrementing every frame and constantly requesting serialization - this being low enough data that it works approx every frame, managing to time ending this sequence perfectly so something goes wrong.
The failure mode here would be all other players in the instance seeing the correct final state, but a late joiner, who was joining while this occurs, seeing one or more deserialization events from the network, followed by loading from persisitence which may be in an old state. This would either fail by getting stale data only, or getting new data followed by stale data, and staying on stale data due to unfortunate timing.
I'm curious if this situation is ever possible. Depending on how persistence operates, this may be an impossible state to hit, however experimentally I've noticed you're able to get state updated without an OnDeserialization event if the object has never been touched in that instance - though I did notice a flaw in my methodology last night and plan to re-test today to validate that.
Basically in short I'm wondering if you can cause a race where your final state is stale due to in memory vs storage loading speeds.
When you are the late joiner and they see you join, they will briefly see data from storage before it is overwritten by your real data.
However when someone else is a late joiner and you've already been serializing data for a bit, the late joiner will only see your data, because it doesn't refetch from storage once you're in the instance
So persistent storage data takes priority over instance state in all cases? That's a bit spicy.
(When receiving data)
It's not about priority, it's about which one gets there first. And yes, storage data always arrives before the player does. And that's a good thing because you want it to be ready to go asap
I'm not sure how that would be a problem. If you don't want that behavior you don't have to put enable persistence on those objects where it matters
Loading data from storage is actually not unlike an ownership transfer. The server takes ownership of your objects and sets the data according to your stored record, then hands it back to you. This all happens before you finish entering.
The problem occurs in the same way that the existing problem with late joiners where if someone sends data while you're on the loading screen (between start and fade up) you never actually get that data. Just goes into the void.
I don't know if that's been fixed yet.
You get the data as it was before you joined, but any data received in that period never arrives.
Given that is already a problem in vrc, I'm wondering if a similar issue can occur with persistence loading.
My last test for this was months ago, but it's not hard for me to retest.
... Honestly I should probably raise a canny for it if I can still reproduce it. It isn't hard to trigger, if you're trying to do so.
First I gotta get out of bed though lmao
Ok so you're taking an existing bug and extrapolating that it might exist in persistence? Well I'm not familiar with that particular bug, but I'll say that persistence is effectively also a big network update in general so it's possible that bug (if it existed) was fixed by default as part of persistence anyway
Regardless, if you have a hunch a bug exists, then yeah go test it
I'll go and check in both open beta and persistence beta.
Breaks game world sync all the time if your timing is unfortunate.
My theory here isn't that it's the same bug specifically, but it'd be in the same class of bug.
yep, still exists lmao (this is the old bug)
may drop the data altogether, but for now I've only tested the actual deserialization event (and arguably the event itself is what matters)
I think I understand, so you can't have a whole world that constantly changes and saves based on what players do to it (like building the world in minecraft basically)
... Theoretically you could implement that with a CRDT and a gossip protocol like system, so as players come and go they fill in the gaps and merge data. But that would be a lot.
would be funny as hell though
I don't have anything productive to add, just want to express my excitement for persistence. This is HUGE! Could change VRChat in ways we can't even imagine yet. The future is going to be exciting.
Udonsharp is still updated in the SDK, but basically all public vrchat gh repos (issues etc) have been neglected. It's basically gone source-available by this point.
The one provided in the SDK is updated beyond the gh one
And the lord said "lol. lmao even."
We'd like to keep this channel focused on the Open Beta for Persistence, thanks!
sorry (I deleted my msg)
What happens if you call OnDeserialization manually like on start? I do that often and I'm not sure if I had that same issue
Unsure, I can test - but this has been a flaw since at least day 1 of network sync auto-loading on clients.
Hello I'm new here
I would like to know the result if you do.
Anyone taken a crack at saving player position yet?
Curr is updated every frame based on network data. It's not just the event, the data never arrives.
Gonna update the canny for this
nvm too late can't do that lol, will just comment
The only other thing I can think of is if the object is disabled on scene upload for whatever reason, but doesn't seem like it's the case in your example. Good catch, things like these can really throw a wrench in your machine, hope that will help them fix it
This causes other issues as well lmao
I did in an earlier iteration, it's honestly pretty straight forward
I can't seem to join the beta?
Have done multiple times, even the entire pc
That did it! Thank you!
No Problem!
yep, there's an example for this in Example Central
I'm running a group instance for playtesting persistence in my world, if anyone is interested in joining!
[event over]
Honestly kinda hope to see more worlds make use of saving a player's last known position when rejoining with persistence~
So it's using an external web server instead of VRchat's upcoming built in persistence?
The entirety of VRChat Persistence Player Data documentation page screams "don't use this"
When I test Player Data in-client, I feel like it would probably be faster to create a few hundred empty Player Objects per player than use Player Data
I am not the one who is going to try
What do you think about this?
don't have any programming experience myself so no clue
haha ok - thought you were trying to start a discussion. Why did you post it here?
figured someone who was more knowledgeable in programming would have insight into that as it kind of seems like from the start of the tweet that it was a bit of a weird way to go about it
i do gotta say tho. i'm confused. lots of function in the docs but now where the playerdata actually is located.. is it only accessible in OnPlayerDataUpdated? or am i just missing something.
like lots of mention to PlayerData but not where said player data is accessed/retrieved. unless i'm really just that blind and i'm reading over it..
I missed the "udonsharp" tab on the example at the bottom!
Though this leadds me to believe my IDE is not working correctly then
oh wait nope nvm found the issue, that code uses PlayerData.SetInt directly. but when i went off the assumption that PlayerData was a static it told me it was invalid. i didn't consider the fact that it might be in a different namespace. in this case the VRC.SDK3.Persistence all good now o/ thanks @errant token ๐
Make sure to open Example Central from the menu under "VRChat SDK > ๐ Example Central".
There are 10 persistence examples built with U# to get you started using PlayerData and PlayerObjects!
curious though. if playerdata is only accessible from the client of the respective player. why is OnPlayerRestored seemingly sent for everyone? ๐ค
Any player's client can Get data belonging to another player, only Set is limited to the owner.
Its accessable anywhere that event is there as data loading is done in pararel (specially its downloaded from server) so your code need to know when loading is done other wise it would been pain
momo already got me to find the answer. that said i'll be honest if i had read this before their response i'd only have been more confused. :P
"is it only accessible in OnPlayerDataUpdated"? i kind of tried to explain that part ;p
on that note though. success. player movement speed changes are now persistent in my RP world \o/
actually. important question. if I update a world with persistance. for people on the old client will running persistance methods break anything or will it just pass over them/do nothing?
I wonder that too, whats the behavior with other client versions that dont have persistence
It wont be issue in future, but it importent for people who relese worlds with persistance right now
I recommend you do not update any existing public world with persistence until it's released to the main client. The persistence sdk methods will not exist for non-beta users, possibly throwing exceptions and generally confusing which things are working correctly.
all good. ๐
guess i'll have to convince everyone to start using the persistance beta then ๐
persistence could really potentially open up an explosive amount of possibilities, a game like Phantom Forces on Roblox for instance would not be possible without save data since there's so many things to unlock
The main thing this video showcases is the shockingly slow update rate of the right user window and the technical theory that it might be faster to use empty player objects instead of the player data component. Ntm the low maximum data limit which seems incredibly limiting.
Yee, finally able to save some data from the world I'm working on.
Got a nice looking block of dense data. 
(the not dense data on the right is from testing and is unused)
On my public world I simply used the OnPlayerRestored event to check if persistence is supported since it is not being triggered on non compatibile clients. Works fine (tested on several devices).
Iirc instances started with persistence beta and ones not are not intercomaptible currently
Not on my world. I already did that test. The only difference is that when my world-compatible istance is created by non-compatible clients the event OnPlayerRestored is not triggered, even on compatible clients. Anyway I must admit that more testing should be done with different situations.
I find it weird that you need to login for the example stuff
Is it possible to save VrcUrls on a PlayerObject?
Would be nice for giving a User the possibility for his home worlds default music
Yes
That's what I am doing for my image loader for example
Nice
Saldy you can't use Player Data for that and only Player Objects.
I know, I saw itโs not possible in Player Data, so I asked for PlayerObjects. But Iโm happy that it would work ๐
I am having an issue importing one of my models with the new SDK, the validations aren't showing up, and I have gotten this error that says " Cannot implicitly conver type System Collections Generic" And when I tried deleting it and readding it I get the same error.
I am using the 3.7.2 persistence beta.1
When a player joins an instance, is it better to use OnPlayerDataUpdated or OnPlayerRestored?
cuz apparently OnPlayerJoined is called too early
use OnPlayerRestored to know when all of a player's persistent data has been loaded.
okay
Make sure to read through the docs for both PlayerData and PlayerObjects to understand what's available in each and how to program for them!
I've just successfully made a script that knows if a player already visited a world. Already trying something else more fancy :3
Thx !
That's great! Good luck with the fancier stuff ๐
yay I try to make a join counter and display a top 10 of best joiners :P
when comes a persistant client version for quest? I can't use PCVR for testing 
It's important to note that that is the worst-case scenario of playerdata being loaded up to the max. It is fair to be frustrated, but also that's one of the reasons for those limits being set. And while those limits aren't going to be appropriate for larger data, I do think it's still totally fine to use for small amounts of data, and there are many many use cases where that is the case. I don't think it's fair to dismiss an entire feature in all use cases just because there's a small subsection of advanced use cases where it's not appropriate.
Playerdata and playerobjects go well together because they fit into two sides of the same coin. Playerdata is good for when you have basic, simple scripts that just need to save some data occasionally and they don't care where. Playerobjects are good for when you start needing objects per player, high frequency data, or large amounts of data.
Some people are looking at this and the only use cases they're interested in working on will immediately put them straight into playerobject territory, and that's great! That's what they're for! But that doesn't mean playerdata is useless. it's just designed for a different use case. And it's not the end of the world that a 5kb playerdata serializes a few extra times because a handful of different prefabs save to it when the user interacts with them.
so wait I did read again and again and I realize its not possible to make a global leaderboard?
That's correct, you can only see data from other people in the same instance
ah ok. Do you think that it is something that could be added in the futur? Like accessing an entire PlayerData from every instances
Anything can happen in the future but it's safe to say that won't be part of this release
base64 encoded?
I really want that feature, so my home world plays something else when I load in.
I mean you can already do that using Player Objects, but it's a bit pain to work with
I have an idea of leaderboards. You can make a leaderboard of the current instance. If you save it and refer to it in the next instance, you'll get a merged leaderboard of two instances, which ranks people you met in the game.
Also, you can read the leaderboard other players hold and merge them. By doing so, you can make a more large player-based leaderboard.
but you can only access localPlayer data from the persistence, so its not possible to access someone else PlayerData
unless one player saves everything into one string, but this will quickly going beyond the max limits
Yep, binary blob of everything I want saved in the world base64 encoded into a string for more compact storage.
It extends quite far down. Lol
Highscore data will be synced regardless of persistence anyways, so everyone should be aware of the it already.
And yep, that's my plan to, I'm going to make an infection system where people get infected with everyone else's highscore data. ๐ฆ
persistence is still useful if a player leave and join back so his highest score is saved. But if he is offline, then his score will be temporary "lost", which is not ideal for a persistent leaderboard
That's what the infection system will be for though. The theory is that it will spread like crazy as long as you have at least one friend who visists other people from time to time.
Like yeah, you will have to join people, but chances are people who care about highscores will do so anyways
Per world persistence would obviously be more ideal
thats really not ideal because that means you will have to use bot accounts to watch instances 24/24
they better have to add global persistence before half of the game is populated with bots only
looking at the repetition in the string, I wonder if you could use something like gzip or another compression protocol to make it even smaller.
like a spreading virus lol
That's going to be the plan, currently just testing but once I actually implement everything it's going to end up somewhere close to the 100KB limit, and I need four of these. Compression is definitely needed.
Although you must be with the player in the same world instance, you can read data of non-local players (as udon variables on Player Object for the player or via getter methods of Player Data that have a player parameter). It is not restricted or protected at all.
Is it https://docs.unity3d.com/ScriptReference/ObjectNames.GetUniqueName.html by any chance? I know that VRChat SDK basically have a lot of wrapper/proxy functions for underlying Unity API.
That what I'm wondering as well, does it maintain a synchronized unique name list or is it just local?
Also, it has different parameters
Yeah, the existing names parameter, which is why I am suspecting that Networking is providing the list of pre-existing names
maybe
Also upvoting your feedback
How can I clear the client sim persistence data?
VRChatSDK > ClientSim PlayerData and click the trashcan
Ty!
Surprised I havenโt come across anymore persistence test worlds. Was hoping to find more since the start of the beta then just the three so far~
momo posted more on #1294096284722004122 actually.
Oh neat. Should probably have a better title for it though. Something likeโฆ โPersistence Test Worldsโ
yeah, I renamed.
Yeah that should do I think.
hope so
android beta channel when
it's simply #android-discussion now on days so too late to start new.
I meant a beta channel for persistence
like a way to be on the beta on android
afaik its not possible rn
I have a big pool of android users that I can be doing testing and UX dev with and I cant test with any of them rn ๐ฆ
ehhhhh id disagree based on info I have
(namely the ammount of time this has been in dev in closed beta)
ah...
already so many canny since become open beta so maybe once it's got clear some could be.
Can you get player name and add it to a global world leaderboard with the beta or is it just saved settings?
interesting ๐
there is canny for it, I saw here earlier.
with the current way its underlyingly wrote, not going to happen any time soon
IMO
Also will relink thread again for more visibility~
https://canary.discord.com/channels/189511567539306508/1294096284722004122
what world idea are you trying to make ?
?
@errant token, tested out that 'Persistence RPG' world you linked in the world thread and for some reason, it only worked some of the time. Other times it would either spawn me with the wrong position and/or rotation or Persistence just didn't kick in at all.
https://files.catbox.moe/mn0xmr.mp4
has anyone else ran into World version is incompatible with this instance.
Has anyone been running into weird bugs in non-persistence worlds while running the beta and hanging with people not on the beta? I encountered quite a few issues earlier today but have no idea if it was coincidence.
The first world I had issues with was The Pool Parlor (https://vrchat.com/home/world/wrld_99bdc4c6-b80c-49f3-aae0-5d67017d8340). First the pool table broke and a rejoin did not fix it. We ended up having to make a new instance. Then the world's player voice controls glitched out and made me mute on my friend's end. A rejoin did fix this.
The second world was GeoLocator (https://vrchat.com/home/world/wrld_8abba687-ebfd-4356-846d-d069976df375) where I joined on two non-beta using friends. I was working fine on their end but on my end everything related to those two was broken. Peaking into a logs there was a lot of UdonBehaviors crashing due to "Object reference not set to an instance of an object."
The final world before I went off the beta was Rumbleหธ Disaster Survival (https://vrchat.com/home/world/wrld_8e30e0e5-aae0-4452-9281-6832f5e49b06). The world itself seemed to work fine, but one of my friends didn't exist on my end. My other friend could see and talk to them, but on my end they weren't even showing in the player's in instance list. Also checking the logs they never triggered any on join/leave events.
Is it just me or the LeaderBoard example just give up after the 2nd test?
Your script should either check if it is null or you should not destroy the object.
VRC.SDK3.ClientSim.ClientSimNetworkingUtilities+<>c__DisplayClass12_1.<ConfigureNetworkOnScene>b__1 (VRC.SDK3.Components.VRCPlayerObject pp) (at ./Packages/com.vrchat.worlds/Integrations/ClientSim/Runtime/Networking/ClientSimNetworkingUtilities.cs:67)```
nvm apparently every examples just only works once then they are all broken
Enable Unity Configurable Enter Play Mode https://docs.unity3d.com/Manual/ConfigurableEnterPlayMode.html Enter Play mode > Persistence Breaks
There is canny which said, if master is on Open Beta, then non-beta joined instance broke instance IIRC.
Yeth
Are you referencing https://feedback.vrchat.com/persistence/p/instance-breaks-when-persistence-beta-user-joins-persistence-enabled-world-creat ?
This canny seems to be referencing new, persistence-enabled worlds (the worlds I encountered issues with, at least as of yesterday, were last updated before persistence went into open beta). And the issue described is different from my own. This canny, however, seems closer to the issues I experienced: https://feedback.vrchat.com/persistence/p/other-players-and-incoming-networking-occasionally-do-not-work
ic
What if I made a world where you can paste avatar IDs into something and it would save them and then load them all on the pedestals every time you joined to make like a pseudo avatar favorites list or would making something like that against TOS since itโs a VR chat plus feature to get more favorites?
I have a feeling they wouldn't really mind it tbh.
hope so
Considering you can also just bookmark avatars in your browser.
Did you mean to opst this over in #ios-discussion? Your answer is yes, VRChat doesn't limit what devices can play on the beta even if it's out of spec. The 16 Pro is well over equipped for playing VRChat anyway
A18 Pro is basically an M1 chip in a phone, it's really overkill but it'll tackle majority of gaming and even some console games like resident evil
Same, went to Audience Anarchy with some friends last night and the UI panel that normally appears in front of you was stuck outside the walls. Had to switch to live to fix it.
What do you mean by this? VRChat is not supported on my device (This is not a surprise to me, as my phone is really old; LG G4).
Any apple device can access the iOS closed beta, I forgot to mention that you will encounter frequent crashes on low spec devices with less than 6gb of ram.
I don't think it's different from prismic avatars world which is allowed
Regarding Pool Parlor voice issues: we are aware of that glitch, it is rare and we still don't know what triggers it. I think Toaster is also not yet using the latest version. This behaviour is not new on this beta so most like not relevant. Also tables always break, although it is more rare nowadays.
It's a little different in that it lets you specify favorites, but yeah, the fact that you still have to go to the world makes it not really the same as VRC+ since you still don't have access on the fly. Nothing about that should violate any existing TOS/guidelines.
Relatedly though, have had plans for implementing a favorites system in the search world for over a year now, had just been waiting on the persistence feature ๐
Built-in persistence also means I can ditch my hacky web request system for storing persistent world options. Excited this is finally here ๐
Any plans of any other persistence stuff? Might be interesting to have a avatar fav system for players like what someone else was mentioning.
Or a search history
How were you doing session identification?
I would have thought he was talking about an individual's session settings
Eh, but that wouldn't need a web request system
My previous message before that one was regarding that: a favorite system in the world has been planned for a while now, was just waiting for built-in persistence to release. I'll also convert the existing stuff that persists over to the new system so it works for everyone, and will probably expand it to cover some of the other world settings.
In the original version, ip of request + hash sent from the user based on their username, which was combined and itself hashed on the server, and used a cookie to identify the session. This allowed multiple people on the same connection to be differentiated. But when they removed cookies from the request, I had to reimplement it, so it was no longer able to differentiate between users on the same IP. All still hashed though, nothing stored raw.
Looking at the logs, the two times loading into the world with a broken pool table I encountered multiple UdonBehaviors breaking immediately due to unhandled null references. While I couldn't glean too much information from the stack trace, they all did have references to OnDeserialization.
Could a broken pool table state on the "host" player's end cause that?
Maybe the beta struggles with the two variants of OnDeserialisation (one with and one without the parameter)...
Idk if the world uses both
Has nobody else uploaded any test worlds for persistence? I haven't found anymore then the small handful already out there. :v
Was focused on jam world polish first. Have a few things in mind.
@fluid trellis posted a link to a persistent version of VRtual Park in his server, dunno if it's ok to share the link here but saying it exists should be ok
thinking same
Here's the link to my world https://vrchat.com/home/world/wrld_3c2d7b2f-2543-4ed6-9913-23482cd45901
It uses player objects as a replacement of cyan laser's object pool, and player data to save data.
added to #1294096284722004122 too.
For some reason, I am unable to join that world anymore, I'll take a look
oh....
Seems like if you're not on the persistence beta and join a world that has persistence it will sometimes break and kick you out. Someone else had this issue when adding persistence to their world
Got a weird problem, on the persistence beta if vrc disconnects me it loads me back in but I'll be alone, my friendswon't see me until we make a new instance, this problem has been really bad today I'm switching back to the regular open beta branch, it only happens with the persistence beta
Can we please get persistence in the home world so that we can turn the music off ๐
I'm stupid, I was on the open-beta branch, I thought that branch had persistence.
It's only now that I realized that there's a persistence-beta branch
The world works on persistence-beta
Oof, that I agree
...and miss out on a comfy beat or seasonal tunes? nahh
anyone notice that the linked persistence docs goes to a page not found?
huhh
i swear i didnt delete it
Sorry. Hungry.
I think now back on service.
https://vrc-persistence-docs.netlify.app/worlds/udon/persistence/
Persistence is currently available as a closed beta. Only invited members of the community can access it at the moment.
odd...if I go from google, it works while direct link not works...
ahh, URL domain change...
pinned URL changed
gotta love domain changes ๐คฃ
๐
Looks like old version of the docs.
Last updated on Sep 17, 2024
thanks for the heads-up, someone must have overwritten, I'll fix that asap
thanks, I'm 1 finger away from ping you.
fixed now!
Thank you
How I sign up for the beta
From the PlayerData docs:
Keys cannot be deleted after being written.
Does this mean that world creators have no way of clearing any player data?
I know I can set the value to whatever is the smallest, but the key is still gonna exist forever, take space, and be synced to every other player until the user manually resets his player data?
What worlds support this feature currently?
Tbh someone should make a persistent music toggle prefab so that alot of worlds have it as an option ๐
Hmm unironically, that's something Architech could actually do by rolling out an update to use this.
Basically so that the ProTV Prefab would have a toggle for a script to check the persistent to see if there is a toggle to disable autoplay.
The only problem with that is it basically messes with developer's access with the persistence storage. I could see people discussing on standardizing the storage access between prefab.
Not really, it should just be a different key
That works
Or just completely independent if he ends up using Player Objects
Oof, hopefully that's not a forever thing
Maybe they want to make sure people aren't doing shenanigans before giving the ability for scripts to delete save data
whats this
wowwie
I hope this bug is fixed soon enough, definitely been a bit of a headache. ^^;
https://feedback.vrchat.com/persistence/p/instance-breaks-when-persistence-beta-user-joins-persistence-enabled-world-creat
For now though, need to hop off this branch until it is patched. :v
(assuming that bug is fixed^) If i upgrade my world to the beta, will people who arent on the beta still be able to join it?
I've not tried any of the beta sdks before.
They will be able to join, they just won't be able to make use of persistence.
Thats fine. Ill just make sure to leave all the existing functionality as is and only add new features with persistence so it doesn't break any existing features. ๐
From several tests on my world if you use "Player Data" methods only if you get the OnPlayerRestored event (which is not triggered on non-beta clients) they are fine. But if you use any "Player Object" (such as in then persistent pen example) they will break your world and non-beta clients will crash on joining that world.
Has that been reported on the canny?
No, because it is not a bug. Persistence is still in beta and should not be used in public worlds, if you do you should check that new methods are compatible with non-beta clients.
Mmmm fair enough.
@ornate mango Thanks.
https://ask.vrchat.com/t/a-list-of-worlds-using-persistence/27318
Persistence is now in open beta! To help everyone find cool examples of worlds that use Persistence letโs share here their world links with a little description of what the world is about, so everyone can try them out and have fun seeing how that world creator thought of using Persistence. Here are some of our official examples, please follow t...
I was about to go to your thread now to cross link, kinda thought of mixing your thread with the format we used for the dev update and open it up for everyone to share theirs
If you wish, feel free you do.
alright, pin link replaced.
If you want to try out a few worlds with Persistence in them then check out this forum post!
https://ask.vrchat.com/t/a-list-of-worlds-using-persistence/27318
If you have made a world or prefab with Persistence feel free to post it in there as well!
Also, check out the Persistence Docs!
Persistence is now in open beta! To help everyone find cool examples of worlds that use Persistence, letโs share world links with a description of what the world is about. Try them out and have fun seeing how that world creator thought of using Persistence. Here are some of our official examples. Please use the format below to if you want to ad...
Docs link missing....
idk what you are talking about 
persistence docs link on netlify....
I... I was making a joke because I edited the message and added the link 
got an example uploaded last night for others to see.
https://vxtwitter.com/jetdog8808_dev/status/1846982210739700213
A WIP example for my Easy UI Persistence in #VRChat .
I still need to work on the editor script, and also have plans for a auto save option for it. https://t.co/J2iCt5J55W
Is there a way to check if persistence is available on a client? (on the beta) So that specific behaviors can be run / not run if its available
OnPlayerRestored(VRCPlayerApi player)
What, just check if that function is defined?
No. It's an event on UdonBehaviour which is recommended to wait to fire before trying to read or write persistent data
The event will not fire on clients without persistence
There's no way to try something without the behaviour crashing
Hmm, guess i could just have an empty persistence object that enables all the other ones when / if it's OnPlayerRestored succeeds.
Currently world instances created via the web ( VRChat.com ) may not function correctly with Persistenceโ so instances need to be created from the client using
you gotta stop asking about modding
against tos and against the server rules to talk about it
Also completely irrelevant to the channel
If you have an actual Security issue that should be handled here: https://help.vrchat.com/hc/en-us/requests/new
Just got onto the persistence beta because of this world
https://vrchat.com/home/world/wrld_f2b1756f-fc8e-4f10-bfdc-6458f0424a09
Anyone know if it's working? It says it's in beta, which I assume is this beta. I don't know much about the persistence system so I'm unsure if I'm not doing something right or if this world isn't functioning. I simply did some stuff to progress and then rejoined to see if my progress persisted. It did not.
This world is apparently making use of persistence due to the fact Iโm running into the one error bug with it but so far nothing seems to be persistent. The beta though Iโm assuming refers to the fact that this world is still very much a work in progress. It tends to break a lot.
Interesting, good to know! Thanks
Weirdly this world has syncing issues in the non-persistance version of vrc
It was bugging out constantly for me and a friend even without persistence so I'm not sure it's a good example right now.
hi guys, really just kinda curious, is there any usermade prefabs using this new open beta? Im assuming theres not, due to this being somewhat new haha, but just kinda curious if anyones dropped anything!!!
Yes, blackrat's picture loader is a good one
thanks for the recommendation? are there good places to find these?
Download
This release is available via the Creator Companion as a VPM package!
โฌ๏ธ My VPM / Creator Companion Listing
Info:
Since this release is quite big I made a video showcasing it:
https://yout...
Been integrating the persistence into my world, just not sure when Persistence would roll out into mainline VRChat, but I imagine it'll be soon.
I'm expecting Persistence to be ready for Live in sometime Mid to Late November.
It's a big update so will cook for at least a month's time.
it might only be using the persistence beta to try out the player objects
Possibly.
is this a beta issue?
@alpine kettle, this happens when someone on persistence-beta joins a persistence world, and the master of the instance is someone not on the persistence-beta.
oh odd. didn't know @craggy cypress added persistence to his Sky Lanterns world
Tagging to double check that that's the case
No I didn't
Hmm ๐ค
If it's not a persistence enabled world, could it be because I made the instance, but my friend loaded in before me? (I'm on beta, they aren't)
possibly
Yes, "made the instance" from the technical perspective always refers to the first user in the instance. Who clicked the "Create instance" button is irrelevant.
Gotcha, but the world wasn't persistence enabled, so then I'm at a loss for why I got the error
I wonder if it's related to the fact of someone in the persistence-beta pressing the "Create Instance" button in-client and someone on a live or open beta client being the master of that instance. The only thing that clues me to this is specific text in the official persistence test worlds descriptions that says--
WARNING - Instances created via the web will NOT function correctly with persistenceโ you must create a new instance from the clientโค
Persistence beta is missing the thumbnail for the stickers and emojis
Yup, known as a regression. Already working on it!
There are a couple here, everyone is welcomed to add their own as well 
https://ask.vrchat.com/t/persistent-worlds-showcase-share-your-favorites/27318
Persistence is now in open beta! To help everyone find cool examples of worlds that use Persistence, letโs share world links with a description of what the world is about. Try them out and have fun seeing how that world creator thought of using Persistence. Here are some of our official examples. Please use the format below to if you want to ad...
oh awesome!!!
Will this be fixed alongside the other jittering behaviors with objects with physics (if its not on the canny i might make one)
Not sure but could be. If you can't find it in canny best to make a post, especially if there are specific steps to reproduce the issue (sometimes you may have different steps than what we can reproduce internally during testing)
https://vrchat.com/home/world/wrld_0c89fc81-d409-458d-9cca-a275ef614c57 tell me if this world works for u guys
@dawn elk, the thing doesn't appear to be working in general. ๐ค
Oh I see, there we go.
I know there are some issues with creating instances, but has anyone implemented both live and persistence saving side by side so far?
I have a thing I'm doing that I could do with persistence and just want to make sure I can just upload it with the new sdk so it works both on live and on the persistence branch as long as they create their own instances.
Or should I just wait for an update lol
still same problem. it look like it work but it dont work
You didn't change anything though ๐ค
Are you maybe using chat gpt or something? It's definitely not up to date with the new API. You could try giving it the example code or even the whole page and see if it can help you that way. The code example itself is pretty straight forward though.
i did break my world. so for now i just removing save data. try again other days
What some creators are doing is publishing as a separate "beta" version, so once the instance issues are resolved they have the persistence feature already tested and can publish as the main world version
with persistence in beta, are one time purchases far off?
or are they already implemented
kind of like gamepasses on Roblox, buy once keep forever
we're getting there on both!
Funny thing about player objects, since they litterally just use networking code my stuff works completely fine on both live and the persistence beta
And even if only the instance owner is on p-test my stuff will still work cause I'm doing everything on their client and then just use the networking I already had setup for it
I'm going to guess they have multiple teams working on different things at the same time. Generally speaking, development on persistence probably won't slow down development on one time purchases.
microtransactioncore ๐ค
I'm not sure if this should be obvious or not, but just incase, I noticed some weird oddities if you try to join a world built on 3.7.2 (NOT 3.7.2-persistence-beta.1), with the persistence beta client
I am guessing the persistence beta client hasn't been updated with the new Udon signing stuff?
was noticing some stuff using manual sync with OnPreSerialization() and OnDeserialization() no longer functioning
Edit: Fixed in OpenBeta Persistence Build 1534
I think the persistence-beta branch is just slightly out-of-date on some features, so this could very well be the case, yes
I find that it crashed the world too so I recommend using the test world to get it to work. O.o
I was hoping to avoid that lol
So will it spawn player objects even on live? Or are you talking about how it spawns and syncs only on p-test?
I guess I'll have to just try it out myself after I'm done with some other stuff. Maybe I'm being too hopeful here
They donโt spawn on live no
Good to know, thanks!
after more testing*... on the beta persistence client, the issue with manual sync with OnPreSerialization() and OnDeserialization() not working might not be world version specific
regardless of what version world I join (3.7.2, 3.7.2-persistence-beta.1, older than 3.7.2) I'm noticing issues with it not functioning at all
Edit: Fixed in OpenBeta Persistence Build 1534
Howโs it going
what?
anyone else observed this?
https://feedback.vrchat.com/persistence/p/executionorder-broken-in-clientsim
Wonder if persistence branch is gonna have any updates soon~
could it be this? https://feedback.vrchat.com/udon/p/1123-udon-objects-with-udon-children-initialize-late-despite-execution-order-ove
Yea that looks similar, makes mine redundant then I guess. Didn't see that one.
it's an old bug
But mine is persistence specific, didn't have these issues before...
might be new, then
I will check later on live to compare the client behavior
I tested the non-persistent version and to my surprise it is also a mess, the bug that was reported by orels is still present.
You really have to smack the [DefaultExecutionOrder(ExecutionOrder)] into every single class file for it to work.
I haven't tested that part on persistence again yet though...
this might explain some random bugs in my code that I could never reproduce...
Personally I've avoided using ExecutionOrder and designing my code without it instead
I rely heavily on it:
namespace TLP.UdonUtils.Runtime
{
public static class TlpExecutionOrder
{
public const int Min = int.MinValue + 1_000_000;
public const int Max = AudioEnd + 1;
public const int DefaultOffset = 150_000;
public const int DirectInputStart = -1_000 + DefaultOffset;
public const int DirectInputEnd = -1 + DefaultOffset;
public const int DefaultStart = 0 + DefaultOffset;
public const int DefaultEnd = 999 + DefaultOffset;
public const int VehicleMotionStart = 1_000 + DefaultOffset;
public const int VehicleMotionEnd = 1_999 + DefaultOffset;
public const int PlayerMotionStart = 2_000 + DefaultOffset;
public const int PlayerMotionEnd = 2_999 + DefaultOffset;
public const int WeaponsStart = 3_000 + DefaultOffset;
public const int WeaponsEnd = 3_999 + DefaultOffset;
public const int UiStart = 10_000 + DefaultOffset;
public const int UiEnd = 10_999 + DefaultOffset;
public const int AudioStart = 11_000 + DefaultOffset;
public const int AudioEnd = 11_999 + DefaultOffset;
}
}
As far as I can tell in U# DefaultExecutionOrder only applies to the order that Update/LateUpdate/FixedUpdate will fire on scripts
The directive that it transpiles into in UdonAssembly is even called .update_order
So checking the order in Start won't do much
Start gets fired from Update internally so it's affected, see: ManagedUpdate() in UdonBehaviour.cs
Ah awesome, thanks for clarifying that
Good to know
And PostLateUpdate and the first OnEnable event from the looks of it
Well, I am finally dipping my toes a bit into Persistence stuff. And it has been pretty confusing to try and handle saving lots of data for my world while trying to remain as optimized as possible and also readable and understandable.
I got like, dozens of achievements in my game, each one of them saving their state and date of unlock(through a bool and a long, though I could probably just rely on a single long since if there is data in that index, then the achievement must be unlocked but that's asides from the point rn)
I'm trying to not use some sort of jank system where I iterate over the amount of achievements and ask the PlayerData.GetLong() like, dozens of times. I wanted to use a mere byte array because that seems faster, one single call for the PlayerData and then process the byte array myself. However there is a lot of limits around trying to manipulate and use byte arrays effectively? Lots of work arounds and currently stumped
can you call .Length on the byte array instead of .Count()?
Yeah, that seemed to let me compile U#, and it seeeems to have saved an array properly, now I am going to try and read it and see if it's fine
kind of forgot you usually use .Length on []arrays and not .Count()
Currently saving around 64 achievements so two arrays of bools and longs, and converting into byte arrays each
Okay, that seemed to work yeah
No weird issues
I'm glad to see you're making progress. Is there still anything blocking you?
From what I can see, you could probably save some complexity and space by skipping the boolean array and just using longs with a value of 0 as an 'empty' entry.
(as you theorized yourself)
Yeah! Probably gonna do that. 100KB is a lot but, considering this is simply achievements, and I am still due to save a lot more data, I am not looking forward to and I'll have to save as much space as possible
I still wished there had been some sort of implicit way for the PlayerData class to convert any type array into a byte array under the hood :< But hey, I guess I learned something new today!
for example, I'll have to save every class stats for every game mode (like this thing int[][] class_gamemode_matchesPlayed )
But I think I have an idea on how I want to approach this, still using byte arrays and concatenating names for the keys
you may want to consider using PlayerObjects for storing some of this data. For example, you could directly save and restore a long[] of achievement times instead of serializing to and from a byte array, and avoid serializing all the PlayerData every time any single entry changes.
Can you have multiple PlayerObject templates? And each with Persistence enabled on some scripts then?
This data does not change often, only when a match ends so there should be plenty of time for data to settle and send with ease.
Also since the players are part of a prefab to use for another world, I want to make sure I isolate the player elements from this "pvp mode" mini game so their PlayerObject only contain the essential
Again, unless there is a way to have multiple PlayerObject templates? Then I could consider using PlayerObjects instead for sure
Yeah you can mace multiple different player objects
Well, I guess might as well do that now
That kind of makes me wonder what the use case for large data with PlayerData would be if I am switching over to PlayerObjects for having too much data :S
We explicitly recommend against large data in PlayerData afaik, it's really only for small one-off settings
Oh, this might need some updating then D: From the PlayerData doc page
I was like "This is large data, but doesn't update very frequently, so it should be fine"
But I was not aware of being able to instance many PlayerTemplates
So I could have one PlayerObject template for my Player stuff like their inventory, stats, etc
Another PlayerObject template for my mini-game stats and achievements
And lastly PlayerData for player settings and perhaps story flags
I dont think I am of a fan of making an array of arrays that syncs :S Never done this before and not sure how I should even do this
int[][] class_gameMode_variable where the first index of the array determines the class, and the second determines the gamemode
How would I go about preparing this to be part of a synced PlayerObject for my mini-game data?
Why not just use parallel arrays?
parallel arrays? you mean the ones like int[,] like this?
I think I remember trying them out but I couldn't use them? I dont remember why but I just know I ran into a roadblock, something that maybe wasn't exposed or it did not like how I was initializing it
int[] gamemodeArray = new int[10];```
Just keep the lengths of both arrays in sync, and you can address each with the same index.
wait I'm confused D:
this is only two arrays of ints right? that doesn't help me
because I need to store for every class, for every game mode
so knight_survival_bestScore
then knight_tdm_bestScore
and so on for every mode and then do
mage_survival_bestScore
mage_tdm_bestScore
for every class
and this for all my variables, bestScore, bestDamage, totalTime, etc
How many ints are you storing in the bottom-most array?
one int for class, one for gamemode. Any more?
just those two, I guess the full thing is this
public int[][] class_gamemodeGames;
public int[][] class_gamemodeWins;
public int[][] class_gamemodeScore;
public float[][] class_gamemodeDamage;
public int[][] class_gamemodeBestScore;
public float[][] class_gamemodeBestDamage;
And the bottom-most array in each of those contains how many values representing what variables?
contain the amount of game modes present in the game? And each contain well, the value that the variable is telling me
correct me if I am wrong, but isnt this what I am doing with these?
an array within an array, correct?
Yes. In the example there you have 3 elements in the bottom-array (S, TDM, B). Is that true for all the array variables you mentioned above? (class_gamemodeGames, class_gamemodeWins, class_gamemodeScore, class_gamemodeDamage, class_gamemodeBestScore, class_gamemodeBestDamage, etc?)
And are any of those bottommost values redundant across arrays?
Yes, all of them have the same amount of classes and gameModes
and what do you mean by redundant? As if, there were other arrays that stored the same data? Or if any of these share values between themselves from the list from either? Both would be no
They are essentially the master data holders, they hold it all, and I access their data whenever I need.
In principle, the idea is that multidimensional arrays of consistent length can almost always be expressed as parallel arrays one dimension lower. Taking your above example, it could be rewritten as this:
Instead of a single 2d array with 3 slots in the bottom-most array, you could represent it as three 1d arrays with one slot each.
If you had 5 elements each in the bottom-most arrays of the multi-dimensional array, it could instead be represented as 5 single dimensional arrays, each of the same length as the top-most multidimensional array.
in other words, int[n][m]; allocates a total number of space equal to int[m]; ... int[m];, where there are n int arrays.
This is going to be dozens of arrays by this logic :S I guess its worth noting that every game mode will have one total score, total dmg, and so on so...
I guess one benefit is that I am never going to serialize this data for anyone else, but that's going to be a loooooooot of arrays
That's fine, it may look like alot but it still scales. And your indexes across arrays remain consistent. Given you explaination, visualize it like this:
Each index in each array is your gamemode
so totalScore[gamemodeIndex] will return the totalScore value for that gamemode.
Would that work for your case?
Also has the benefit of letting you mix types in udon's limited array type mixing
Oh, you skippe the 'class' ! The playerClass someone is using like Knight, Bandit, Mage etc
So it's score/dmg/etc, per class, per gamemode?
Yes
That does get a bit trickier then since it sounds like you're working in a 3 dimensional array space
U# doesn't support multidimensional arrays, only jagged arrays
It's essentially a 3D array
That's okay. That's why I was asking to try to understand ๐
Yeah, sorry, semantic thing there. Implementation wise since they are of equal length though there's not much difference on the surface, just under the hood.
I have a feeling my system is going to end up pushing... A LOT of data
Yeah, looking at it now I see you were implementing parallel 2d arrays instead of a single 3d one, so you already had the concept covered.
Huh, I guess I was already doing parallel arrays then, yay haha
In that case, how many gamemodes and classes do you have?
That can scale as I want to add more BUT
Classes = 8
Game Modes = 5
Right. Well it's a bit more manual, but if you smear out the gamemode dimension into their own variables, you could still manage to store the data as collections of 1d arrays, clustered by gamemode.
So this, then just make arrays for totalScoreGM2, etc
It's not ideal, but my I don't think udon can sync arrays of arrays, so it's either that or serialization as a string or something else
You know, now that you mention a string...
Wonder if I can brute force save everything in a string that gets converted into a JSON/DataDictionary
or rather, convert everything into a datadictonary, then into a json, then into a string.... god
Especially if it's just when you save/load for persistence, that's probably the best way
I cant believe I am about to do this
Because I could have arrays of strings, and those strings are just technically more arrays
Well here goes nothin'
Yup! Sometimes you gotta make do with what you've got to work with. And even if a bit roundabout, a possible solution is still better than no solution ๐
Gotta cope until Udon 2 comes out so we can store data in structs
yeah no, I'll take this tbh! When I think about it, these strings would probably be like "[0,2,3,4,5]" so they are not even that big
I mean if they are small enough values, you can also just bit-pack the data into some other datatype ๐
What's a ulong except 8 bytes each up to 255 stuck together hehe
Oh jesus...
I dont know if I am ready to bitpack things. First I want to make sure this works
Can also create a series of arrays int[] BestDamageGameMode0...int[] BestDamageGameModeN and use Get/SetProgramVariable to manipulate them
Except it's value, per class, per gamemode
oh
right that too
its essentially a 3D array
or 2D arrays on parallel
so uh, I'm not gonna write all of them down like that
Its okay, I appreciate this much help tho
Good luck!
any worlds that use this well? curious
It just occurred to me that if you only had 4 gamemodes, you could actually pull this off with arrays of vector4's, since those are an udon syncable type. Would effectively function as an 2d array where the bottom-most array is limited to 4 floats. https://creators.vrchat.com/worlds/udon/networking/
Multiplayer experiences are the heart of VRChat, so creating a world that reacts to players and synchronizes the data between them is key.
Aawh, alas I wished
You could also use Color32 to act as 4 bytes (0-255) without having to bitpack
But yeah, just food for thought for anyone else who comes across this lol
12 ints
2 floats
6 string[]
4 int[]
4 float[]
is the total tally of elements I need to serialize everything
I really hope I dont run into the problem I ran long time ago
Here's a quick question actually focused on Persistence. Does the PlayerObject with synced values... have to send a SerializationRequest in order for the data to save?
Considering this is the only thing I got after only setting the variables... uh, not sure if its working lol
*Object is networked as Manual
*Object with the script has the PlayerObject component
*Object with the script has the Persistence component
you have to requestserialization oh god
Yes, data is persisted on the server where network data goes through, so if you don't serialize it, it won't be stored
at first I was confused, but after that it makes sense
Alright, I saw that my data was being written but not read. Turns out JSON numbers are stored as doubles whoops
But I think with this, I have managed to understand PlayerData and Objects, and how to work with them
Neat
I have a new question. If I were to update the names of variables in this script, would they no longer get that data again?
As in, their previous data is lost?
Yes, same rules as when you upload a new version of a world and someone in an instance rejoins.
Gotcha, thank you :3
Now that live and open beta don't crash worlds when persistence is enabled, I've implemented it it my world in place of the code system.
The code system is still going to be there for a little while after persistence makes it to stable.
https://vrchat.com/home/launch?worldId=wrld_aa856cfd-698a-4a29-bf73-e065fa5c2cdb
Just went to check it out with my friend! Very solid adaptation of Lethal Company :) !
I will mention we did run into some bugs or something like that.
Because after we died all my stats got reset? And my friend couldn't even click on the achievements anymore.
Thanks! I believe the stats themselves are okay, the stats display itself may have some update issues as it's fairly new, but I will look into it. I certainly do probably still have some bugs lurking about.
Oooh okay sure! Also forgot to mention that this only happened after my friend killed me and themselves using a pipebomb while we were selling scrap
Anyone else no longer able to visit players on the live client? I keep getting "World is incompatible with current platform" when trying to use the persistence beta client with regular instances now.
Same here
I assume this is because the persistence-beta doesn't support Udon Code Signing yet
if the world supports Udon Code Signing (3.7.2) and the instance master's game client supports it (live build), you probably won't be able to join
I would honestly only use the persistence-beta to test persistence related stuff right now
oooo yknow, that's a pretty good point
