Tournament
Overview
SYSTEM_TOURNAMENT_COMPLETEevent
{
"eventData": {
"leaderboardId": "bronzeTourney",
"versionId": 40
},
"createdAt": 1485634987425,
"fromPlayerId": "",
"toPlayerId": "06d7b728-b797-41cc-a872-00a3188e151e",
"eventType": "SYSTEM_TOURNAMENT_COMPLETE",
"evId": "588cfdab9911cc728ee21eae"
}
The TournamentService API allows apps to interact with brainCloud's Global Tournaments feature.
Tournaments allow developers to automatically reward players based on their performance in leaderboards. Rewards can be virtual currencies, XP, stats and more.
To create an instance of a Tournament, you first create a Tournament Template - and attach it to a Leaderboard via the Design Portal.
Once a Leaderboard has a Tournament attached its behavior changes (i.e., you need to join the tournament before you can post scores, etc.)
At the end of a Tournament cycle (i.e. period), players are sent a SYSTEM_TOURNAMENT_COMPLETE event indicating that the tournament has completed. If there is a reward, the app should claim it.
For more information on how Global Tournaments work, see Introducing Global Tournaments.
For more information on Events, see the Events API.
Pro-tip: There are two fields, tRank and rank, in our tournament system. The former repesents the tournament ranking for the score (with tied tournament scores will be having the same tRank), the latter repesents the leaderboard ranking, it will be unique, so even tied scores will be given a different leaderboard rank (with the most recently posted "tied' score having a better rank).
Tournament Divisions
Tournaments with too many players can be less enticing to players because they have a smaller chance to win. Divisions solve this problem by arbitrarily breaking smaller groups - eg. 100 players each. We call each mini-competition a Division Instance.
Divisions Instances only exist for a single tournament period. Once the challenge period is complete, players are disbursed and will join new division instances as the next tournament cycle begins.
FYI - Division instances are essentially managed leaderboards, and are given special leaderboard ids to distinguish them. The ids, for example ^D^weekly^55, include an incrementing sequence number that identity the instance.
Note - Divisions are not to be confused with Tiers. Tiers normally imply a ranking difference between players - eg. bronze, silver and gold. You can implement this notion in brainCloud using a separate division set (or simply leaderboards+tournaments) for each tier - the management of ranking players up/down is up to the developer. Ask us for implementation suggestions if you are interested.
API Summary
Tournaments
The following API calls are used for leaderboards with Tournaments attached:
- GetTournamentStatus - view the state of a tournament
- JoinTournament - join the specified tournament
- LeaveTournament - abandon the tournament
- PostTournamentScoreUTC - post a score to the tournament
- PostTournamentScoreWithResultsUTC - post a score to the tournament, and return the updated standings
- PostTournamentScoreOnBehalfOf - post another player's score to the tournament
- ViewCurrentReward - preview the expected reward for the player based on their current rank in the tournament.
- ViewReward - view the player's reward for a completed tournament.
- ClaimTournamentReward - claim the player's reward for a completed tournament.
Use the standard Leaderboard Service apis for retrieving player standings (i.e. GetGlobalLeaderboardPage, GetGlobalLeaderboardView, etc.)
Divisions
The following API calls are specific to Divisions:
- GetDivisionInfo - get info about the specified division set. Call instead of
GetTournamentStatus()to retrieve the prize rules and scheduling status of a division. - JoinDivision - join a division set (will be assigned to an instance). Call instead of
JoinTournament(). - LeaveDivisionInstance - leave a division instance. Call instead of
LeaveTournament(). - GetMyDivisions - retrieves a list of the division instances that player is/has recently participated in
PostTournamentScoreUTC, ViewCurrentReward, ViewReward, and ClaimTournamentReward all work as expected for divisions.
System calls
- SysCreateTournamentTemplate - Creates a new tournament template.
- SysReadTournamentTemplate - Read a specific tournament template by tournament code and version.
- SysEditTournamentTemplate - Changes an existing tournament template.
- SysListTournamentTemplates - Lists all tournament templates.
- SysDeleteTournamentTemplate - Deletes the tournament template identified by the tournament code.
- SysCreateDivisionSetConfig - Creates a new division set configuration
- SysDeleteDivisionSetConfig - Deletes the division set configuration uniquely identified by the division set id, with optional, additional enforcement.
- SysEditDivisionSetConfig - Updates a division set configuration with specified changes.
- SysListDivisionSetConfigs - Lists all division set configurations for the app.
- SysReadDivisionSetConfig - Reads the current version of the division set configuration identified by the division set id.
📄️ ClaimTournamentReward
Overview
📄️ GetDivisionInfo
Overview
📄️ GetMyDivisions
Overview
📄️ GetTournamentStatus
Overview
📄️ JoinDivision
Overview
📄️ JoinTournament
Overview
📄️ LeaveDivisionInstance
Overview
📄️ LeaveTournament
Overview
📄️ PostTournamentScoreOnBehalfOf
Overview
📄️ PostTournamentScoreUTC
Overview
📄️ PostTournamentScoreWithResultsUTC
Overview
📄️ SysCreateDivisionSetConfig
Overview
📄️ SysCreateTournamentTemplate
Overview
📄️ SysDeleteDivisionSetConfig
Overview
📄️ SysDeleteTournamentTemplate
Overview
📄️ SysEditDivisionSetConfig
Overview
📄️ SysEditTournamentTemplate
Overview
📄️ SysListDivisionSetConfigs
Overview
📄️ SysListTournamentTemplates
Overview
📄️ SysReadDivisionSetConfig
Overview
📄️ SysReadTournamentTemplate
Overview
📄️ ViewCurrentReward
Overview
📄️ ViewReward
Overview