none
LeaderBoard Display RRS feed

  • Question

  • Hello,

    I am Using Xbox live creator program to display Leaderboard.

    After Signing It doesnot show me the LeadereBoard regarding that player.

    I have added IntegerStat prefab to the LeaderBoard Class for showing Coind in my game.

    Friday, July 28, 2017 12:44 PM

Answers

  • Before we move forward, let's double check the following:

    • Just to make sure we're looking at the same thing, are you using the most recent Xbox Live Unity Plugin? Latest Release: https://github.com/Microsoft/xbox-live-unity-plugin/releases
    • Do you by any chance have the XboxLiveServices prefab on the scene yet? It's a required prefab as it allows you to toggle on and off errors and logs thrown by the various Xbox Live prefabs. Please make sure you enable the logs as it should help us debug.

     

    Now let's look at the Stat and Leaderboard details and their behavior within the Unity Editor and UWP Modes:

     

    Within the Unity Editor:

    • When you run the scene in the Unity Editor, does the Leaderboard show any entries? It should be showing some fake entries in there. This should help us verify that initial configurations are working correctly.
    • Regarding the StatPanel, if you're running the scene in the editor then the data it's showing does reset every time you restart as it's not actually calling the Xbox Live Services. Once you're running in the UWP mode, that's when the plugin starts talking to the Xbox Live Services for actual data.

     

    Within UWP Mode:

    After building and exporting the project as a UWP (as indicated at: https://docs.microsoft.com/en-us/windows/uwp/xbox-live/get-started-with-creators/configure-xbox-live-in-unity), that's when the game will start talking to the Xbox Live Services for real data.

     

    Every time you update your stats (increment, decrement, etc), the values get updated locally and then this data gets flushed every 5 minutes by the StatManagerComponent script.

     

    If your game ends before the 5 minutes, you need to make sure to flush the data manually first to make sure you don't lose that progress. To do that, you'll need to call the following method on the StatManagerComponent making sure to call it for the XboxLiveUser the stat is being written for. In the case of a Single User game, you could use:

    statManagerComponent.RequestFlushToService(XboxLiveUserManager.Instance.GetSingleModeUser().User, true);

     

    My suspicion is the stats updated weren't being flushed in time so when you restart the game, the stats start again at zero and no leaderboard entries get persisted.


    Monday, July 31, 2017 7:02 PM

All replies

  • Hello,

    I am Using Xbox live creator program to display Leaderboard.

    After Signing It doesnot show me the LeadereBoard regarding that player.

    I have added IntegerStat prefab to the LeaderBoard Class for showing Coins Collected in my game.


    Friday, July 28, 2017 12:46 PM
  • Hi Saurabhrun,

    Could you share a bit of how you're setting up the Leaderboard?

    • Do you have a UserProfile on the scene?
    • What Leaderboard Type did you select in the Inspector of the Leaderboard prefab? Global vs Friends vs Favorites
    • Also, have you submitted any values to the stat yet? If you use the StatPanel with your Integer Stat, do you see the number changing? Do you see values in it when you restart the game?

    Friday, July 28, 2017 9:44 PM
  • Yes I do have a UserProfile in my scene.

    After SignIn, I get no Values displayed.

    My Leaderboard Type is Global

    Yes I have used StatPanel  to show my IntegerStat values which are changing but they initialise from 0 after restart

    Saturday, July 29, 2017 6:09 AM
  • Before we move forward, let's double check the following:

    • Just to make sure we're looking at the same thing, are you using the most recent Xbox Live Unity Plugin? Latest Release: https://github.com/Microsoft/xbox-live-unity-plugin/releases
    • Do you by any chance have the XboxLiveServices prefab on the scene yet? It's a required prefab as it allows you to toggle on and off errors and logs thrown by the various Xbox Live prefabs. Please make sure you enable the logs as it should help us debug.

     

    Now let's look at the Stat and Leaderboard details and their behavior within the Unity Editor and UWP Modes:

     

    Within the Unity Editor:

    • When you run the scene in the Unity Editor, does the Leaderboard show any entries? It should be showing some fake entries in there. This should help us verify that initial configurations are working correctly.
    • Regarding the StatPanel, if you're running the scene in the editor then the data it's showing does reset every time you restart as it's not actually calling the Xbox Live Services. Once you're running in the UWP mode, that's when the plugin starts talking to the Xbox Live Services for actual data.

     

    Within UWP Mode:

    After building and exporting the project as a UWP (as indicated at: https://docs.microsoft.com/en-us/windows/uwp/xbox-live/get-started-with-creators/configure-xbox-live-in-unity), that's when the game will start talking to the Xbox Live Services for real data.

     

    Every time you update your stats (increment, decrement, etc), the values get updated locally and then this data gets flushed every 5 minutes by the StatManagerComponent script.

     

    If your game ends before the 5 minutes, you need to make sure to flush the data manually first to make sure you don't lose that progress. To do that, you'll need to call the following method on the StatManagerComponent making sure to call it for the XboxLiveUser the stat is being written for. In the case of a Single User game, you could use:

    statManagerComponent.RequestFlushToService(XboxLiveUserManager.Instance.GetSingleModeUser().User, true);

     

    My suspicion is the stats updated weren't being flushed in time so when you restart the game, the stats start again at zero and no leaderboard entries get persisted.


    Monday, July 31, 2017 7:02 PM