Placers
Placer is the entity responsible for placing the battle session to an available DS. It is associated with a specific Fleet to acquire DS resources, and then it is referenced by configurations such as Match/Lobby/World that require DS resources. The game can manage the details of placing battle sessions through Placer.
1. How PGOS Place Battle Session to DS
DS resources are deployed in various zones of the Fleet. When a battle session needs to be placed, PGOS will select the most suitable one among these DS resources and place it there. Typically, the most suitable DS is the one with the lowest latency for all players.
1.1 Aggregate Latency
PGOS uses the latency from the player client to the Zone Ping Server as a representation of the latency from the player client to all Zone DSs. The PGOS Client SDK has built-in latency measurement functionality for all Zones, and these latency data will be automatically transmitted to the PGOS backend when needed.
If there are multiple players in the battle session to be placed, we need to aggregate the latency of these players to a zone into one (let's call it Zone Latency) in order to evaluate the suitability of the zone for the battle session.
PGOS provides 4 algorithms to aggregate latency, and the game can choose any of them when configuring the Placer:
- Max Latency: Take the maximum latency among all players' latencies.
- Avg Latency: Take the average latency of all players' latencies.
- Leader Latency: Take the latency of the leader player. The algorithm is only applicable to Lobby and World battle sessions, and the lobby owner and the join world inviter will be considered as the leader player. If there is no leader player in the battle session, the Leader Latency algorithm will be replaced by the Avg Latency algorithm.
- Avg Latency after Trimmed: Take the average latency of all players' latencies after trimming the highest and the lowest. The game can customize how to trim latency in more detail when configuring this algorithm.
1.2 Find a Zone with Available DS
For the battle session to be placed, the zone with the lowest zone latency is the optimal zone. Normally, if the optimal zone has an available DS (with sufficient DS buffer), the battle session will be placed directly on it. However, if the optimal zone does not have an available DS to place it (maybe there are too many battle sessions that need to be placed in a short period of time), the zone will scale up (or is already scaling up according to the Scaling Strategy), and PGOS will wait for a certain period of time to try to place the battle session in the optimal zone:
- If everything goes smoothly and the optimal zone provides available DS within the specified time, the placement will be completed.
- If the optimal zone still doesn't have available DS after waiting, PGOS needs to relax the latency requirements and find available DS in more Zones.
- Repeat the above steps until an available DS is found to place the battle session.
The game can customize latency requirements and find timeouts for each step when configuring Placer.
If there is no zone that meets the latency requirements of the step, it will immediately go to the next step, and the timeout duration for the skipped step will be added to the timeout duration of the next step.
2. Console Manual
2.1 Create Placer
2.1.1 Open the Creation Page
Choose DS Hosting > Placers
, click the Add Online Placer
button:
2.1.2 Fill the Required Fields
You will see the creation page as shown below:
The relevant fields are described as follows:
Placer Name:
A descriptive name for the placer, can't be modified after submission.
Associated Fleet:
A Fleet associated with the Placer, which will provide the Placer with DS process instances.
Zone Selecting Strategy of Placement
The configuration provides the game with a custom strategy for how to select a Zone DS for a battle session to be placed. It provides a default strategy, but if you want to optimize it, it is recommended that you read section How PGOS Place Battle Session to DS first to better understand the meaning of each field in the configuration.
The game can add or remove any number of steps, with each step containing 3 main fields:
Latency Aggregation Algorithm:
- Max Latency: Take the maximum latency among all players' latencies.
- Avg Latency: Take the average latency of all players' latencies.
- Leader Latency: Take the latency of the leader player. The algorithm is only applicable to Lobby and World battle sessions, and the lobby owner and the join world inviter will be considered as the leader player. If there is no leader player in the battle session, the Leader Latency algorithm will be replaced by the Avg Latency algorithm.
- Avg Latency after Trimmed: Take the average latency of all players' latencies after trimming the highest and the lowest.
Latency Requirement:
When finding available DS, the candidate zone needs to meet the zone latency restrictions.
Find Timeout:
The timeout for the current Step to find an available DS. It is actually the time to wait for the zone to scale up.
For Avg Latency after Trimmed Algorithm, there are additional configuration fields:
- Latency Trimmed Percentage: The percentage of player latency that will be trimmed.
- Minimum Number of Players: Minimum number of players required for this rule to apply. (must >= 4).
- Rounding Method: The rounding method used when calculating the number of players to be removed.
- Enforce 1 as Minimum Value: Whether to force a minimum value of 1 when rounding.
Active Battle Session Timeout:
When receiving the
OnStartBattleSession
event, the DS must call theActivateBattleSession
API within the time. (must <= 600).Max Acceptable Player Latency:
If any player has a latency > the value, no DS will be assigned for the placement. (0 means ignore this limit).
2.1.3 Submit the Creation
Click the Submit
button then a new placer is created.
2.2 Modify Placer
Step1: Choose the placer you want to edit and click the placer name or the Edit link.
Step2: You will see the Edit Placer
page as shown below:
You can modify any editable field.
Step3: Make your changes and click the Submit
button to save your modification.
2.3 Delete Placer
Step1: Choose the placer you want to remove and click the Delete link.
Step2: Double-check and confirm the operation before removing.
❗ Note:
Delete Placer
may not succeed when the placer is associated with a match/lobby/world config.- Please confirm the delete operation because it cannot be recovered.