fungus icon indicating copy to clipboard operation
fungus copied to clipboard

Thoughts on how the save data should be encoded

Open CG-Tespy opened this issue 3 years ago • 2 comments

I've been working on the save system, adding unit tests and such, and I've been thinking... Perhaps using StirngPairs to represent various types of save data is too limiting. Devs may want to attach special metadata to the save contents, which can do things like help fix glitches or import save data from one game into another for goodies.

I am thinking of going instead with a flexible interface that allows devs a lot more freedom than a key-value pair of strings.

What do you guys think?

CG-Tespy avatar Sep 19 '21 01:09 CG-Tespy

Just now seeing this.

I think key value pairs of some kind will be the most flexible for developers who aren't familiar with programming and should work with Fungus's workflow. I wouldn't reserve it for strings though. It's a little outdated but I would look at this PlayerPrefs replacement for a reference of how to handle it. You'll have to make separate arrays for each type, but that will allow the same control users want without having to cast/revalidate data too much.

The only real other option is to use a binary class to store information and encode it into a file, but that requires some code writing by users since they'll have to add all of the data they want to save to the saving class.

Arylos07 avatar Oct 14 '21 21:10 Arylos07

I think key value pairs of some kind will be the most flexible for developers who aren't familiar with programming and should work with Fungus's workflow.

How are devs supposed to save their own custom types without programming, though? I thought it was a given that when it comes to encoding save data that isn't supported by the system right out of the box, users will need their own custom scripts.

CG-Tespy avatar Oct 17 '21 22:10 CG-Tespy