question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Leaderboards stopped working properly in already released stand-alone game. Still work ok when running in Unity Editor

See original GitHub issue

I’ve published a game back in january with facepunch.steamworks integration. Everything was working ok, with leaderboards integration, uploading scores, etc.

Suddenly leaderboards don’t work. If i’m running the same version of the game in Unity’s Editor everything is fine, but the already published game doesn’t connect to them.

I have not updated the release since january so I’m pretty sure it’s nothing on my side since it was already working. Maybe something is different in leaderboards and facepunch isn’t supporting it yet?

I’ve uploaded a debug version of my game and when I check my leaderboard and “leaderboard.isError” returns true every time. I’m checking the leaderboard with leaderboard= Client.Instance.GetLeaderboard("NormalRanking", Client.LeaderboardSortMethod.Descending, Client.LeaderboardDisplayType.Numeric);

All other functionality such as getting usernames and avatar works without problems.

Really worried about this :S

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:21

github_iconTop GitHub Comments

1reaction
yyr57695commented, Oct 16, 2018

Since the last time I posted, I completely re-implemented the Steam support in my game using Steamworks.NET instead. It took many hours to do this, but the advertised features in my game now once again work perfectly. I assumed that doing this would cause Facepunch to fix their library’s errors, in the same way that buying a new umbrella is the fastest way to find the one you misplaced. But I now see that unfortunately, nothing has changed. So, for the benefit of others trapped in this situation, I documented my code and am offering it here: http://hiaaron.com/?q=code Hopefully this is a help to someone.

1reaction
yyr57695commented, Jun 15, 2018

Sorry for the late reply, have not had much time to devote to projects lately. The way my game does it, after setting up the Steam client as steamClient, is:

  1. Game calls a method named SubmitTimeToLeaderboards
  2. SubmitTimeToLeaderboards contains a call to steamClient.GetLeaderboard, which executes as follows:
                    lb = steamClient.GetLeaderboard(leaderboardNames[whichLeaderboard], Client.LeaderboardSortMethod.Descending,
                        Client.LeaderboardDisplayType.TimeMilliSeconds);
  1. SubmitTimeToLeaderboards next executes this:
                if (!Environment.Is64BitProcess)
                    Thread.Sleep(225);

(I believe this is Using System.Threading)

  1. Finally, SubmitTimeToLeaderboards sets a bool to True, letting the game know that a query is in progress. That completes its work.

  2. On the next frame, the game sees that a query is still in progress, then calls a second method called SubmitTimeToLeaderboardsContinue. The first thing it does is: if ((lb.IsValid) || (lb.IsError)) If this returns false, nothing else happens until the next frame. If it returns true, lb.AddScore is called.

Currently, in 32-bit builds, this worked for me on release, then didn’t work, then worked once again after I added step 3 above. Hopefully this helps?

I will say this: after 3 months with no replies from Facepunch, I now plan to re-implement my game’s Steam support using Steamworks.NET instead, when I find the time to do it. I’ve already sunk many hours into this issue that I’d really wanted to use for further game development. It’s a shame, because Facepunch.Steamworks seemed really easy to use at first, but if we keep seeing issues like this, and it’s not going to be supported, then it’s going to cost me more time in the long run than it saves =(

Read more comments on GitHub >

github_iconTop Results From Across the Web

Steamworks leaderboards working in Unity editor but not ...
The original game works fine using Steamworks leaderboards. In the demo build the code is identical and all I have changed is the...
Read more >
My game does work in Unity,does not after build and run!
I did everything as the video tutorial,but after i build and run it through my desktop,it runs but i cant interact.I cant press...
Read more >
Troubleshooting on iOS devices
The game runs correctly when launched from Xcode but crashes while loading the first level when launched manually on the device.
Read more >
Manual: Debug C# code in Unity
You can use a debugger to inspect your source code while your application is running. Unity supports the following code editors to debug...
Read more >
What's Really Going on - Jun 17, 1985 - Page 32 - Google Books Result
Before deciding to run himself, Ruiz had endorsed Del Toro. ... Nearly all the films released so far in 1985 have already been...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found