[634] Optimal varp handling/saving
I'm currently writing my own varp manager to store all the different configuration data sent to the client. It will implement varp (or config), varb (or config by file), global config (not sure the technical name for this one) and global strings (not sure either).
The only thing I'm concerned about is how to optimally save the data that needs to be stored in the player save file. The most simple example of this would be the player's hitpoints which needs to be saved for obvious reasons. However, some other config like the world map blue marker can and should be ignored.
What would be the best way to handle this issue? Here's some of the solutions I thought of, though they're all kind of bad which is why I made this thread:
1- Duplicate the data by having a main variable (ex: "hitpoints" variable in the Entity class) and some kind of listener that updates the value in the varp manager. Seems like a pain to maintain/debug and just a terrible idea.
2- Have 2 different data structures for transient configs and configs that have to be saved. It's not as bad as the previous solution, but it becomes complicated when you have to specify each time you update a config if you want to save the config or not.
3- Save everything that's ever set in the varp manager. I feel like that would bloat the file saves with useless junk though...