question

Rick Piller avatar image
Rick Piller asked

Match Making

So for GetMatchResult there is ServerDetails object that stores :

IPV4Address
  • string
The IPv4 address of the virtual machine that is hosting this multiplayer server.

Will this IP address be unique PER match? Because when I config the servers it asks me how many instances of my game app server I want to allow running on 1 machine. So for example if I allow 2 instances of my game app server to run on a machine/server, I would assume that IP address is the same for that machine/server so how would the client apps know which game server app instance it's connecting 2 since there could be multiple instances running on the same machine/server? I would assume 1 match per virtual machine and each virtual machine has it's own IP address so that each match has it's own IP address clients are connecting to?

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

·
Seth Du avatar image
Seth Du answered

AFAIK, the IP address is unique per VM (different instances can have the same IP but with different ports). Players won’t get VM IP because usually it is for administrative purposes. VM will host several server instances and the quantity is defined by “servers per machine” in the configuration. Players/Clients will only connect to server instances.

Server build should differ matches via the connection port from players.

5 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.

Rick Piller avatar image Rick Piller commented ·

"Server build should differ matches via the connection port from players."

I guess I don't get that. The game server app is listening on a defined port and that doesn't change. So all clients are connecting to that port right. So all their traffic will be coming on the same port. Currently my game server app is breaking things out by matchId, which I have the clients send with every request so my game server app can branch to that Match object that I create on the server app.

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ Rick Piller commented ·

Yes, for one instance, all the traffic is using the same IP with the same port number. If you want to host several matches within one Server Instance, you need additional information to shunt connections to different matches. Using Match ID should be feasible.

"Server build should differ matches via the connection port from players." means that I assume you have plenty of instances for single VM and each instance will only host one match(low-cost ones, such as 1v1).

Basically, there are 2 popular ways to design your multiplayer server. Here is a quick explanation from Andy:https://community.playfab.com/questions/26942/thunderhead-architecture-best-practice.html

0 Likes 0 ·
Rick Piller avatar image Rick Piller Seth Du ♦ commented ·

"means that I assume you have plenty of instances for single VM and each instance will only host one match(low-cost ones, such as 1v1)."

The way I set it up for testing right now is I use Standard_D1_v2 (1 core) VM and have 4 servers per machine. I guess the thing I'm not sure about is what PlayFab does with that. I assume each "server" (I hate using this term as normally that means physical box but there are so many abstractions in this cloud world that now it means a server instance running on a VM server which is running on a physical server. Too many servers lol) will only host 1 instance of my game server app (seems logical), but what does the match making do? Does it send multiple matches to the same server or does it always find a new server per match is the question I guess. I have the matchId splitting code used and it doesn't hurt to have it in there even if it's 1 match per server only, but would be nice to not have it there if i'ts not needed.

0 Likes 0 ·
Show more comments

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.