Save & Load persistent World Data
in progress
Reimajo
World persistency would increase usability since old in-world settings could load automatically when the user re-visits the same world later.
As worlds get more and more complex, this is no longer a "nice to have" feature - it is now absolutely needed to make a more complex world playable (such as playing a long story through like "The Devouring" for people who don't stay 4+ hours in a single world in VR or in case VRChat crashes while playing it).
But it is also needed for grinding mechanics and worlds where you can build something and farm resources - something we are currently working on.
Tl;dr, either VRChat gives us a [StoreToDisk] string datatype (without a weird character limit) that saves to disk when it changes and loads again when the user joins the same world or we'll have to implement our own open-source solution reading debug log files and a third-party application running on people's PCs to send Ctrl+V to the window handle (as other world creators have already done it).
But either way, we definitely can't go on without a solution here and the current "ask a VR user to copy+paste a string" is not a good way to do it - especially since it's not crash-safe, so users lose all progress when VRChat disconnects the user randomly. But also since we still don't have a "Copy to clipboard"/"Paste from clipboard" function next to a TextInput field for whatever reason, something that would be extremely useful for VR users in general anyway.
Ideally, an instance could also specify to only load the progress from whoever created it, since it's not possible right now to know who's the instance creator in Udon, but that's only a minor follow-up issue.
Log In
Ophura
I need love
Fax
in progress
Persistence is currently undergoing Closed beta testing! It's a complex system and includes some other changes to VRChat's networking system. We hope the testing goes well!
Here are some examples of how Persistence might be used:
- Saving and loading a player's progress
- Tracking their inventory or currency
- Placing items or structures in the world
- Remembering their preferences or settings
At launch, persistent data can be used in two ways:
- With "Player Objects." VRChat can automatically instantiate this object once for each player. Scripts on player objects can have persistent variables.
- With "Player Data," which is accessible from every script. It's a key-value storage system for saving and loading variables associated with a player.
If you're curious, here are a few more details on how Persistence is planned to work:
- Persistent data is stored on VRChat's servers and accessible on any of your devices.
- Udon can access the data of all players in the instance, but only while they're in the world.
ᴋᴀᴡᴀ
>can access the data of all players
oh so many opportunities for malicious users
ShingenPizza
ᴋᴀᴡᴀ oh no, a world will be able to read some data that it itself has written in there before /s
ᴋᴀᴡᴀ
ShingenPizza world will not be able to do anything by itself. world (and it's data) is object, not subjects. It's user's clients doing things. So, one user client has access to other user's data.
ShingenPizza
ᴋᴀᴡᴀ well, no.
worlds are programs containing instructions that perform certain actions.
for all intents and purposes, they totally do read and write data by themselves.
yes, their code is executed in the environment of the client, but that's just like the client's code is executed in the environment of the OS.
possible malicious clients performing additional actions like reading and displaying to a malicious user all the data of all other players is a possibility, but not a big deal. I honestly don't care that some script kiddie ahole who joins my instance will know that i earned 1234 coins in a vr arcade.
let's just not make worlds asking people for their credit card information, or just not use them, and we're golden.
|KitKat|
ShingenPizza Sure, you don't care about someone being able to view your inventory or score. But what about your personal playlist?
photos you've taken, notes you've made, your chat history, etc. etc.
ShingenPizza
|KitKat|
video playlists? if i enter a link into a video player it's kinda public knowledge already. and why would that be saved?
photos i've taken? i doubt there will be enough memory available to save even 1 decent photo.
notes? i wouldn't input anything secret into a VRC world.
chat history? who writes in vrchat world text chats?
also wait, do you guys think that every world will be able to access data from every other world?
lmao no, persistence data in a world will be limited to that specific world :D
ᴋᴀᴡᴀ
ShingenPizza
>their code is executed in the environment of the client
yes, that's the point
>malicious clients ... not a big deal
Let's hope 🙏 EAC protect us (it won't protect us)
> I honestly don't care (about privacy)
So, no one else should care. bruh
> let's just (continue to not care about privacy)
bruh
> i wouldn't input anything secret
> who (does whatever) in vrchat?
If I don't do that, no one else do that. bruh
ᴋᴀᴡᴀ
Anyways, my point is it's better keep player data only accessible by local code which can expose it to synced variables via per-Player Objects only when necessary. A bit more complex, but much more safe.
Besides basic user's privacy it might be used in some kind of games, like password-protecting player's safe-room or keeping some seed for random objects secure.
ShingenPizza
ᴋᴀᴡᴀ
> yes, that's the point
ok, so either the world writes/reads data and i'm right, or the clients are also 'passive'/'objects' and you're not right either. :)
> Let's hope 🙏 EAC protect us (it won't protect us)
strawman
> > I honestly don't care (about privacy)
strawman
> > let's just (continue to not care about privacy)
do i even need to comment?
> If I don't do that, no one else do that. bruh
well, maybe not "no one", but no >intelligent< person, or one that cares about their privacy, does input their secrets into some random worlds visitable by possibly hacking randos. i'm sorry if you do.
Sydney_2l47
Fax Looking forward to this!
insigniaZero
I'm looking forward to customizable home worlds that use this. It would be great to be able to play interior designer and make my home world a home!
NothingToFear
It's disappointing to say that we still do not have the "cookies" in 2023.
miner28_3
NothingToFear: Likely gonna be 2024/5 feature together with Udon2 sadly. However if you need persistance right now, there are a few ways, including automatic ones with no user input.
Zeia Nala
Agreed, I have a few AMAZING game world ideas that could have this implemented via a network callback to a server to get a players game save information with encryption of course! :>
ville672
Would be nice to see a feature where you can use the same data for multiple worlds. For example saving player stats or settings for game worlds that have multiple maps as separate worlds but everything else is the same.
ShayBox
ville672: That would lead to the world save data being leaked and modified, think of an inventory editor for cheating in game worlds, or corrupting data from your game saves, etc.
ville672
Of course the data would be tied to the worlds you set and own. And editing the saves could happen anyways if not stored on the servers.
DarkSwordsman
I wanted to do a small write-up to hopefully provide a clearer goal for this feature request, and maybe to incentivize the devs, since the earlier this is made, the earlier people can include this feature in their new projects.
VRChat already caches information, notably your user settings and the expressions menu settings for countless avatars. This feature should be relatively trivial to implement, and they would need:
- World settings file in an existing cache location
- Local API interface to write and delete world settings, which Udon can use
- UI button for "Clear This World Data" on the world page view
- "Clear This World Data" and "Clear All World Data" probably next to the cache clear section
- Probably also a "size limit" that has a default value, but is configurable, just like the avatar download size
If they set the size limit to a default of 8 KB, you could have 131,072 world save settings files before you hit 1 GB (assuming they all max it out). 8 KB should also allow game worlds to store a significant amount of game state save information (like an insane amount). This would be enough for a pretty sizable JSON file. For example, this is 7.94 KB and ~400 lines and not even minified: https://gist.github.com/dark-swordsman/a2217935f33e49583664b2534bdf89ca#file-example-json
The feature should not be that difficult. It's just a matter of development time. I think it's a good idea to prioritize this feature so world creators can take advantage of it ASAP. It would drastically change how worlds can be used.
Invertex
DarkSwordsman I would like to say, that this JSON file is really not an "insane" amount of world save data for many types of experiences people would want to build... Especially anything involving world building. And it's easy for a game with progression it build up a pretty large save state to track the progress, especially if there's any content that's generated from gameplay and thus needs to be saved, like random item stats as a common example.
It would be nicer to see something like 64kb at least. That's still not a massive amount of data, and realistically only a small subset of users are going to hit that in just a few worlds. Though 1MB would be nicer to really allow some freedom there. Server storage is pretty cheap these days, that's still a million save data files maxed out just to hit near 1TB... which is only going to happen over several years and is a pretty cheap addition to the server costs all things considered.
DarkSwordsman
Invertex I didn't yet mention minifying or zipping. The file doesn't need to be stored in a raw text format. Either way, you're right. The point is that the amount of data is trivial when people probably have never visited more than 50,000 worlds in their entire lifetime if I were to guess, and most of them won't need to use that much storage.
peq42
its been a year and a half...
miner28_3
peq42: We're likely to see these things come AFTER Udon2 is FULLY released. Sad ? Yes.. But its very likely and that's why I can't wait for updates on Udon2.
Momo the Monster
interested
As announced in our April 2021 Dev Stream, persistence features are planned for this year.
soralin
Momo the Monster: Will this feature have a permission system? I think it would be prudent to request permission from the player before we start storing data.
Basically akin to a "This website would like to use cookies" opt in feature.
If the app 100% requires it, developers would have to design the "start" of their worlds to check if they have permission and inform the player it is required and they cannot play the game if they dont grant the app permission.
I think its definitely important to be doing things like storing data on the users machine with their permission. There's the possibility of abuse if we dont. (For example, tracking users behaviors over time, and then later if any way ever becomes exposed to send the data to others, we could end up with individuals creating tracking systems that violate user rights in some manner)
One thing that comes to mind is if a company created a library they paid individuals to add to their worlds which tracked users behaviors, that not only tracked their info, but broadcasted it to all other connected users, then they had bots that roamed rooms at random, connected with other users, and collected the broadcasted data.
This would be a big issue... if the users never had their permission requested on any of those worlds.
4Bakers
soralin: Or they could just slip a reference to it into the ToU and sweep it under the rug...
DarkSwordsman
Momo the Monster: Heyo, is this feature still planned? It is almost 2023, and having created a world now, I would love this feature for my users so I don't need to focus on user experience as much for setting world settings.
NishaWolfe
Momo the Monster: Any chance of this still happening?
The silence on this feature that was supposed to come out 2 years ago is concerning
Momo the Monster
NishaWolfe: It's roadmapped and being worked on, absolutely. We'll share updates when it's within 2-3 months of release to avoid building hype only to have it delayed again.
NishaWolfe
Momo the Monster: Thank you so much, that's such a relief to know it's still planned. Good luck with Udon2, and best wishes to the team!
miner28_3
This is seriously needed.. With the current Udon possibilities its possible to do a bunch of very cool thing but some of those do need to save data for later. There are few games out there that can take up to 10 hours to complete and sometimes people can't do it in one run and would like to save their progress for later. But currently it's hard for PC, very hard for VR and impossible for Quest..
Momo the Monster
Merged in a post:
Saving Simple Values Locally
J
J-322-ICA
The ability to save some form of simple values in a abritrary text like file somewhere in VRChat would be fantastic for games. Like a set of numbers that are called when loading a specific world ID.
Just by having the ability to save and call Integers, Floats and Bools, you could have a bunch of systems work off of those. Like knowing a previous high score, what quest someone was on, how much money someone has, If they have done the worlds tutorial, where they should spawn on the map, what items they own, their fastest time in a race, their kdr, just a whole bunch of things!
I'm no coder but what I'd propose is some sort of system where it simply keeps all these locally saved numbers in a text like file, saved somewhere in VRChats game files where it can't be deleted automatically or accidentally. Then have these values binded to World Ids and Names. Again I'm no coder but I feel like this isn't much a security threat either if the game only ever calls one value, per item, that are linked to world ids, and those numbers are only created or interacted with through the Udon scripting in said world.
I would love conversation about this because locally saved number could make some really cool things for worlds! even the simplest of values to save, and have the worlds decode would be really useful I reckon. Any more than that and thats like double bonus! 😁😁😁
Load More
→