Search Unity

Play Games Leaderboard data is incomplete

Discussion in 'Android' started by jacknoid, Jul 1, 2019.

  1. jacknoid

    jacknoid

    Joined:
    Nov 28, 2018
    Posts:
    15
    Hiya,

    I've implemented custom displays for the leaderboard data, using google's services and the unity social library.
    My issue is that totally different data shows up differently for different users, always missing some of the high scores. If i launch the google Play Games app and look at the leaderboards through their interface, or launch this same overlay UI from unity, i see the complete data with the newest top scores as expected.

    Here's my code for loading the data manually"

    Code (CSharp):
    1. // setting up a leaderboard object with maximum open options
    2. ILeaderboard leaderboard = Social.CreateLeaderboard();
    3. leaderboard.id = tableName;
    4. leaderboard.timeScope = TimeScope.AllTime;
    5. leaderboard.userScope = UserScope.Global;
    6. leaderboard.range = new Range(1, 20);
    I'm then loading the data from either
    leaderboard.LoadScores(success =>{...})
    or with google's
    PlayGamesPlatform.Instance.LoadScores(leaderboard, (bool result) => {...})

    Both return the same incomplete data for me, missing tons of entries. what's strange is some users report being able to see MOST of the entries, and other accounts like my testing one only see 2 entries, which are sort of in the middle of the ranking order in total.

    What is the simplest way to get ALL of the leaderboard entries from google play? I feel like i've read through googles and unity's social API stuff a thousand times and just can't get a reliable result from them.

    -Jack
     
  2. jacknoid

    jacknoid

    Joined:
    Nov 28, 2018
    Posts:
    15
    Canonical Play Games view, with correct scores:






    My testing user's data (sees only its self and one other user)


    Other user's view of data, shows more entires but not all of them. It doesnt include the highest scores OR their own score

     
  3. michael22

    michael22

    Joined:
    Mar 29, 2015
    Posts:
    2
    did someone ever solve that? i have also read the documentation but there is no clear answer. Still pending "What is the simplest way to get ALL of the leaderboard entries from google play?"
     
  4. Sidd_Code

    Sidd_Code

    Joined:
    May 3, 2020
    Posts:
    2
    I know its late but i think i just might have the solution for you!

    Try
    Code (CSharp):
    1. //Get this value from GPGSIds.
    2.     //e.g. leaderboardID = GPGSIds.leaderboard_leaders;
    3.     private string leaderboardID = GPGSIds.leaderboard_leaders or          eg. "CgkIwa_z5a4BEAIQAA";
    4.     //LeaderboardScoreData will start at rank #1.
    5.     private LeaderboardStart leaderboardStart = LeaderboardStart.TopScores;
    6.  
    7.     //LeaderboardScoreData will return 100 scores.
    8.     private int scoresToDisplay = 10;
    9.  
    10.     //LeaderboardScoreData will be public.
    11.     private LeaderboardCollection leaderboardType = LeaderboardCollection.Public;
    12.  
    13.     //LeaderboardScoreData will show all time scores.
    14.     private LeaderboardTimeSpan leaderboardTimeSpan = LeaderboardTimeSpan.AllTime;
    15.  
    16. PlayGamesPlatform.Instance.LoadScores (leaderboardID,
    17.             leaderboardStart,
    18.             scoresToDisplay,
    19.             leaderboardType,
    20.             leaderboardTimeSpan,
    21.             (LeaderboardScoreData data) => {...}
    As you may have notice the Leaderboard will display the no. of scores that u may have entered.