Working with Steam Leaderboards - a few very specific questions

Hey Everyone!

Really new to C++ here - bear with me. I apologize if I’m missing something really simple, but there’s literally no documentation on this (I’ve searched EVERYWHERE)

With the minimal documentation available (again seriously - there’s like nothing) - I was able to get to the point where I can access the ReadLeaderboards() and WriteLeaderboards() functions.

HOWEVER, I have no idea how to properly use them. So…a few questions for each.

First, ReadLeaderboards:

  1. How do I get the top players from the leaderboard (for instance, I want the top 10 players)? It wants an array of specific FUniqueNetId values…Is this even possible? What’s the point of leaderboards if I can’t read the top players out…there’s no function to get the top players from a leaderboard…
  2. How do I properly tell it which steam leaderboard to read from? I can’t just put a string there, and I can’t figure out how to get or create an FOnlineLeaderboardReadRef

For WriteLeaderboards:

  1. Do I have to be in an online session to write to a steam leaderboard? (It requires a session name) - seems kind of weird to be required since it’s a single player arcade game I’m making…
  2. How do I get the FUniqueNetID? If I use GetIdentityInterface()->GetUniquePlayerID(); it doesn’t return the correct datatype.
  3. Same question as for ReadLeaderboards() - how do I use the steam leaderboard name here/tell it what leaderboard to write to? How do I create an FOnlineLeaderboardWrite?

Curious if you ever found the answers to your questions. I am specifically attempting to get the top scores, but as you say, it wants an array of specific values.

Oh lame. I thought the whole point was to use the OnlineSubsystem as a generic layer between Steam, and others such as Oculus. We can’t do just Steam. Thanks for the answer, though!

I did find a solution!

It is (currently) 100% impossible to get the top scores using the OnlineSubsystem setup in UE4 (wasted 2 weeks trying to figure it out before I got an official answer on that on another thread haha), so the OnlineSubsystem implementation of leaderboards is completely useless.

HOWEVER, following this guide:

You can enable native steam methods and bypass the OnlineSubsystem altogether.

THEN, I basically copy-pasted the “leaderboards step-by-step” code in the steamworks documentation on the steamworks partner website into a new empty class.

Then I made a new actor class that includes that class with blueprint-callable methods that call those methods.

Then I made a child blueprint class and used the methods that way. If you’re doing everything in C++ you can probably do it much more elegantly than I did, but I’m not much of a programmer haha.

Yeah might have to do separate implementations then swap them out for packaging different builds for different platforms - it’s an absolute pain, and I really hope they add the functionality soon…

Another option would be to use a third party option using json like EpicLeaderboard or Dreamlo…or write your own and host it on your web server…

Stuck at the same part. “->ReadLeaderboards” and trying to get leader board scores. I do not know how to continue. How to pass needed parameter and how to access result after that.

Did someone found a solution and is the problem of 2016 fixed and leaderboard scores can be retrieved by ue4 online subsystem correctly?