Hey everyone, I have a simple question regarding whether I should switch to a dictionary rather than using an array. My concern is the size of the table; I’m sending information from the server to the client and I’m worried that my table is getting too large. I originally created this with a dictionary simply to make it easier on myself when sorting through the values.
I currently send the client a table with the information about every weapon in my game (name, asset id, whether the player has discovered it, how recently they discovered it, in-game rarity, is it’s new), here’s a visual:
{
["Name"] = "Linked Sword",
["AssetId"] = 125013769,
["Discovered"] = false,
["Recency"] = 0, -- This is a number other than 0 if they've
-- found it; smaller is more recent.
["Rarity"] = "Common",
["New"] = false
}
I decided to copy the resulting table with repr and pasted it online in a size calculator and got ~20KB. This includes the above information for 175+ weapons and worries me if I were to add more in the future. It’s worth mentioning that this would be sent whenever the player discovers a new gear, which would be somewhere between ten seconds and a minute for the first while as they discover a new one each time. After some time, it would likely slow to once every 10 minutes or so.
Would my table be large enough that it could cause some trouble? If I changed everything to an array, would it make a noticeable improvement? Something like this:
{
"Linked Sword",
125013769,
false,
0,
"Common",
false
}
All input is appricated, thanks.