cancel
Showing results for 
Search instead for 
Did you mean: 

How To Get Leaderboard Working in Unreal Engine?

faetell
Level 3

I'm using UE 4.26, and following the documentation here: https://developer.oculus.com/documentation/native/ps-leaderboards/

I set up the leaderboard on the app:

leaderboard_screenshot.png

This is how I write to the leaderboard in BP:

leaderboard_write_bp.png

This is how I read from the leaderboard in BP:

leaderboard_read_bp.png

In game I see "Score Leaderboard Write Result: Success", so it seems the "Write Leaderboard Integer" node is returning success.

And if I stay in the game it seems to work as intended, it reads and displays that score. However, if I exit the game and restart it, it fails to find the score and shows 99999. If I go to my app dashboard and view entries for the leaderboard, it's empty:

leaderboard_no_entries_found.png

How can I get the leaderboard working, and for scores to actually write to the leaderboard and persist outside of a single game run? I've tried on the alpha and release channels, but nothing seems to work. Please help.

1 ACCEPTED SOLUTION

Accepted Solutions

ikoech
Level 2

Not sure if you're developing for Quest, but if you are then make sure that you've created and AndroidEngine.ini file under [ProjectDirectory]/Config/Android/

Make sure that file contains the following lines:

[OnlineSubsystem]
DefaultPlatformService=Oculus

Without that config file, I don't think that your quest app will use Oculus' online subsystem. I'm not entirely sure what the default online subsystem is, but it looks like it might be OnlineSubsystemNull. Peeking at the code it looks like WriteLeaderboardInteger will always return true when using OnlineSubsystemNull.

Here's the url to the the quest platform development resource page:

https://developer.oculus.com/documentation/unreal/ps-setup/


Hope that helps.

View solution in original post

2 REPLIES 2

ikoech
Level 2

Not sure if you're developing for Quest, but if you are then make sure that you've created and AndroidEngine.ini file under [ProjectDirectory]/Config/Android/

Make sure that file contains the following lines:

[OnlineSubsystem]
DefaultPlatformService=Oculus

Without that config file, I don't think that your quest app will use Oculus' online subsystem. I'm not entirely sure what the default online subsystem is, but it looks like it might be OnlineSubsystemNull. Peeking at the code it looks like WriteLeaderboardInteger will always return true when using OnlineSubsystemNull.

Here's the url to the the quest platform development resource page:

https://developer.oculus.com/documentation/unreal/ps-setup/


Hope that helps.

You sir, are an absolute savior, thank you!

I had been banging my head on this one for a long time.

Indeed, missing the Oculus platform specification in AndroidEngine.ini was the problem. When I added that it worked!

To be clear in case anyone else struggling with this finds this post, here's what I did:

1. Use file explorer to navigate to: [ProjectDirectory]/Config/

2. Create a new folder there called "Android" (if it doesn't exist)

3. In that "Android" folder, create a file called "AndroidEngine.ini" (if it doesn't exist)

4. In your editor of choice, add this content to the file:

[OnlineSubsystem]
DefaultPlatformService=Oculus

I specific in such detail because at first I was trying to add Android/AndroidEngine.ini into the solution via visual studio under the Config folder there, and that did not work.