question

ZaharZagrava avatar image
ZaharZagrava asked

How does a matchmaking works?

I was trying to learn how Matchmaking works in details, but all that I have found is a few sentences here and here and API docs, so I have a lot of questions:

  1. Let's say, the client, using the Client API, can call the StartGame method to spin up a new game instance in some region that he/she chose. But isn't it unwise to the client the ability to spin up instances? I see that in Settings> API Features "Allow client to start games" is disabled by def. Ok, then how can I implement a matchmaking process at all, without using external matchmaker (don't have money/time for that).
  2. Also, as I got it, when someone sends StartGame/Matchmake requests they are saved/processed somewhere on your platform, is that correct?
  3. If so, then how does this process work in details? Any useful links would be great, cause all I found is this, and I really don't understand how to put all that text into practice.
  4. And finally, StartGame mentions stat-based matching, region that is (somehow?) also used for match filtering. How all of that works, how can I control it, see it?
Matchmaking
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
JayZuo avatar image
JayZuo answered

Actually, here are two versions of matchmaking. What you've found in Custom Game Servers is the traditional one. And the Matchmaking (Preview) is an upgrade to PlayFab’s existing matchmaker and uses the proven capabilities of Xbox Live’s SmartMatch feature. It is now in private preview and will be released more broadly before the end of this year.

The StartGame method is used in the traditional matchmaking system, it's extremely simple - given the parameters you pass in, it finds the first empty slot in a session that matches those parameters, and returns it. If there's no match and you've specified that the call can create a session, it does that and returns a slot in that session. In client, you will use APIs here, and in your game server, you will use APIs here. And for your questions, this answer might inspire you.

2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

ZaharZagrava avatar image ZaharZagrava commented ·

So, if I make a Matchmake request Playfab platform filters out all current game instances (builds that I previously spun up, right?) by the tags that I have specified for this game instance using SetGameServerInstanceTags, and also that have the requested Build Version, Game Mode, and Region, is that right? And if it does not find what it wants right away, then it immediately spins up a new build/game instance?

But how do I prevent player from spamming game instances? I still need to create them on-demand (when game instance really needs to be created), but how?

0 Likes 0 ·
brendan avatar image brendan ZaharZagrava commented ·

Correct - all factors need to match (apart from skill, which is used to get the closest match). Since the only regions available are the ones you've activated, the only versions the ones you've uploaded, and the only game modes the ones you've set up, that means the client has to be requesting a server that you specifically have set up for your game. So if someone were to spam a bunch of requests, then they could cause an extra instance to start (bear in mind that the number of instances that can run on a host server is also something you set), yes. Between that and the API call rate limits on clients, it would take dedication to set up something that could spin up more than a few instances - and since the players wouldn't actually be joining them, your server logic would likely shut them down quickly, so the net result wouldn't be more than a few server hosts starting, in most cases. But given that these are client-originating Web API calls, they would appear the same regardless of whether they're coming from an unmodified client or not.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.