question

doelbaum avatar image
doelbaum asked

What is the best way to implement a simple overflow-style server?

Hey everyone,

I am very new to PlayFab and am looking for advice.

I am building a virtual experience with Unity and am trying to create a very simple multiplayer implementation. In this virtual experience, there are a lot of user-created "maps" which can be viewed/played by (hopefully) 50 players at once.

The rules for multiplayer implementation are as follows:

1) Someone selects a map (e.g. Map X).

2) If there are multiplayer instances of Map X already running, which have LESS than 50 players, join one of those instances.

3) If there are no instances of Map X already running OR every running instance is full, create a new instance.

My question is: what is the best way to implement this? I have read about matchmaking and I feel like I could possibly wrangle it to fit what I am trying to do here but I feel like there is a cleaner, simpler way that I don't know about.

Any advice would be greatly appreciated!!

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

·
Seth Du avatar image
Seth Du answered

Ideally, you will need to have an external Database Server to cache the “Maps” and servers information. What’s running inside of server build won’t be exposed to PlayFab directly.

In terms of Matchmaking, the matching lifecycle ends when the tickets are matched, and if auto-allocation is enabled, the server instances will be initialized. After that, to join a running session, the server should actively create backfill tickets. I am not sure of if “Map X” is UGC or pre-defined name, but I believe you can let the players matchmake queue and only create a new server instance when waiting too long.

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

doelbaum avatar image doelbaum commented ·

Yes, I already have a database for the maps and map information AND a way to load them into the game scene.

I see what you mean...on the topic of backfill tickets, it would seem that in my case, I'd want to create a backfill ticket immediately upon starting a new instance of a game (let's say there are 0 players playing, and 1 person starts playing, in my case I'd want that player to start a new multiplayer instance and then a backfill ticket is created for 49 players?).

Regarding the new server instance created, how would I do that so that it gets added to the list of eligible multiplayer games for matchmaking?

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ doelbaum commented ·

This is not a common scenario of using backfill tickets. a backfill ticket will only match one player and you will need to create 49 tickets separately in your scenario.

Please also note that since the matchmaking process is unpredictable and you cannot estimate the time. It is possible that very few players wait in a server instance while they cannot start the game due to lack of enough players. Though in terms of gaming experiences, they won't notice the differences, please understand that this scenario could cost massive unnecessary computing hours. Since PlayFab won't charge matchmaking via time, I highly suggest you only create backfill tickets when it is necessary.

>>Regarding the new server instance created, how would I do that so that it gets added to the list of eligible multiplayer games for matchmaking?

PlayFab server build is fully customized. You can add your own http calls there to update data on your database server.

0 Likes 0 ·
doelbaum avatar image doelbaum Seth Du ♦ commented ·

Forgive me if this comes across as rude (it is solely because I just don't know very much about matchmaking), but in my case, won't it actually not take that much time? When a player joins matchmaking, they are only looking for active games on "Map X" and only Map X. If there are no active games, or all the games are full, then they make their own. I understand I am not accounting for player network stability, or geographic location, which matchmaking probably takes into account.

Is there another, non-backfill solution I can use to achieve this by the way? If backfill is too costly or cannot support it

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.