Hello, I’m currently working on a singleplayer fps story game on roblox, and I am finalizing my data saving system using ProfileService with a bit of code to handle certain values.
This post might be a little long/overcomplicated, so bear with me for a second.
I have almost everything done (currently saving anything related to the player, such as weapons, health, movement status, their position at the time of saving, etc. also npcs/enemies, ragdolls, and item pickups), all of which is fine. However I’m trying to figure out what I should do about saving the status of triggers/doors/etc in the map.
I can do it in a similar way to the way I’m saving ragdolls/npcs/pickups, which basically just uses RBXSerialize to serialize/compress the bare minimum properties of each instance into a table for each type. The game loads them by, for example, creating entirely new ragdolls based off of the attributes saved for each instance in the table. (kinda simplified explanation, if you look at the module it might make a little bit more sense)
This works for these as I don’t expect to have to save hundreds of them at once. However that’s a different story for triggers. I am expecting this game to have about a hundred one-time triggers, all having different actions to execute (For now I intend on using 2-3 attributes for most of them) So here’s the question, What would be the MOST efficient way to save the state of each trigger?
I might just be overthinking and overcomplicating things, as I could just use the same method that I am using to save the ragdolls, but that’s not ideal at all considering the volume of things that will need to be saved.
The other (Less-ideal) alternative is just having the game save at set checkpoints (my original plan), with the checkpoints determining the state of triggers, doors, etc. Or should I do a similar thing, but allow the player to save whenever, with the checkpoint determining the state of everything.
Finally, should I split up each table into their own key to prevent hitting the 2mb datastore limit (just in case)? I really should, considering each save isn’t even in their own key as of right now.