DoroFuyutsuki
So are you treating the static elements like templates and then saving the full item's properties into a database to cut down on references, or are you linking all the base values into the instance through reference and only storing deltas in the hash?
Both approaches have their advantages and disadvantages, mainly in how affecting individual instances of items takes place. Very curious to know if you've taken an approach of de-normalization here as I have an analogous case at work that is under live development.
Oh yes, it is more like deltas - though not strictly. The two have very different schemas, and not everything in the definition has the potential to have a live data override: and many live data properties are more "derivative" than a direct overriding of a definition property. For instance, the definition has properties pertaining to how sockets are first initialized, but all that content strictly exists for initialization purposes and then ends up as a different set of data once initialized.
As far as referencing them at runtime, the game side can locate definitions quickly because on their side these definitions are in sequential arrays and referred to by index which allows for very quick retrieval of that static data on demand. The live data for a character will store instance IDs for an item, and also it essentially stores the index of that item in the definitions, at least by the time the characters inventory is pulled into memory. (There are additional complexities in the g...
Read more