Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Feedback Leaderboard Service : Spoofing Data

Discussion in 'Leaderboards' started by AlexGalbraithCF, Mar 23, 2023.

  1. AlexGalbraithCF

    AlexGalbraithCF

    Joined:
    Aug 27, 2021
    Posts:
    8
    So far the Leaderboards API has been an absolute joy. Has almost all the features we need, easy to integrate, great docs. There's only three issues I have encountered:
    1. I cant see a way to spoof data for testing. I'd like to be able to dump a bunch of dummy data into the leaderboard so we can test everything is working.
    2. Unable to remove cheated entries and limit max scores
    3. If the user has no score recorded the API seems to return 404 instead of a meaningful response
    I would like to re-iterate though how happy I am that this API exists. I spent 40 hours this week trying to get GooglePlay's leaderboards to work and they are completely broken. It took me under an hour to refactor and get Unity Services working with no prior knowledge. Thanks for saving my sanity.
     
  2. StevenStip-Unity

    StevenStip-Unity

    Unity Technologies

    Joined:
    Apr 7, 2021
    Posts:
    22
    Hi Alex,

    Thanks for the feedback, this is great to hear!

    I'll make sure to pass your feedback to the team so it can be prioritised accordingly.

    For your first point you're right, this is not something we provide as part of Leaderboards today. However you could use Cloud Code to generate some players' data and add that to the Leaderboard. See here for some example code: https://docs.unity.com/leaderboards/en/manual/access-cloud-code. You can either generate a single players' score and run that script from the Cloud Code dashboard a few times to add some players. Or you could use the context scope to generate data for multiple players in one script.

    Removing scores for cheaters is also possible through Cloud Code. You can create a script that takes a playerID and then run that from the dashboard that nulls or removes the players' score. https://services.docs.unity.com/lea...boards/operation/deleteLeaderboardPlayerScore

    I am not completely sure what you mean by limiting scores, are you looking to define a max value for scores that can be added to the Leaderboard? One thing we do offer is access control, see https://docs.unity.com/ugs-overview/en/manual/access-control this allows you to restrict usage for authenticated players to the API, it would allow you to for example only allow access through Cloud Code to Leaderboards.

    For #3; I'll take this feedback to the team. What would a meaningful response look like to you?

    The team creating Leaderboards have done a great job building it. It has however only been publicly released this week so we are relying on feedback like yours to make Leaderboards even better. So thank you again for providing this.:)
     
    Last edited: Mar 23, 2023
    Mj-Kkaya and IainUnity3D like this.
  3. AlexGalbraithCF

    AlexGalbraithCF

    Joined:
    Aug 27, 2021
    Posts:
    8
    Hey Steven!

    Cloud code looks great, that will work for me. I didnt realize it existed since I've entirely entered the Services ecosystem through the "I need to make a leaderboard" mindset.


    I am not completely sure what you mean by limiting scores, are you looking to define a max value for scores that can be added to the Leaderboard?
    Yes this is exactly right. Google Play for example lets you limit submitted scores to a certain threshold. Its a pretty weak bandaid tbh, but it does help limit submissions from people using cheat engines. I think it is a reasonable thing not to add since it is such a bandaid and there is better solutions.


    What would a meaningful response look like to you?

    Currently all the exceptions returned are internal to the Services assembly which means we cant pull any information from them. E.G., I cant catch
    HTTPException
    because its internal. Even so,
    HTTPException
    wouldn't really tell us much. I dont know if its because the leaderboard wasnt found or the user score wasnt found. Instead throwing meaningful public errors such as
    EntryNotFoundException
    or
    AuthenticationException
    would allow us to handle different cases and provide meaningful feedback to the user.
     
    Last edited: Mar 23, 2023
  4. MileyUnity

    MileyUnity

    Joined:
    Jan 3, 2020
    Posts:
    92
    Regarding limiting scores, you can send the scores to Cloud Code and have that perform any checks you might need to validate the submitted score (which would also allow you to do more than just a basic <= check) and then send it through to Leaderboards. This would allow you to setup rules specific to your game and have a better control over which scores should be allowed in and which should be rejected.
     
    AlexGalbraithCF likes this.
  5. AlexGalbraithCF

    AlexGalbraithCF

    Joined:
    Aug 27, 2021
    Posts:
    8
    That's a good solution and much more flexible, thanks Miley
     
  6. AlexGalbraithCF

    AlexGalbraithCF

    Joined:
    Aug 27, 2021
    Posts:
    8
    @StevenStip-Unity Turns out you do have the error responses I asked for, I just confused myself with how async-await propagates errors. Also the HTTP error gets logged to console despite it being handled internally and converted to a LeaderboardsException which was slightly confusing
     
    Last edited: Mar 27, 2023