locked
Unity Leaderboad prefab RRS feed

  • Question

  • I am trying to get leaderboards working in my unity game. However, I not having much luck at this.I have a High Score leaderboard deployed through the portal with the ID of HighScore; it is a Integer stat. I have put a IntergerStat in my game scene. When the player gets a new Hi Score I set the value of the IntergerStat. I have waited 30 min to see if the score posts. So far I can't tell that it has. I have been running the game from visual studio. My leaderboard prefab has a Xbox Live User, and a Stat. the type is set global.

    Does any know have an idea what I am doing incorrectly?

    Thank you,

    Travis

    Saturday, April 7, 2018 11:13 PM

Answers

  • Hi Travis,

    I highly recommend you give the new release of the plugin a try. It has a new authentication system that should be a lot easier to add in your game and the Leaderboard and Stat prefabs are already updated in it to use that system. 

    Would you mind giving it a try and let us know that helps or not? https://github.com/Microsoft/xbox-live-unity-plugin/releases/tag/v1804

    • Marked as answer by travis.pettry Thursday, May 10, 2018 4:00 PM
    Thursday, May 3, 2018 7:00 PM
  • Hello, Travis.

    Since we did not hear any update from you.

    We will close this thread for now.

    But please feel free to reach us again, if you have any concern or questions.

    Thanks!

    Tuesday, May 8, 2018 10:52 PM

All replies

  • Hi Travis,

    Thank you for posting on our forum, I have a couple of questions for you.

        • What engine
               are you using (if any) and what version?
        • What version
               of Xbox Live are you using?
        • What IDE
               (i.e. Visual Studio) are you using and what version?
      • What version
             of the Windows SDK are you using?”
    1. .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?


    Thank You,

    Brett

    Monday, April 9, 2018 6:11 PM
  • Hi Brett,

    Thank you for taking the time to help me out.

    • What engine: Unity 2017.3.1f1
    • Xbox Live Version: I downloaded the XboxLive.unitypackage on 3/2/2018. When I look at the refrences in Visual Studio I only see Microsoft.Xbox.Services.UWP.CSharp Runtime v4.0.30319 Version 1.0.0.0
    • Visual Studio 2017
    • I can see the values in the stat panel when I call HighScore.Value = //some int. However, When I reload the scene or restart the game the stat is zero again.

    Thank you,

    Travis Pettry

    Tuesday, April 10, 2018 3:32 AM
  • Hello, Travis.

    Could you please provide the following question below:

    • What version of the Windows SDK are you using?”

    Please let us know.

    Thanks!

    Young Kim 

    Tuesday, April 10, 2018 3:38 AM
  • Windows SDK 10.0.16299.0
    Tuesday, April 10, 2018 5:34 AM
  • Hi Travis,

    Thank you for the reply back. I have a follow up- question for you. What version of XboxLive Unity Plugin are you using? you can find the most recent version here: https://github.com/Microsoft/xbox-live-unity-plugin/releases.  Also this page my help if you have not taken a look at it. https://docs.microsoft.com/en-us/windows/uwp/xbox-live/get-started-with-creators/add-stats-and-leaderboards-in-unity#leaderboards

    Thank You,

    Brett Rudd

    Tuesday, April 10, 2018 5:19 PM
  • I am using release 1711 of the Xbox Live Unity Package. I have been using the page that you mentioned. 
    Tuesday, April 10, 2018 5:22 PM
  • Ok. This should help clarify a few things.

    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);

    Its possible its flushing the stats that are updated too soon and resetting them to zero.


    Tuesday, April 10, 2018 5:30 PM
  • I was originally seeing fake data in the leader board but I have not seen that in quite some time. I have been testing my game in UWP mode to verify that all is working.

    Tonight I started to see an Xbox Live login issue again. I keep getting the error 0x8015DC12. I cannot seem to log in anymore. I have checked the XboxServices.config and all of the data seems to be correct. I have switched my PC to dev mode and I get the same error on my Xbox.

    Wednesday, April 11, 2018 5:04 AM
  • Hello, Travis.

    When your log in issue resolved, could you please provide the repro steps with actual/expected result.

    Once we have these details, we might have a better idea of which direction to take this investigation.

    Thanks!

    Young Kim


    Wednesday, April 11, 2018 5:13 AM
  • I have resolved the log in issue. However, the leaderboard issue still persists. 
    Thursday, April 12, 2018 5:24 AM
  • Hi Travis,

    Thank you for the response back, we have someone looking into this issue.

    Thank You,

    Brett

    Thursday, April 12, 2018 5:19 PM
  • I have finally captured an exception being thrown in the leaderboard. My Xbox user is null. However, I do not understand how this could be. I have a signed in user, and I have populated the Xbox Live User field on the leaderboard prefab.
    Monday, April 16, 2018 4:16 AM
  • Hi Travis,

    I highly recommend you give the new release of the plugin a try. It has a new authentication system that should be a lot easier to add in your game and the Leaderboard and Stat prefabs are already updated in it to use that system. 

    Would you mind giving it a try and let us know that helps or not? https://github.com/Microsoft/xbox-live-unity-plugin/releases/tag/v1804

    • Marked as answer by travis.pettry Thursday, May 10, 2018 4:00 PM
    Thursday, May 3, 2018 7:00 PM
  • Hi Travis,

    Did the updated Xbox Live Unity Plugin resolve your issue? Please let us know.

    Thank You,

    Brett

    Monday, May 7, 2018 5:46 PM
  • Hello, Travis.

    Since we did not hear any update from you.

    We will close this thread for now.

    But please feel free to reach us again, if you have any concern or questions.

    Thanks!

    Tuesday, May 8, 2018 10:52 PM
  • The latest version of the Xbox Live Unity plugin fixed the issue.
    Thursday, May 10, 2018 4:00 PM