I’m a programmer and most of my work is dealing with internal systems so its rare for me to have something I can show off visually… But I still want to post about the cool things I make soooo…
One of the big reasons I found myself dropping projects is because I constantly am re-inventing the wheel for every project, making a new data system that handles player data and saving, making a shop, whatever you can think of that’s in pretty much any game on roblox… while some of these are rather easy, it still takes time and I can instead focus my effort on the actual game loop…
In an effort to reduce development time I’ve started making my own “library” that I can literally use in any game and it’d… just work… no more debugging every time, no more spending unnecessary hours making something I’ve made before…
All that being said, I thought i should show off how one of the systems in my library works…
Player Data Suit
Features
- Internal Data handling (Reading/Adding/Updating/Deleting)
- Data Saving/Loading
- Backup and restore
- Data versioning
- Data repair
- Subscription based Server → Client data streaming
So this is all modular and you can choose to not use any one feature…
How it works, player’s data is stored in a module that the server can use to handle all player data…
Data Versioning: is a folder which contains modules of all the data versions you’ve had throughout the game’s history, any new player would have their data set based off the latest data version module… if a player joins with super old data version (i.e they have 0.5 while you’re on 5.2) the system will automatically update their data structure without any unintentional data loss.
Data Saving/Loading: Uses Roblox’s Datastores, it saves the player’s data given from the Data Version they’re on…
Backup and restore Much like DataStore2, the game will automatically backup your data in either of the two cases (last data save has been longer than configured interval, or % of data changed is larger than the minimum configured %) Also has automatic restore should their datastore data be corrupted and/or missing (with an alert to the player once this happens)
Data repair: Sometimes when saving data doesn’t get saved correctly due to (somehow roblox issues) or a problem with how the data hierarchy is based on both version of which your data is from and/or latest data version. SHOULD any data get flagged for repair the player will be notified and as the developer you’d be able to see the data history for before and after repair.
Subscription based Server → Client data streaming: The system uses ValueObjects to share information with the client, where all of the player’s data is converted to ValueObjects and put in a folder in ReplicatedStorage. Everytime you update the player’s data in the module on the server, it’d update the ValueObjects, BUT only those who are subscribed to said data get the new values. As the owner of the data you’re automatically subscribed. If you want to allow players to read one another’s data you can subscribe them to the specific data object and they’ll automatically start receiving updates. (You can also unsubscribe, or add new data for the players at any given time)
Although the code is not open source, I thought to at least share my idea in case anyone else thinks it’d be useful for them to make.