So this is more of a technical question that I’m looking more at deep-level performance knowledge for.
Say theoretically, I stored a table on the server with the proper cleanup implementations for players leaving/dying/joining, and within that table I stored the state of every weapon in the game. For example:
What would the impact on server performance be for a scale of 200 players in a single game instance?
In addition, are there any better ways to accomplish this while still keeping the numbers easy to reference, cleanly stored and secure?
I’m not going to be able to give you any exact figures on this, but here are a couple of suggestions.
Caching the values in a table, as you are doing, will be much more efficient than relying on datastores or memorystores, even if it does have a higher memory cost (although as these aren’t complex types it is still pretty low cost).
Would the gun data for each player be different? For example if two players have a pistol, would they both have the same fire rate, mag size etc (not ammo obviously). As you could use a reference to a table of static gun data rather than replicating it into each player profile, then just record modifiers and ammo.
Yeah, gun stats would be static barring Ammo, it’s just thinking up a solution of keeping all the data centralised for easy access, such as updating UI information. Though, thinking about it, I could just keep static info stored in a ModuleScript alongside gun functions (to mitigate events) and have Ammo stored in a table for UI update referencing. Just wanted to get a little feedback in regards to how performant caching data into a table would be server-side.