[v2.1.0] MatchmakingService - ON HOLD

Some fixes!

Version 2.0.1

Changes (breaking):

  • None

Changes (non-breaking):

  • [Update] Updated OpenSkill to version 1.2.0.

Fixes:

  • [Fix] Fixed GetPlayerParty for users that have found a game.
1 Like

Version 2.0.2

Changes (breaking):

  • None

Changes (non-breaking):

  • None

Fixes:

  • [Fix] Fixed SetPlayerRating from calling a function that no longer exists.
1 Like

Thanks for making this module! This module will be used in Bloxy Kart for its v4.0 update.

I have a few suggestions:
for the FoundGame event, can a parameter be a table of players Usernames, User ID, and Display Name? I kind of want to show an icon of the player when the game is found along with who they will be racing with, and more info (For example, how many wins they have, and what kart they have equipped)?

Also, can there be an option for SetPlayerRange to set on all maps? I donā€™t want my code to be doubled as long, even though we can still do this:

local RaceMaps = {
	"Under_The_Sea",
	"Small_World",
	"Jurassic",
	"Piggy_Speedway",
	"Sandy_Secrets",
	"Space_Heights",
	"Space_Highway",
	"Eggsburg",
	"Tilted_Road",
	"Space_Turnpike",
	"Grassy_Ventures",
	"Mushroom_Forest",
	"Willis_House",
	"Santas_Village",
} -- Oops, Might of exposed some maps that are in the games code that are unused. Thats ok...

for _, Maps in pairs(RaceMaps) do
	MatchmakingService:AddGamePlace(Maps, 9130693906)
	MatchmakingService:SetPlayerRange(Maps, NumberRange.new(2, 8))
end

Hey, I either have a bug report or I am doing something completely wrong:
I keep getting this error (Map is what is in the TeleportData):

And here is how I am getting the Data:

game.Players.PlayerAdded:Connect(function(player)
	local TeleportData = MatchmakingService:GetUserData(player)
	print(TeleportData)
	game:GetService("ReplicatedStorage").LoadMultiplayerMap:Fire(TeleportData.Map) -- Error happens here.

Here is how I am passing the Data:

MatchmakingFolder.AddToQueue.OnServerEvent:Connect(function(Player, Map)
	local GameData = {Map = Map, Gamemode = "Multiplayer"}
	MatchmakingService.ApplyCustomTeleportData = function(player, gameData)
		return GameData -- Here is where I am putting the Data
	end
	MatchmakingService:QueuePlayer(Player, "Player", Map)
end)

I have been messing with the script above for the past couple of hours, and I am not getting it. I looked in the Module and saw that ApplyCustomTeleportData is not a function, which also makes me believe it is a bug, and it is hidden in MatchmakingService.new(). Would appreciate help!

Thanks in advance!

You could do this by using the game data which is a table with this format:

{
    ["full"] = boolean
    ["skillLevel"] = number
    ["players"] = table<ā€‹PlayerId>
    ["started"] = boolean
    ["joinable"] = boolean
    ["ratingType"] = string
    ["map"] = string
    ["createTime"] = number
}

You can iterate over the players table and get their display name/username. I donā€™t do this natively because thatā€™s a lot of extra bandwidth/api calls for a lot of people that wouldnā€™t use it

I can look into doing something like this.

2 Likes

If you are on version 2 or later, you can use

MatchmakingService:GetRunningGame(MatchmakingService:GetGameData().gameCode).map

to retrieve the map. This is a little cumbersome though and I can look into a better way to do this that isnā€™t as long. As for why itā€™s not working for you right now, I can only assume itā€™s because a callback function is supposed to be set a single time, not multiple times for every user.

1 Like

Thanks, this solution worked.

1 Like

How can i detect game is removing? And new game is added because i want to create a serverlist that updates instantly. Also how can i pass the game password to the hub if there is a no messaging service?

Currently there is no event for adding or removing games which is fired globally. I can look into adding this next update if you want this functionality. Also there is no real way to password protect servers, thatā€™d be more akin to a server browser, not a matchmaker. A matchmaker finds games without having to search through a server browser based on how many players are in the queue. There is, however, a way to add custom game data which could include a server password, and then to lock the server from joining without being manually added, but this functionality, currently, does not exist in the vanilla service.

1 Like

Hey, im back to report an error. I am still using v1.3.2 because I didnā€™t know about the new updates and I spent a long time migrating to JoinData which I would now have to revert : (

Screenshot_1
In basically every server I get this error. Iā€™m not sure if this is a roblox error or something to do with MMService.

It started happening about 1 week ago, but now is constant.

The line:

It also happens in every other place where the memorystore is called.

If it happens everywhere memorystore is called I would think that itā€™s a roblox issue (and you didnā€™t update so it just came out of no where), however the first think I would try is to open your console in a game then type require(path.to.MatchmakingService):GetSingleton():Clear() where path.to.MatchmakingService is the same way you require it anywhere else.

1 Like

Is this global across all servers?

Yes.

1 Like

Can you send data in and back? What Iā€™m trying to say can we send saved data to another game and bring it back to the original game?

Another question that I have, is this going to be fast? Does this use or can we use the same system TDS uses for matchmaking? Which is where it would get the closest players to you.

This is awesome I could use this in future games thank you :blush:

1 Like

Is there a way to turn off multiplayer teleports if you leave or get disconnected? My game doesnā€™t support that feature. Also, if you do not even teleport, you get teleported solo anyway, which is a bad user experience. Would appreciate a way to turn that oof.

If youā€™re here for the hold explanation, itā€™s at the bottom of this post.

This is a matchmaking service, the most it provides is matchmaking and sending relevant data to games, if you want to send data back, youā€™d need to handle that yourself using any method you want. I donā€™t want to bloat the service with things potentially unrelated to matchmaking which would slow down the service for people that donā€™t want/need the functionality.

You can use it to append custom data relevant to the games/players which are being sent that you can then access on the game servers after a match is found, but it does not relay any info back after the game is over, other than potentially updating a playerā€™s rating, which isnā€™t really going back to the other server at all itā€™s just updating it in a datastore.

I donā€™t know what TDS is, however there is no geolocation check in MMS, if thatā€™s what you mean. It uses a FIFO priority-based queue (itā€™s essentially FIFO, but parties are handled a little differently).

Iā€™m unsure what you mean. MMS does not handle reconnecting disconnected users to games anywhere in its code (it doesnā€™t even connect to PlayerAdded at all)

As for teleporting solo, MMS looks at your maps min/max values and will teleport users as soon as it reaches min, so if you donā€™t want users to teleport solo set min higher.

If you believe you have found a bug, please gather evidence (recordings are the easiest to follow) then submit that.

For everyone else regarding the future of this project

As of right now this project is on hold. MMS is a passion project of mine, I made it for the community. I donā€™t ask for or expect anything in return, I donā€™t even ask for, or care for any credit. Iā€™m currently very busy with life at the moment. Iā€™m a full time college student with finals coming up. Iā€™m also an intern at roblox working on a game through the accelerator program as my full time job at the moment. Needless to say, Iā€™m extremely busy and have very little free time, and the free time I do have I donā€™t want to turn into work time. I do other things in my life than program that Iā€™d like to do when I have time.

I donā€™t plan on fully discontinuing this project anytime soon, however, just know that there will be no updates unless itā€™s to fix breaking bugs until Iā€™m done with college, the internship, and probably find a new job afterwards. Iā€™d like to settle in and get into a good rhythm again since right now, it really isnā€™t.

And of course, this project will always be free and open source. If you want to contribute, head over to the github, fork the project, add some changes, then PR it into the main repo and leave a reply here if I donā€™t see it. The beauty of open source software is that anyone can work on it.

I hope you understand where Iā€™m coming from with this,
Steven

Not wanting to bump the topic, I did release 2.0.3 which is a small fix that doesnā€™t even add any lines of code:
Version 2.0.3

Changes (breaking):

  • None

Changes (non-breaking):

  • None

Fixes:

  • [Fix] Attempted a fix for an issue that would cause an error when teleporting players to existing games with no custom teleport data.
12 Likes

This is fully understandable Steven. Itā€™s really amazing what you have done for all of us, and we really canā€™t thank you enough for sharing this with the community.

Furthermore, I am very grateful for you still fixing game-breaking bugs even though youā€˜re (understandably) very busy!

Thanks for everything, and good luck on your other projects too. Iā€˜m sure weā€˜ll all keep in touch, and the project isnā€˜t disbanded - rather mothballed until you have more time :slight_smile:

Great module! The only problem Iā€™m having is that

:SetPlayerRange(ā€¦)

isnā€™t working for me. I set the minimum amount to 2 players but when I queue up with 1 player I get teleported anyway. I think I followed the steps correctly,

hub server:

local MatchmakingService = require(script:WaitForChild("MatchMaking")).GetSingleton()

local MPremote = game:GetService("ReplicatedStorage"):WaitForChild("startMultiplayer")


-- Game modes ..................................................

gameModes = {
	["Distance"]  = {},
	["Elimination"]  = {}, -- disabled
	["Dodge"]  = {} -- disabled
}

MatchmakingService:SetPlayerRange("Distance", NumberRange.new(2, 4))
MatchmakingService:AddGamePlace("Distance", 7523477758)

--..............................................................


MPremote.OnServerEvent:connect(function(player, gameMode)
	if gameModes[gameMode] then
		print("exists")
		MatchmakingService:QueuePlayer(player, "unranked", gameMode)
	else
		player:Kick("Multiplayer game mode does not exist")
	end
end)

instance server:

local MatchmakingService = require(script:WaitForChild("MatchMaking")).GetSingleton()

-- Game modes ..................................................

gameModes = {
	["Distance"]  = {},
	["Elimination"]  = {}, -- disabled
	["Dodge"]  = {} -- disabled
}


MatchmakingService:SetPlayerRange("Distance", NumberRange.new(2, 4))

--..............................................................


MatchmakingService:SetIsGameServer(true)
local gameData
game.Players.PlayerAdded:Connect(function(player)
	if not gameData then
		gameData = MatchmakingService:GetGameData()
	end
	if #game.Players:GetPlayers() >= 2 then
		--Start()
		MatchmakingService:StartGame(gameData.gameCode, false) -- joinable = false

	end
end)