Matchmaking
The following is an excerpt from a conversation between Artūras Šlajus (arturaz) and Erick Passos (erickpassos):
arturaz
@erickpassos if I want to dabble with matchmaking, should I look into PUN or realtime docs?
The idea is to have a queue of players, and when X players are in the queue, start the room with a certain map and automatically launch the game
erickpassos
For team-based matchmaking I'd go for an external solution
arturaz
external out of photon?
erickpassos
you can do stuff on the photon room before quantum kicks in for sure
But anything like waiting queues, etc, are prior to a room existing
Yep, external to photon
Think about a web services based thing in which you:
- register for matchmaking, with some filter stuff;
- wait for a response;
- response = region+room_name
- then CreateOrJoin(that)
This is out of the scope of the room-based matchmaking photon does
Specially because: matchmaking is KEY do good player experience, a core value of your game, and every publisher/studio is very secretive of how they do it with analitics
You can do some tricks with room filtering in photon (client based), but it will never be as good as a custom team-based one with rich queues
arturaz
You talked about server plugins before, but I can't find information about those. Could you explain about them?
erickpassos
any general thing about a photon plugin, just look into here:
https://doc.photonengine.com/en-us/onpremise/current/plugins/manual
Photon Plugins Manual | Photon EngineRedistributable cross platform multiplayer game backend for realtime games and applications. Develop authoritative logic with SDKs for android, iOS, .NET., Mac OS, Unity 3D, Windows, Unreal Engine, HTML5 and others.
The Quantum plugin is a special Photon Server Plugin (that we wrote)
arturaz
Can we put matchmaking there?
erickpassos
The quantum plugin can be further extended as a normal photon plugin +the quantum-specific callbacks
We'll ship a SAMPLE custom plugin (with server side, sim, etc) with 1.2.1
No, plugin means room already exists
And matchmaking is something that needs to be decided BEFORE that
room = match
arturaz
ok. but if matchmaking is external it can't create rooms in photon, can it?
erickpassos
for filter-based matchmaking you don't need anything special in the plugin
It would be client side
No, the room will be created from the first client
arturaz
stuff like setting player RuntimeConfig, like what items it has, etc
erickpassos
Again, here's how it would be :
That's NOT matchmaking...:)
Setting runtimeplayer data is NOT matchmaking... that is match setup/init
arturaz
yeah, but if client does match setup, then a malicious client can just send whatever it wants
erickpassos
matchmaking is very well defined:
- queue players in entry side of queue/service;
- vomit player-groups (matches) on the other side
I think you're confusing two different aspects(edited)
Setting RuntimePlayer data from an external player database CAN be done from the Quantum Plugin (and I even recommend it)
Matchmaking (which could potentially be based on the same player data from player database) is another thing:- queue player in;
- queue matches/player groups out;
arturaz
So...
- matchmaking queues players, sends the room id to the appropriate players
- players join the room (one of those players becomes master?)
- who launches the game? (what happens if master connection drops? can a room be started externally by our matchmaking service?)
- upon game start, custom server plugin fetches data for players from external service and sets the runtimeconfig/runtimeplayer
- people kill each other
erickpassos
So setting player data (authoritatively/safely) from server WILL be part of the plugin sample that we'll ship with 1.2.1
Room match can be started by any client (but runtime player data can be ignored from server, and only set from there)
arturaz
What stops malicious client from starting the room too early?
erickpassos
You can for example, on the server, wait for everybody to send their data (that you ignore, but take into account), and then fetch/send after that
starting the room doesn't mean there will be ENTITIES..:)
arturaz
But it will mean that the simulation is running, right?
erickpassos
Yes, no problem there
Remember that YOUR matchmaking service sends the room to all clients
all will join at the same moment (with slight differences)
The right way would actually be: start right away
If your client donÄt know the room ID prior to the matchmaking having finished, it cannot start before...
arturaz
that makes sense
erickpassos
It's up to your matchmaking to provide a room_name to all clients, so they all just join...
There are other ways to check RuntimePlayer data from external service without using the server as well
Just include the informatuion you want to be validated about every player (usable heroes, for example) with the matchmaking info, so all clients can check later if one of the players try to use a hero he's not allowed to (with runtimeplayer data)
Why do I suggest so?
- Because a CUSTOM plugin requires the photon enterprise cloud...
- The test cloud you guys run (that is the one available for rev-share deals) doesn't allow custom plugins
arturaz
I thought we have to run on enterprise cloud upon launch anyway, isn't that right?
erickpassos
yes, unless you have a rev share deal
You'll get the sample plugin with 1.2.1
So it will be up to you
I'm logging off discord for today. Will be back tomorrow
arturaz
Back to topThank you, this has cleared up a lot.