Hello, fellow developers!
I’ve been a scripter for a popular Roblox game for a while. Datastores have always been an issue for the game, as other scripters before me made it rely entirely on badge checking in order to give exclusive items. This, combined with a LOT of badges and items there is in the game, makes the Datastore script run around 140 requests to BadgeService everytime a player joins, causing loading times from 2 minutes (with luck) to even half an hour. Not fun.
When I was tasked to improve this system, the best I could do is store a table in the players datastores that would contain every badge you already own instead of checking over and over, making it less and less requests the more badges you have and greatly improving loading times to around 63 seconds.
But obviously, this solution still isn’t optimal and doesn’t work the same for everyone.
I come to ask, is there anything else I could attempt to speed up the system? Is it over?
EDIT: It’s also relevant to keep old badges that are no longer obtainable still working. This means simply adding the items onto data when badges are also given will work, but not fully.