Best Practice for Arrays of Objects


Hello, arrays of objects in the character backing data are a seriously common thing for anything from spell slots to gear. Is there an accepted best practice for handling these?

I note that chainsaws library serialises the arrays as strings. The other alternative would be to have numbered indexes in the key names (items_name_1, items_weight_1, items_name_2, items_weight_2). The other other alternative would be to just serialise the entire character backing data as a json tree structure, meaning it's just one clean deserialisation job for one clean data source without patching things back together.

If we want to support non-javascript writing DST creators then the key name indexes is the only option; they can just manually put in a sensible number of them, allowing people to swap DSTs without everything going boom. Does anyone have opinions on this?

Sign In or Register to comment.