[v2.1.0] MatchmakingService - ON HOLD

Were you able to test it? I don’t have a way to test the service anymore really. I knew that it worked fine with one role, but I never was able to test with multiple at the same time.

As for queueing parties with different roles, I’ll have to look into it. Due to the way parties work, cross queue partying is very difficult to get working, and we’re working with quite limited memory space, so any properties I have have to be worth the extra space they take.

1 Like

I didn’t tested party but I tested QueuePlayer and it does have some problems.
First the return of QueuePlayer never return true even if the player successfully queued and some times same player get queued twice don’t know if it’s link to what I said before

I’m going to look into this, but my roblox and studio are completely broken for some reason and every usage of memory store service is failing even if it’s the first request.

yes me too , seems like memory store is down right now

Version 3.0.0-beta.3

Changes (breaking):

  • None

Changes (non-breaking):

  • [Change] RemovePlayerFromQueueId, RemovePlayerFromQueue, RemovePlayersFromQueueId, and RemovePlayersFromQueue now have another parameter called updateAttribute, this will default to true. The only proper use for this is to remove players from the queue but still have the service check if they found a game. Used internally to remove players from the queue after they found a game, but still teleport them.

  • [Change] Clear will now print how many times the memory stores were used, effectively telling you how much of your rate limit you used.

  • [Change] Added various logs which will be removed on release.

Fixes:

  • [Fix] Fixed the MMS_QUEUED attribute being removed after finding a game, which caused players to never be teleported.

  • [Fix] AddPlayersToGameId will now default the role to MMS_NO_ROLE properly.

1 Like

@fouroul94 Let me know if 3.0.0-beta.3 fixed your issues.

I will try ASAP and will test different things but okay

okay i just tried and it seems to work way better and now QueuePlayer return true.
Found a little error on SetMapRoles()
it says trying to compare nil > number
so i changed your code by that :
image

Edit : found a bug like some times it just don’t bring player together and can’t create games here is my code


i start a test with 4 player to try it but it work with 2 players (1 survivor,1killer)

Ah yup, thanks for catching that. I still treated it as a single value.

Hm. I’ll look into this.

@fouroul94 I can’t seem to get the same issue as you for the 4 players, all of my fake players were going to be teleported.

It should be noted that studio is not capable of making teleports, so they won’t actually be teleported. I added some more logs on my end to ensure the players would be teleported. I pushed those changes to the github if you want them, but they don’t warrant another release at the moment since they’re just logs

yeah i tested it on studio but the service just don’t create games

That’s odd, here’s what my logs say in studio when I create a game with 4 players:

12:42:51.507  added  -  Server - Matchmaker:54
12:42:52.022  true  -  Server - Matchmaker:55
12:42:52.022  added  -  Server - Matchmaker:54
12:42:52.440  true  -  Server - Matchmaker:55
12:42:52.441  added  -  Server - Matchmaker:54
12:42:52.756  true  -  Server - Matchmaker:55
12:42:52.756  added  -  Server - Matchmaker:54
12:42:53.090  true  -  Server - Matchmaker:55
12:42:54.105   ▶ {...}  -  Server - MainModule:734
12:42:54.106   ▶ {...}  -  Server - MainModule:734
12:42:54.273  Players to teleport:  -  Server - MainModule:957
12:42:54.273  {}  -  Server - MainModule:958
12:42:57.573   ▶ {...}  -  Server - MainModule:734
12:42:57.573   ▶ {...}  -  Server - MainModule:734
12:42:57.573  WE GOT ENOUGH TO MAKE GAME!!!  -  Server - MainModule:831
12:42:57.573   ▼  {
                  ["Killer"] =  ▼  {
                      [1] = -1
                  },
                  ["Survivor"] =  ▼  {
                      [1] = -2,
                      [2] = -3,
                      [3] = -4
                  }
                }  -  Server - MainModule:832
12:42:57.574  GAME DATA CREATED  -  Server - MainModule:853
12:42:57.574  Adding to non-joinable  -  Server - MainModule:882
12:42:57.671  GAME DATA ADDED  -  Server - MainModule:889
12:42:57.723  Added game  -  Server - MainModule:903
12:42:58.130  Removed from queue  -  Server - Matchmaker:34
12:42:58.130  -2 Map 1 ranked 0 Survivor  -  Server - Matchmaker:35
12:42:58.130  Removed from queue  -  Server - Matchmaker:34
12:42:58.130  -3 Map 1 ranked 0 Survivor  -  Server - Matchmaker:35
12:42:58.130  Removed from queue  -  Server - Matchmaker:34
12:42:58.130  -4 Map 1 ranked 0 Survivor  -  Server - Matchmaker:35
12:42:58.130  Removed from queue  -  Server - Matchmaker:34
12:42:58.130  -1 Map 1 ranked 0 Killer  -  Server - Matchmaker:35
12:43:01.623  Found game  -  Server - Matchmaker:39
12:43:01.623  -1 TEST  ▶ {...}  -  Server - Matchmaker:40
12:43:01.739  Found game  -  Server - Matchmaker:39
12:43:01.739  -2 TEST  ▶ {...}  -  Server - Matchmaker:40
12:43:01.872  Found game  -  Server - Matchmaker:39
12:43:01.872  -3 TEST  ▶ {...}  -  Server - Matchmaker:40
12:43:01.990  Found game  -  Server - Matchmaker:39
12:43:01.990  -4 TEST  ▶ {...}  -  Server - Matchmaker:40
12:43:02.073  Players to teleport:  -  Server - MainModule:957
12:43:02.073   ▼  {
                  ["TEST"] =  ▼  {
                      [1] = Player1,
                      [2] = Player2,
                      [3] = Player3,
                      [4] = Player4
                  }
                }  -  Server - MainModule:958
12:43:02.075  APPLYING CUSTOM DATA  -  Server - Matchmaker:21
12:43:02.075  Player1  -  Server - Matchmaker:22
12:43:02.076   ▶ {...}  -  Server - Matchmaker:23
12:43:02.077  APPLYING CUSTOM DATA  -  Server - Matchmaker:21
12:43:02.077  Player2  -  Server - Matchmaker:22
12:43:02.078   ▶ {...}  -  Server - Matchmaker:23
12:43:02.078  APPLYING CUSTOM DATA  -  Server - Matchmaker:21
12:43:02.078  Player3  -  Server - Matchmaker:22
12:43:02.080   ▶ {...}  -  Server - Matchmaker:23
12:43:02.080  APPLYING CUSTOM DATA  -  Server - Matchmaker:21
12:43:02.080  Player4  -  Server - Matchmaker:22
12:43:02.081   ▶ {...}  -  Server - Matchmaker:23
12:43:02.082  APPLYING GENERAL DATA  -  Server - Matchmaker:28
12:43:02.082   ▶ {...}  -  Server - Matchmaker:29
12:43:02.123  Teleporting:  -  Server - MainModule:977
12:43:02.123   ▼  {
                  [1] = Player1,
                  [2] = Player2,
                  [3] = Player3,
                  [4] = Player4
                }  -  Server - MainModule:978

Now, studio can’t teleport like I said, but the last lines is where they would’ve been teleported if it was a regular game.

You can also see that after the “WE GOT ENOUGH TO MAKE GAME!!!” line, there’s 1 player under killer, and 3 under survivor, which is what we expect and the user ids are correct, -1 being the killer in my case since I used the following code:

local MatchmakingService = require(game.ServerStorage.MainModule).GetSingleton()

task.wait(5)

MatchmakingService:SetMapRoles("Map 1", {
	Killer = {
		Min=1;
		Max=1;
	};
	Survivor = {
		Min=3;
		Max=3;
	}
})

MatchmakingService:AddGamePlace("Map 1", 7584483307)

MatchmakingService.ApplyCustomTeleportData = function(player, gameData)
	print("APPLYING CUSTOM DATA")
	print(player)
	print(gameData)
	return {Hi=1}
end

MatchmakingService.ApplyGeneralTeleportData = function(gameData)
	print("APPLYING GENERAL DATA")
	print(gameData)
	return {Bye=1}
end

MatchmakingService.PlayerRemovedFromQueue:Connect(function(...)
	print("Removed from queue")
	print(...)
end)

MatchmakingService.FoundGame:Connect(function(...)
	print("Found game")
	print(...)
end)

while #game.Players:GetPlayers() < 4 do
	task.wait(1)
end

local roles = {[-1]="Killer",[-2]="Survivor",[-3]="Survivor",[-4]="Survivor"}
for _, p in ipairs(game.Players:GetPlayers()) do
	print("added")
	print(MatchmakingService:QueuePlayer(p, "ranked", "Map 1", roles[p.UserId]))
end

your code seems to work idk why mine didn’t worked

Hi Steven can you tell me how do I queue a party with 2 players that don’t have the same role ?

It’s not currently possible. The changes this will require is a lot more than it takes to just add the role system. I’ll see if I can make it possible to do, but it does add a lot of complication.

Okay thanks you for your quick answer

Hey Steven any updates or you are busy right now ?

@steven4547466 I have some error on line 817: Unable to convert value to json.
It hapens when I MatchmakingService.FoundGame:Conenct(). How to fix this?

I’m not entirely sure what would cause this issue since all line 817 is at the moment is a dictionary indexer.

1 Like

Hey Stephen,
I got a bug that just started showing up.
Can You help me get this up and running?
:grinning:
Here is how I’m queuing the player

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local MatchmakingService = require(ReplicatedStorage.MainModule).GetSingleton({["DisableRatingSystem"] = true, ["MajorVersion"] = "v3" })
MatchmakingService:Clear()
local SingleTagSoloId = 13893328542
local FreeForAllId = 13771625711
MatchmakingService:AddGamePlace("SingleTagSolo", SingleTagSoloId)
MatchmakingService:SetPlayerRange("SingleTagSolo", NumberRange.new(2, 10))
MatchmakingService:AddGamePlace("FreeForAll", FreeForAllId)
MatchmakingService:SetPlayerRange("FreeForAll", NumberRange.new(2, 10))


local Players = game:GetService("Players")

local QueueEvent = Instance.new("RemoteEvent")
QueueEvent.Name = "QueueEvent"
QueueEvent.Parent = ReplicatedStorage

local RemoveFromQueueEvent = Instance.new("RemoteEvent")
RemoveFromQueueEvent.Name = "RemoveFromQueue"
RemoveFromQueueEvent.Parent = ReplicatedStorage

local SendChatMessageEvent = Instance.new("RemoteEvent")
SendChatMessageEvent.Name = "SendChatMessage"
SendChatMessageEvent.Parent = ReplicatedStorage

local function onQueueEvent(player, GameName)
	local PlayerGui = player:WaitForChild("PlayerGui")
	local Loading = PlayerGui:WaitForChild("Loading")
	MatchmakingService:QueuePlayer(player, "Casual", GameName)
	wait(3)
	Loading.Cancel.Visible = false
end

local function RemoveFromQueue(player)
	MatchmakingService:RemovePlayerFromQueue(player)
end
  -  Server - MainModule:298
  20:49:51.406  Retrieving MatchmakingService (3.0.0-beta.3) Singleton.  -  Studio
  20:49:51.406   ▶ Clearing memory (x2)  -  Studio
  20:49:53.236   ▶ Total requests: 6 (x2)  -  Studio
  20:49:54.303  Unable to queue player:  -  Studio
  20:49:54.303  ReplicatedStorage.MainModule:1409: attempt to concatenate nil with string  -  Studio
  20:49:54.486  Unable to update queued rating types:  -  Studio
  20:49:54.487  ReplicatedStorage.MainModule:186: attempt to concatenate nil with string