So roblox made an update…
Instead of fixing the bug they went ahead and capped the size of sorted maps to 1kb. Which is just wonderful. I don’t know if there will be any good way to fix this.
It’s super unfortunate that it has come to this, but I’m not sure of any scalable way to make this service work with this limitation. For anyone wondering this is what the docs said before:
It’s just incredibly upsetting and I really don’t know what to do about it so I’ll detail some options and why they won’t work:
Switch to memory queues - While I would love to switch to memory queues, it’s not feasible. Memory queues are is a terrible position right now. One you add an item to the queue it will exist there until it times out or is read. This isn’t always a problem, but it means that there’s no way to dequeue players if they leave or want to get out of the queue. It’s honestly a joke how badly implemented memory queues are in their current state with pretty much no control over them.
Break the running games up when the limit is reached - This is not scalable and will exponentially increase the number of calls to the memory store, eating up your quota.
I only see one option and it’s what I’ll be working towards for the foreseeable future:
Save ids to the games in a single array in the memory queue and save games to their own map - This seems like it will be the only option. The problem is, with small-medium sized games the 1kb limit will still be an issue. Here’s why: 1KB is 1024 bytes. Each character is 1 byte in size. The id to identify the game is ~55 characters in length. 1024/55
= 18.6
. This means that at any given time, you will only able to have 18 running games before the service starts to error. It’s just not scalable. I can switch to smaller unique ids (which I will, something like youtube’s base64 system) but even then, memory size is scarce and even if I could make a 1 character unique id you’d still only get up to 1000 games, which if your game has even 10000 players is still not enough. Honestly going back to MessagingService-based matchmaking systems might just be the only real solution, but those aren’t even scalable either because of the limits. There’s no good solution and this service has its back against the wall while roblox rips it apart.
It’s really upsetting to see them add this service (memory stores) that seems so good and new and a breath of life into possibilities… just to then impose limitations that make it useless. 1KB is nothing. The Xerox Alto, a PC from 1973 had 96x the amount of memory.
Anyways, rant over, I’ll see if any solutions are viable. If it’s not worth my time and effort to maintain and find a scalable solution then I may have to discontinue this project which would be really disheartening to me because of the work I put into it. And it would make me feel bad for anyone that currently uses it because it won’t work if their game ever gets to an even small-medium size. I’ll continue to ponder solutions, if you have any ideas don’t hesitate to share them with me.
Edit with some afterthought:
It may be possible to have multiple running games sorted maps with a counter of how many there are so we can loop over them. The main problem is that for each new sorted map you make, if you want to iterate over all games you’ve added an extra call to the memory store, which isn’t too bad and might be the solution to this. An additional call to it isn’t the best solution, but it’s a solution. And with the request quota giving you 100 requests per user per minute I don’t think it should impose any real downside (other than multiple calls to memory) and the quota should still be fine. I’ll look into implementing this asap.