Best way to store tool data help/

I am making a simulator game and the player will have an inventory full of tools, resources and items, what’s the best way to save the data so it stays the same next time the player joins? What’s the most efficient way? Each tool and item will have a lot of sub data unique to itself that needs to be saved and loaded in.

1 Like

You most likely don’t need to worry about efficiency, you can store the data in a table like this and save/load it using the DataStoreService:

{
 ["ToolName/ID"] = {
  ["Name"] = "My tool",
  ["Description"] = "A nice tool",
 }
}
1 Like

How would I decode the table when the player loads in to create the tools with the correct statistics? Should I try cloning tools from ReplicatedStorage and changing all the attributes then cloning into the player’s inventory?

1 Like

Yes, you can do that. And you can use the Name/ID to find the Tool in ReplicatedStorage

What’s the best way to compact the information of the tool into a table?

By not using a Dictionary like I provided and only using an Array, however I don’t see a reason you would want to do that as unless you have ~5000 tools with ~200 attributes each you won’t run into issues.

1 Like

Thank you very much for your help. I will try what you have suggested.

1 Like

If the items have their own ID and only a few different states, then you should use this in order to compress the amount of stored information as much as possible in order to reduce the likelihood of data loss.

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.