metapro
  • 🤝Welcome!
  • 💻metapro market
    • Set your account
    • Connect wallet + web3 login
    • Side panel
      • Transfer NFT
        • Multiple transfer (Airdrop NFT)
          • Import CSV List
      • Sell NFT
        • Initial NFT Selling (INS)
          • How to setup INS auction
          • How to buy on INS auction
        • Buy Now
          • How to setup Buy Now auction
          • How to buy on Buy Now auction
        • Auction (Bidding)
          • How to setup Auction
          • How to buy on Auction
      • All NFT assets
    • Buy Crypto
    • Top Menu
      • Profile
        • Profile Marketplace
        • My games
        • My assets
          • Royalty
        • Activities
      • Referral Panel
        • Register your downline
        • Downline wallets
        • My referral link
      • Profile Settings
      • Developer Portal
      • Logout
    • Assets
      • Marketplace
        • Auction Card
      • Most favorite
      • Newest assets
        • Asset Card
    • Games
      • Show all games
    • Leaderboard
    • Create asset (minter)
      • Gaming asset specification
      • How to create (mint) asset
        • 1. Setup NFT token
        • 2. Setup metadata
        • 3. Add meta asset
        • 4. Mint meta asset
        • 5. Meta asset created
    • Developers Portal
      • Create team
      • Create game
      • Developers Portal Panel
      • Unity Plugin
      • How to list game on metapro market?
    • Creators
    • Teams
    • Users
    • Wallet App
    • Launcher
    • Market and auction component fees
  • 🚀METAPRO LAUNCHER
    • What is metapro launcher?
    • Download launcher
    • Set your account
      • Login to launcher
    • Home
    • Games
      • Game card on launcher
        • Assets in this game
      • Install game on launcher
      • Update game on launcher
    • My games
      • Installed
      • Not installed
      • Wishlist
    • My assets
      • Collected assets
      • Created assets
      • Wishlist
    • NODEs app
  • 📱metapro one
    • About non-custodial wallet
    • Download & set up
      • Create new metapro wallet
      • Import existing wallet
    • Settings
      • Avatar
      • Multiple wallets
      • Wallet name
      • Private Key
        • Protect Private Key
        • How to find my Private Key
      • Recovery Phrases
        • Protect Recovery Phrases
        • How to find my Recovery Phrases
      • Application version
    • Network switch
    • Deposit (Tokens and Collectibles)
    • Send (Tokens and Collectibles)
      • Send Tokens
      • Send Collectibles (NFT)
    • Buy (Buy and Sell Crypto)
    • Browser
    • My assets
      • Tokens
        • Asset view
        • Adding Tokens
        • Activities
      • Collectibles (NFT)
      • Game assets (NFTma)
    • Explore
      • Apps
      • Collections (NFT)
      • Game assets (NFTma)
    • How to claim Airdrop
    • How to import wallet from MetaMask to metapro
    • Supported devices
  • ⛓️metapro protocol
    • API
      • Users service
      • Teams service
      • Apps service
      • Nft service
      • Nft events service
    • Meta asset
    • Metadata structure
    • Protocole structure
    • Unity Plugin
      • About metapro Unity plugin
      • What's new
      • Guides
        • Installation
        • Requirements
        • Package samples
        • Quick start
          • 1. Editor
            • Access tool
            • Import game key
            • Download resources
            • App data object
            • Change game key
            • Use app data in script
          • 2. Play mode (PC)
            • Enable Web3 in your game
            • Choose provider
            • Connect wallet
            • Login with Web3
            • Display user data
            • Show app tokens
            • Use user and app data from script
          • 3. Play mode (Mobile)
            • Enable Web3 in Your game
            • Choose provider
            • Connect wallet
            • Login with Web3
        • AFP (Additional Features Packages)
          • 1. Safe token transfer
          • 2. Phoenix
        • Troubleshooting
      • Reference
        • MetaproAPPSetup
        • Editor Window
        • Plugin Manager
        • Web3 connection providers
          • metapro
          • Wallet Connect
          • MetaMask
        • WindowController
        • AFP (Additional Features Packages)
          • SafeTransferFrom
          • Phoenix
  • 🛠️WALLET CONNECTOR
    • Introduction
    • Basic informations
      • Next 13 integration
      • React integration
      • Manual installation
  • 👨‍💻Developer Documentation
    • Introduction to Developer Documentation
      • What is a Meta asset?
      • What are the Benefits of Using Tokens as Access Keys for the Game Application
      • Why should I Choose the Meta Assets as the Access Keys for the Game Application?
      • How Does It Work, Exactly?
    • Available Environments
    • Blockchain Communication and information retrieval
      • How can we verify/distinguish a user?
      • How can we track a user's transactions?
      • What information can we obtain?
    • Integration with the Leaderboard service
    • Integration for in-Wallet Apps
    • Integration for Telegram Mini Apps
      • Integration Architecture and Configuration
      • Authorization and Session Management
      • Example Integration and Features
      • Code Examples from the Repository
      • Summary and Appendices
    • Developer documentation for the Construct 3 Plugin
      • Construct 3 - Install plugin
      • Plugin Configuration
      • User onboarding and authorization
      • User Management
      • Score System
      • Leaderboard System
      • Referral System
      • Gameplay
      • Smart Contract Interactions
      • User NFTs
      • Error Handling
      • Additional Getters for Plugin Properties
    • Integration Web3 with Your Game
      • What is Web3
      • Blockchain Basics
      • Differences between chains
      • What is a NFT
      • Advantages of Web3 Gaming
      • Examples of Web3 Games
    • Onboarding the Web3 Player
      • Value for Players
      • Explanation of Cryptocurrency Wallet
      • Rewards for Tournament Participation
      • Reselling Owned Assets
      • Integration of Metapro Wallet Connector
      • Displaying Data for Unlogged Users
      • How to Get Authorization Data
      • User Authorization Benefits
    • Creating Your First Meta Asset
      • The Difference between NFT and Meta Asset
      • Security and Transparency
      • Concept and Value of Meta Assets
      • How and Where to Create Your Meta Asset
        • Step-by-Step Guide on How to Create Your Asset
        • Explanation of URI (Metadata structure)
        • Explanation of the Meta Asset Data taken from our Back End
    • Implementing Meta Assets into Your Game
      • Integrate your Meta Asset to your game using Unity
      • Verify User Tokens Ownership
      • Displaying All User-Owned Tokens
      • Displaying All Assets Assigned to the Game on the Metapro Market
    • Smart Contracts
      • MetaproINS
        • Read Contract
        • Write Contract
      • MetaproBuyNow
        • Read Contract
        • Write Contract
      • MetaproAuction
        • Read Contract
        • Write Contract
      • MetaproMetaAsset
        • Read Contract
        • Write Contract
      • MetaproRoyalty
        • Read Contract
        • Write Contract
      • MetaproReferral
        • Read Contract
        • Write Contract
      • MetaproAirdrop
        • Read Contract
        • Write Contract
    • Universal Links & App Links with WalletConnect
  • 🔎General information
    • Blockchain
    • Blockchain Network Fee
    • Blockchain Native Token
    • Token ERC-1155 vs ERC-721
  • 📄Release Notes
    • Introduction to the Release Notes
    • Marketplace Updates
      • Release 07.03.2024
      • Release 06.03.2024
      • Release 04.03.2024
      • Release 19.02.2024
      • Release 24.01.2024
      • Release 09.01.2024
      • Release 03.01.2024
      • Release 21.12.2023
      • Release 18.12.2023
      • Release 13.12.2023
      • Release 12.12.2023
      • Release 02.12.2023
      • Release 30.11.2023
      • Release 24.11.2023
      • Release 22.11.2023
      • Release 17.11.2023
      • Release 13.11.2023
      • Release 09.11.2023
      • Release 08.11.2023
      • Release 07.11.2023
      • Release 31.10.2023
      • Release 26.10.2023
      • Release 25.10.2023
      • Release 24.10.2023
      • Release 18.10.2023
      • Release 05.10.2023
      • Release 03.10.2023
      • Release 29.09.2023
      • Release 18.09.2023
      • Release 14.09.2023
      • Release 12.09.2023
      • Release 06.09.2023
      • Release 25.08.2023
      • Release 17.08.2023
      • Release 04.08.2023
      • Release 31.07.2023
      • Release 21.07.2023
      • Release 18.07.2023
      • Release 13.07.2023
    • Games Launcher Updates
      • Release 13.03.2024
      • Release 24.01.2024
      • Release 04.01.2024
      • Release 22.11.2023
      • Release 03.10.2023
      • Release 31.07.2023
      • Release 27.07.2023
      • Release 20.07.2023
      • Release 13.07.2023
    • Wallet Updates
      • Release 04.03.2024
      • Release 03.10.2023
      • Release 29.09.2023
      • Release 15.09.2023
      • Release 30.08.2023
      • Release 18.07.2023
Powered by GitBook
On this page
  • How to set up a leaderboard system in the game?
  • How to get the general game leaderboard?
  • How to get the referral leaderboard?
  • How to get the map-based leaderboard?
  • Leaderboard Types
  • General Leaderboard
  • Leaderboard for a specific map (best scores)
  • Leaderboard for referral bonuses
  1. 👨‍💻Developer Documentation
  2. Developer documentation for the Construct 3 Plugin

Leaderboard System

A leaderboard system tracks and ranks user performance based on scores earned through gameplay or other activities, like referrals.

PreviousScore SystemNextReferral System

Last updated 7 months ago

It typically includes modules for recording individual achievements, aggregating total scores, and handling point adjustments such as in-game spending. Referral-based leaderboards reward users for bringing new players by adding bonus points based on the referred user's performance. These systems provide an engaging way for players to track progress, compete, and earn rewards across multiple dimensions of the game.

More info about the whole leaderboard system

How to set up a leaderboard system in the game?

How to get the general game leaderboard?

How to get the referral leaderboard?

How to get the map-based leaderboard?

Leaderboard Types

The plugin supports three types of leaderboards:

  1. General Leaderboard: Tracks user performance.

  2. Leaderboard for a specific map (best score leaderboard)

  3. Referral Leaderboard: Tracks user referral activities.

General Leaderboard

The Request Leaderboard action retrieves the leaderboard data based on the user's current score ranking, sorted in descending order. The action accepts three parameters: a limit on the number of leaderboard entries to retrieve (default is 20), a minimum balance, and a maximum balance. If the request is successful, the leaderboard data is processed to include additional user information such as username and avatar, retrieved from the user's profile.

The leaderboard is returned in the following structure:

  • results: An array of leaderboard entries, where each object contains information about a user, such as their user ID, position, current score, total score, username, and avatar.

  • count: Represents the total number of entries in the leaderboard.

  • personal: An object with personal score data. Added if it exists.

Return data:

Once the leaderboard data is successfully retrieved and processed, it triggers the On Leaderboard Received condition and updates the leaderboard variable, which can be accessed using the Get Leaderboard expression. The expression returns a stringified array of the leaderboard objects within the results array, along with the total count of entries in the leaderboard.

{
  "results": [
    {
      "userId": "user123",
      "position": 1,
      "currentScore": 3500,
      "totalScore": 5000,
      "username": "playerOne",
      "avatar": "https://example.com/avatar1.png"
    }, ...
  ],
  "count": 3,
  "personal": {
    "userId": "user456",
    "position": 2,
    "currentScore": 3200,
    "totalScore": 4800,
    "username": "playerTwo",
    "avatar": "https://example.com/avatar2.png"
  }
} // Example data

Leaderboard for a specific map (best scores)

The Request Best Scores Leaderboard action retrieves the best scores for users on a specific map by interacting with the leaderboard API. This action accepts two parameters: Map ID to specify the map for which to retrieve the best scores and an optional limit to set the maximum number of entries (default is 20). It queries the leaderboard for user scores, sorts them by the best score achieved on the specified map, and enhances the leaderboard entries with user data such as username and avatar.

Upon successful execution, the action processes the response, combining the best score data with additional user profile information (e.g., username and avatar). The response structure is as follows:

  • results: An array of leaderboard entries, each containing information about a user, including their user ID, position, best score on the map, username, and avatar.

  • count: Represents the total number of entries in the leaderboard for the specified map.

  • personal: An object with personal score data. Added if it exists.

Once the data is retrieved, it triggers the On Best Scores Leaderboard Received condition and updates the leaderboard data, which can be accessed using the Get Best Scores Leaderboard expression. The expression returns a stringified array of objects containing the leaderboard entries.

{
  "results": [
    {
      "userId": "user123",
      "position": 1,
      "bestScore": 5000,
      "username": "playerOne",
      "avatar": "https://example.com/avatar1.png"
    }, ...
  ],
  "count": 3,
  "personal": {
    "userId": "user456",
    "position": 2,
    "bestScore": 4800,
    "username": "playerTwo",
    "avatar": "https://example.com/avatar2.png"
  }
} // Example data

Leaderboard for referral bonuses

The Request Referral Leaderboard action retrieves a leaderboard containing users' referral scores, which represent bonuses accumulated from their downlines. This action requires several parameters:

  • Referral Leaderboard ID: The ID of the referral leaderboard to query.

  • Referral Leaderboard API Key: The API key required to access the referral leaderboard.

  • Limit (optional): Specifies the maximum number of leaderboard entries to retrieve (default is 20).

  • Min Balance (optional): The minimum balance filter for users' scores.

  • Max Balance (optional): The maximum balance filter for users' scores.

The action sends a request to the leaderboard API, which returns a list of users and their referral-based scores. It enhances the leaderboard by fetching additional profile details (e.g., username and avatar) for each user. The leaderboard is returned in the following structure:

  • results: An array of leaderboard entries, where each object contains information about a user, such as their user ID, position, current score, total score, username, and avatar.

  • count: Represents the total number of entries in the leaderboard.

  • personal: An object with personal score data. Added if it exists.

After successfully retrieving the referral leaderboard, it triggers the On Referral Leaderboard Received condition. The leaderboard data can be accessed using the Get Referral Leaderboard expression, which returns a stringified array of objects containing the leaderboard details.

{
  "results": [
    {
      "userId": "user123",
      "position": 1,
      "currentScore": 3500,
      "totalScore": 5000,
      "username": "playerOne",
      "avatar": "https://example.com/avatar1.png"
    }, ...
  ],
  "count": 3,
  "personal": {
    "userId": "user456",
    "position": 2,
    "currentScore": 3200,
    "totalScore": 4800,
    "username": "playerTwo",
    "avatar": "https://example.com/avatar2.png"
  }
} // Example data
Fill out the form