question

b avatar image
b asked

RequestMultiplayerServer - NoHostsAvailableInRegion and backfill tickets

I am new to working with playfab and I uploaded my first server.exe (created with unity) and it works.
Now I noticed that the first player-client can search for an available server using RequestMultiplayerServer.

But this will already return NoHostsAvailableInRegion for the next player that tries to connect.
What I read from this forum suggest that I need to create a backfill ticket so the server will wait for more players. Is that the right way to do it?

I am asking because for me this workflow seems strange.
Because every game will have more than one player so I wonder why RequestMultiplayerServer works the way it does.

Maybe I should approach the whole "how clients connect to a server" concept differently?

10 |1200

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

b avatar image
b answered

Thanks for your help.

I build my own solution which does the following

  • ping all PlayFab server locations (all regions where you uploaded your server to)
    and get the one with the best ping
  • if no server is active at that location, get one out of standby
  • if one is active, check if there is still room for some more players.
    If so connect to it. If not get another server out of standby


I wrote a guide for other people who might search for a solution for unity 3D.

https://jarc.xida.net/2021/04/06/playfab-multiplayer/

1 comment
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 Chen avatar image Rick Chen ♦ commented ·

I am glad that you have built your own solution. And thanks for your effort in writing a guide.

0 Likes 0 ·
Rick Chen avatar image
Rick Chen answered

The NoHostsAvailableInRegion error usually indicates that there is no available server for the region you are requesting. The RequestMultiplayerServer API is used to request a multiplayer server session, not joining other player’s server. How many servers have you assigned to the build?

If you would like to connect second player to the server requested by the first player, you could implement a way to share the server information (IP address, port number etc.) to the second player. Or use the backfill ticket as you mentioned, the Server backfill tickets allow a game server to search for additional players which will fit into the game currently being played, please refer to: Using server backfill tickets for more detail.

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.