March 29th - It's time for our Friday Highlights! You can check them out here!
Forum Announcement, Click Here to Read More From EA_Cade.

Dear Gurus: a simple save interface, what about it?

lord_eimeronlord_eimeron Posts: 12 New Member
Dear Sim Gurus,

mods have a lot of good and useful reasons why they would want to store additional save data per sim (speaking of sim_info here!) in a way that is possibly DIFFERENT to existing save fields:

* tracking of motivations/roles for a modded story progression
* tracking of advanced info for new extended social functions
* tracking of illnesses, ..

However, Sims 4 appears to use Google's Protobuf serialization for Python.
This means that there are .proto specifications which are
1.) possibly non-trivial to modify
2.) there will be a horrible mess of conflicts if multiple mods attempt to modify them (at least I would assume)

Therefore, a very simple additional way to store just a basic python-dictionary would be nice:

mymod_custom_save_data = some_sim_info.get_mod_savedata("my made up but hopefully unique mod id")
mymod_custom_save_data["keys can be strings"] = "values can be strings"
mymod_custom_save_data["list values would also be supported"] = [ 1, 2, 3, 4 ]
#mymod_custom_save_data["but no advanced data types that would be hard to serialize"] = sim_reference # NOPE

If you are lazy, dear Sim Devs, then just save this to disk as a string per mod and serialize/deserialize with JSON.dumps/JSON.loads as available in Python 3. This works fine for all the suggested trivial data types, and it should be easy enough to add to your Protobuf schemata, and to add to sim_info.py's respective load_sim_info / save_sim functions.

Does something like this already exist, OR would you mind to implement it in a future patch?

Regards,
A modder

Comments

  • SimGuruModSquadSimGuruModSquad Posts: 597 Member
    Hey eimeron, we do not have a nice mechanism for this currently. Something like what you describe would be doable, we'll add to the list of things to consider, but can't make any guarantees.

    Anyone else interested in this, feel free to reply with your support for this feature request :)
  • ScumbumboScumbumbo Posts: 148 Member
    I can definitely see where having a standardized interface to be able to store arbitrary data from a mod without having to resort to some kind of hack would be beneficial, so I would like to see this as well.
  • RenhaRenha Posts: 1 New Member
    Same here
Sign In or Register to comment.
Return to top