Skip to content

Releases: PhoenixEntertainment/PlayerDataSystem

v3.0.0-rc.1

11 Jul 05:15
4b0233b

Choose a tag to compare

v3.0.0-rc.1 Pre-release
Pre-release

What's Changed

Full Changelog: v2.1.0...v3.0.0-rc.1


This release features a complete rewrite of the data system:

  • Data is now cached as tables instead of value objects.
    In prior versions of this system, data was cached in replicated storage as value objects. While this allowed for easy replication, it ate more bandwidth than it needed to, and it was hard to work with the data (had to convert to table form, then back to valueobject form, .Value spam everywhere in the game's code). Data is now simply a table, making it much more robust and easier to work with.

  • Data is now written & read via "data handlers", which serve as an interface between the game and the raw savedata.
    Previously, data had to be manually read & written to. E.g. if a game system wanted to read the player's coin balance, it would either have to directly access Data.Currency.Coins, or call a wrapper API like MarketService:GetPlayerCurrency(). Both had their own sets of problems. Now, this is handled at the level of the datasystem. Any part of the game can simply call ReadData or WriteData with the relevant "handler". No wrapper APIs needed, no ref updates are needed, etc.

  • Replication is now more efficient.
    The old system used value objects for replication, now replication is diff-based. When the server makes a change to the data, the name of the handler it used to change the data is replicated the client. The client then locally runs that handler, 1:1 taking the steps the server took to modify the data. This is similar to how replication with a state-store library like rodux would work.

  • Code that reads data can no longer accidentally write to the data.
    In the previous version of the system, if a piece of game logic gets a reference to the player's data for the purpose of reading it, but due to a bug wrote to the reference, the player's data would be updated. Now, if the game calls ReadData, it physically cannot write back to the player's data accidentally without an explicit WriteData call. This is accomplished by returning a copy of the player's data when ReadData is called instead of a direct reference to the cache table. This does come with a performance cost, but in most scenarios the cost is acceptable as savedata isn't (and likely shouldn't) being written to constantly every frame.

v2.1.0

16 Aug 15:23
9b65cfe

Choose a tag to compare

What's Changed

Full Changelog: v2.0.0...v2.1.0

v2.0.0

13 Jun 03:03
813b4db

Choose a tag to compare

Bump package to 2.0.0