[v2.1.0] MatchmakingService - ON HOLD

I’ll look into it, thanks for the report

Edit: So I think I found the reason but I’m not sure how much I can do about it:
jp14vt_108271

I’ll see if there’s a good way I can compress the information before saving it.

1 Like

Alright, I added some additional debug information when a game is unable to be added to queue. @Wqund (or anyone) if that error happens again can you send me the debug data you see in the console? That will help me figure out if this is a bug I can fix.

1 Like

Checking right now, do you perhaps have any discord to collaborate on this issue?

Alright, we’ve pushed a small change that should reduce this error from happening:

Version 3.2.1-beta
Changes (breaking):

  • None

Changes (non-breaking):

  • None

Fixes:

  • [Fix] A possible fix to #3 has been added. This fix is being monitored.

If you still see this issue let me know and I’ll figure out a better solution.

Version 3.2.2-beta
Changes (breaking):

  • None

Changes (non-breaking):

  • None

Fixes:

  • [Fix] Fixed an issue that prevented players from being matched after their ratings were updated.
  • [Adjustment] Rating can no longer go below 0.

Also, I’d like to add that those of you that see “The provided value is too long” as an error, this is caused because of improper documentation of sorted map size limit. I’ve pointed out the issue to roblox (for the second time, because someone else did over a month ago…). I’m only hoping they fix this issue as it majorly impacts this service. If they decide to keep the size limit at 1kb, then I’m afraid this would get way too complex to manage as a service because each time it goes over 1kb, it’d have to be split into another key under the sorted map, which is not scalable at all. And as I said memory queues are not in a state where they can be used for this yet.

Just know I am trying my best to fix these issues so this is ready for a real release.

EDIT: There has been no response to it yet. I will update this comment again if they respond or if enough time passes. It’s honestly just not acceptable how this documentation error was reported over a month ago and still the bug hasn’t been fixed nor has the documentation been updated to reflect the true memory limitations. Hopefully they fix it. If they do I think we’re going to be in a good place for an official release, which will come with better docs as well.

EDIT 2: I’ve just sent a message to bug support since they seemed to have stopped responding on the topic introducing memory store service. Hopefully it gets filed as an actual bug and we can get this resolved. Sorry for any inconvenience this is causing.

However, on a more positive note, I am working on better documentation that will be more organized than a devforum post!

EDIT 3: Big step in the right direction! Bug support has moved my topic to engine bugs so hopefully the engineers see it! Sorry for the extended wait…

4 Likes

MatchmakingService is a really great module to use, and is easy to implement once you learn! MatchmakingService will be used in the release of Bloxy Kart 2, which has no planned release date as of yet.

2 Likes

Thanks! Still waiting on a response to my bug report so I can get this rolled out in a more complete fashion. I’ll keep my current solution updated with anything as I get notified about it. Who knows if they’ll even reply to it. I hope they do soon…

2 Likes

Excellent module. Defintely will be using this for an upcoming project. Question though. Is there a way I can add multiple teams to Update Ratings for with the :UpdateRatings() function?

1 Like

>2 team support is planned for an upcoming update! However, as of 3.2.2-beta only 2 teams are supported, but follow this topic for updates. That update should come on the full 1.0.0 release or before, so it should be out by the time this module is stable

3 Likes

I have an issue here. Not sure if this is a bug, but it is constantly return this error within the output.

Failed to invoke transformation function. 

What does this mean?

1 Like

If you can give me the full stacktrace I’ll be able to assist better

1 Like

I highly recommend switching from Glicko-2 to TrueSkill which works for more than just 2 players. It is generally a lot more flexible and feature-rich.
I’m currently implementing the algorithm in Lua, as it doesn’t exist yet.

1 Like

Glicko2 works with more than 2 players, currently the way I have it set up only works with 2 teams. In the future, this will be any number of teams. Though if you can let me know when your module is finished, I could look into implementing it instead.

1 Like

Microsoft claims this on their website:
“Glicko was developed as an extension of ELO and was thus naturally limited to two player matches which end in either win or loss. Glicko cannot update skill levels of players if they compete in multi-player events or even in teams. The logistic model would make it computationally expensive to deal with team and multi-player games. Moreover, chess is usually played in pre-set tournaments and thus matching the right opponents was not considered a relevant problem in Glicko. In contrast, the TrueSkill ranking system offers a way to measure the quality of a match between any set of players.”

It might take some time though until I’m done.

1 Like

I’ll have to look into it and see if it’s a significant enough improvement to alter how rating works (which will effectively reset the rating of everyone already using the system, I’m not entirely opposed to it as it is in beta, but the improvement will have to be substantial). There are many team based games that use glicko2 (TF2, CS: GO, Splatoon all use it), albeit they include alterations as well. If you can provide a conversion rate from glicko2 → trueskill so that I can convert existing player’s ratings, I will have no problems with implementing trueskill.

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

-- Tell the service this is a game server
MatchmakingService:SetIsGameServer(true)

local t1 = {}
local t2 = {}
-- Basic start function
function Start()
	print("Started")
	MatchmakingService:StartGame(7852647049, false)
	-- Simple teams.
	local p = game.Players:GetPlayers()
	table.insert(t1, p[1])
	table.insert(t2, p[2])
end

-- YOU MUST CALL UpdateRatings BEFORE THE GAME IS CLOSED. YOU CANNOT PUT THIS IN BindToClose!
function EndGame(winner)
	MatchmakingService:UpdateRatings(t1, t2, "Solo", winner)
	for i, v in ipairs(game.Players:GetPlayers()) do
		-- You can teleport them back to the hub here, I just kick them
		v:Kick()
	end
end

game.Players.PlayerAdded:Connect(function(player)
	local joinData = player:GetJoinData()
	print(joinData)
	
	if #game.Players:GetPlayers() >= 1 then
		Start()
		task.wait(30)
		EndGame()
	else 
		print('needs more than two players!')
	end
end)

game.Players.PlayerRemoving:Connect(function(player)
	MatchmakingService:RemovePlayerFromGame(player, 7852647049)
end)

---- THIS IS EXTREMELY IMPORTANT
game:BindToClose(function()
	MatchmakingService:RemoveGame(7852647049)
end)

this is the script and I basically just stole the code example so I could further understand the module.

While that’s helpful too, I need the full stacktrace along with the error. It will show what line the error occurred on and what function called it.

You mean this?

 ServerStorage.MainModule:1237: Failed to invoke transformation function.  -  Server - MainModule:1237
  22:14:15.374  Stack Begin  -  Studio
  22:14:15.374  Script 'ServerStorage.MainModule', Line 1237 - function RemovePlayerFromGameId  -  Studio - MainModule:1237
  22:14:15.374  Script 'ServerStorage.MainModule', Line 1247 - function RemovePlayerFromGame  -  Studio - MainModule:1247
  22:14:15.374  Script 'ServerScriptService.Script', Line 41  -  Studio - Script:41
  22:14:15.374  Stack End  -  Studio

Yes. Thank you.

I’m gonna go out on a limb and say it’s this: MatchmakingService:StartGame(7852647049, false). The first value passed must be the game id that was passed in player’s join data. This value is not static and a new id is generated for every game. That’s why in the example it gets the id from their join data