Help needed with matchmaking system using MemoryStoreService

Hello devs !

  1. What do you want to achieve?

I’d like to add a functionality in my game in order for players or parties across different servers to play against eachother. Basically, when players join my game, they have the choice to either play solo (launch solo matchmaking) or create a party (and launch multiplayer matchmaking).

I have been using MemoryStores in order to add the solo player’s name or the party leader’s name, a value representing the size of the party (1 if solo, number of members of party), as well as values representing the skill-level of the player/party.

When the player or party is ready to join a match, I add this data to the MemoryStore’s queue, so that other servers can see that this player/party wants to join a match.

Other servers can then start their comparisons tests : they check every solo player / parties that are ready in their server (not in the queue) with the player/party returned by the queue, and check if the skill-level matches and if both parties are the same size (or if it’s 2 solo players).
If everything is correct, the local player/party goes to a reserved server, and then I should send the queing player/party to the same reserved server.

  1. What is the issue?

I have different issues :

  • When a server finds a match between one of it’s players of parties and the first queing player/party, what tells me that another server didn’t also find a match at the same moment ?

  • Let’s say that the first issue didn’t happen, we then have the local player/party that can get teleported with a reserved code, but then, how can I delete them from the MemoryStore ? I can delete the player/party that was the first in the queue, but the local matching player/party is also in the queue somewhere. The only thing I know about removing items from the queue is when we read them and getting their id to delete them, but they are most-likely not going to be read before all the others that are queing.

  1. What solutions have you tried so far?

I had tried using datastores instead of memory stores, but there would be too many calls, and the data is slow to update…
I have also tried to understand the messaging service, but I do not think it is the best method to reach my goal.
I have seen on the forum that it was recommended for matchmaking using one “universe” server (basically only one script managing matchmaking for every server), but that would be difficult to use with the queue, because I would not know how many players separate the first one queing from any other ready one(s) that have the same skill-level (it could be 1,2,10,100 or more). Basically, the problem here is the 1st parameter of the :ReadAsync() method which is the number of players/parties I want to read.

I think that a solution to the problem is being able to delete a memory store item by finding its id even though we do not know its position in the queue.

If any of you know alternatives to memory stores that would work, and still make the matchmaking fast, and prevent 2 different servers to matchmake the same person/party twice, please let me know !

Thanks in advance.

Nevermind, I think I will just use Sorted Maps of the MemoryStore service. Like that, I can retrieve all matchmaking player’s data and also remove their data when teleporting them.

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