Skip to main content

Rolling tournaments

Unlike global tournaments, which are joined by invitation, rolling tournaments are joined automatically through matchmaking. The game client only has to specify the bet amount and the number of opponents a player is willing to compete against and the matchmaking system will find other users for a competition with the given parameters.

Specific configuration for a rolling tournament is defined by the following parameters:

  • Number of players that will participate in the tournament
  • Currency used to pay the tournament entry fee and pay out the prize to the winner
  • Amount of the currency that will be awarded to the winning player

From user perspective it boils down to two steps that can be repeated in a loop:

  1. Select a rolling tournament configuration offered by the game
  2. Play a match

Each player can play only one match in the given rolling tournament, but many rolling tournaments can exist simultaneously, so a player can join as many competitions as they want, even with the same configuration. Each time enough players join the given rolling tournament it will be concluded and rewards will be distributed. In a rare case where there are not enough players to complete a rolling tournament within 24 hours, the tournament will be cancelled and entry fees will be returned to the players.

Creation

New rolling tournaments are created by the matchmaking system as needed, whenever a game client requests to join a rolling tournament with specified parameters and there are no matching active rolling tournaments. This means that the number and type of rolling tournament configurations available to players are defined by the game developer on the client side.

Fetching fees

To enter a rolling tournament a player needs to pay an entry fee. Most of that fee is made up of the prize pool for the tournament divided by the number of participants. It also includes a commission for the game developer and Elympics as well as a fee for processing the blockchain transaction (gas fee). Before the exact entry fee for a rolling tournament with the given configuration can be displayed, it needs to be fetched from the backend, which holds the up-to-date information about all elements of the fee mentioned above. To get that information, use ElympicsPlayPad.ExternalCommunicators.PlayPadCommunicator.TournamentCommunicator.GetRollingTournamentsFee. This method takes an array of rolling tournament configurations as a parameter, so you can fetch fees for all the configurations you want to offer to your players with one query.

Matchmaking

The simplest way to start a match in a rolling tournament is to call Elympics.ElympicsLobbyClient.RoomsManager.StartQuickMatch and pass a properly configured instance of Elympics.Communication.Rooms.PublicModels.CompetitivenessConfig to it. To create desired configuration for a rolling tournament use CompetitivenessConfig.RollingTournament static method. To get a coin ID required by that method you can use ElympicsLobbyClient.AvailableCoins property to get a list of all available coins. Before entering competitive matchmaking you have to make sure that the user has enough funds in their battle wallet by calling ElympicsPlayPad.ExternalCommunicators.PlayPadCommunicator.VirtualDepositCommunicator.EnsureVirtualDeposit. More information about battle wallets can be found in the battle wallet section of this document.

History

A user can be enrolled in several rolling tournaments at once. Rolling tournaments are not included in the list of global tournaments a player is participating in. To get a list of the rolling tournaments a user participated in you need to call the ElympicsPlayPad.ExternalCommunicators.PlayPadCommunicator.TournamentCommunicator.GetRollingTournamentHistory method. This method has two required parameters:

  • maxCount - Limits the number of fetched history entries
  • skip - Number of most recent history entries to skip

Battle wallet

Each player has a battle wallet to which they can transfer the funds they want to spend on entry fees and to which they will receive any prizes they win. Funds stored on a battle wallet can be withdrawn by the player at any time. To get information about the current state of a player's battle wallet and request operations on it you can use ElympicsPlayPad.ExternalCommunicators.PlayPadCommunicator.VirtualDepositCommunicator. Before you start matchmaking for a rolling tournament you have to ensure that the player has enough funds on their battle wallet. This can be done with the EnsureVirtualDeposit method. Calling this method will check the current balance of the user’s battle wallet and prompt them to top it up if necessary. Funds stored in a battle wallet are currently not displayed in PlayPad island, but you can display them in your own UI by accessing all the information about them in the UserDepositCollection dictionary, where the amount of each coin a user has stored in their battle wallet can be looked up using that coin’s Elympics ID. To give your user a chance to withdraw their funds from the battle wallet or to top it up you can call the DisplayDepositPopup method which will display a PlayPad popup with the necessary UI.