在不同遊戲的類型可以用不同的條件配對成團,以下為常見配對後可以接受補位的情境:
Player 1 creates a Ticket (
T1
).Director calls
Backend.FetchMatches
with a MatchProfile.MMF runs
QueryBackfills
andQueryTickets
using the MatchProfile. It returnsT1
.MMF constructs a new Backfill (
B1
) and returns aMatch
containing ticketT1
and BackfillB1
. The Backfill should be created with fieldAllocateGameServer
set totrue
, so the game server orchestrator (e.g.: Agones) knows it has to create a new Game Server. The Director handles making calls to create the Game Server.Director starts allocating a Game Server with Backfill
B1
information.Player 2 creates a Ticket (
T2
).Director calls
Backend.FetchMatches
.MMF runs
QueryBackfills
andQueryTickets
using the MatchProfile. They returnB1
andT2
accordingly.MMF determines
B1
could be used based on data set onB1
by the last run of the MMF (e.g. a number of open slots).T2
andB1
form a new Match.When the Game Server has started, it begins polling Open Match to acknowledge the backfill with
Frontend.AcknowledgeBackfill
using the backfill’s ID (B1.ID
) and supplies connection information for the server, to be returned as theAssignment
data of the ticketsT1
andT2
. The Game Server also receives the ticket data of the tickets that were assigned so that any data supplied on the ticket (e.g. player IDs) may be used by the game server.
由上述流程可以看到一個重點,MMF 是讓我們可以使用 backfill 機制的主要角色,想要使用 backfill,我們勢必要在我們的 MMF 上,實作出符合補位機制的邏輯。而另一個需要注意的重點是,遊戲伺服器必須持續的向 Frontend,確認是否有需要補位的情況,透過使用 Frontend.AcknowledgeBackfill
接口,達成 Open-Match 與 Game Server 之間的資訊同步。