question

Amitai Mazliah avatar image
Amitai Mazliah asked

matchmaking regions latency

Hi all

I followed the guide on matchmaking which is integrated with playfab server.

I made a queue with latency rule, and I send the matchmaking request like described here

Specifying attributes with your tickets - PlayFab | Microsoft Docs

My question is, how do I calculate the latency of the player per each region?

any best practice? like when and how to get the latency?

Should I calculate the latency before matchmaking request? or once every x mins?

thanks in advanc

multiplayerMatchmaking
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

·
Rick Chen avatar image
Rick Chen answered

To measure the latency of the player per each region, you could implement the following in client side:

  1. Call ListQoSServersForTitle. This provides hostnames to PlayFab's QoS (Quality-of-service) beacons.
  2. Create UDP socket.
  3. Send a single UDP datagram to port 3075 on the QoS server. The message content must start with 0xFFFF (1111 1111 1111 1111).
  4. The server will reply with a single datagram, with the message contents having the first 2 bytes "flipped" to 0x0000 (0000 0000 0000 0000). The rest of the datagram contents will be copied from the initial ping.
  5. Measure the time between sending the UDP message and receiving a response.

Please refer to this document: Using Quality-of-Service (QoS) beacons to measure player latency to Azure

You could collect the latencies and put them in the matchmaking request for region selection rule. It is up to you to decide how often to calculate the latency.

10 |1200

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

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.