Hello everyone,
I would like to store the best players along with their scores on a leaderboard.
I followed this tutorial: EOS Leaderboards Tutorial.
However, I’m using the `WriteLeaderboards` method instead. This works correctly with the Unreal binding but not with the Steam binding.
The issue is that if you set the leaderboard to update only using `ELeaderboardUpdateMethod::KeepBest`, the stat still gets updated regardless of whether the new value is better or worse. For example, if a player has a best score of 20 and submits a score of 10, the stat will be overwritten with 10, causing a desynchronization between the stat and the leaderboard score.
This forces me to either:
- Handle `ELeaderboardUpdateMethod::KeepBest` manually.
- Or, Modify the plugin to retrieve the score directly from the leaderboard.
In the meantime, both Steam and Epic maintain a separate leaderboard scores, so it would be easy to use it as a single unified query endpoint.
Would you mind suggesting the recommended way to implement a “KeepBest” leaderboard that works correctly with both Epic and Steam (via EOSPlus)? Or can I make a PR?
Thanks,
Florian
Excerpt of change made against the plugin:
struct FOnlineStatsRow
{
// [...]
int32 Score = -1;
}
// EOS
bool FOnlineLeaderboardsEOS::ReadLeaderboardsAroundRank(int32 Rank, uint32 Range, FOnlineLeaderboardReadRef& ReadObject)
{
// [...]
for (uint32 Index = StartIndex; Index <= NewEndIndex; Index++)
{
Row->Score = Record->Score;
}
}
// Steam
virtual void Finalize() override
{
for (int32 EntryIdx=0; EntryIdx < CallbackResults.m_cEntryCount; EntryIdx++)
{
UserRow->Score = LeaderboardEntry.m_nScore;
}
}
068QP00000UdKLlYAN.txt (2.98 KB)