# Leaderboard subscores update behaviour

**URL:** <https://forum.heroiclabs.com/t/leaderboard-subscores-update-behaviour/2273>\
**Category:** Game Design\
**Created:** [January 17, 2022, 8:12pm UTC](https://forum.heroiclabs.com/t/leaderboard-subscores-update-behaviour/2273 "2022-01-17T20:12:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![adbourdages](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/adbourdages/32/944_2.png) [@adbourdages](https://forum.heroiclabs.com/u/adbourdages)\
**Post date:** [January 17, 2022, 8:12pm UTC](https://forum.heroiclabs.com/t/leaderboard-subscores-update-behaviour/2273/1 "2022-01-17T20:12:12Z")

</div>

Hello,

Score and subscore update independently of each other. In a leaderboard set to Best and Descending:

- I create a first leaderboard entry with `{score: 1, subscore: 10}`
- then a second write is done with `{score: 2, subscore: 4}`
- The storage object has the values `{score: 2, subscore: 10}`

It appears that subscore will only update if the new value is larger than the previous one, which makes no sense - the combination of score and subscore should be taken into account together to determine whether a score is “better” than another one. And the whole record should then be updated, along with the metadata.

Say the score represents the number of enemies killed and the subscore is the number of headshots. In game A, the player does 10 kills and 3 headshots. In game B, the player kills more enemy but has fewer headshots (12 kills, 1 headshot). It is a better score than is previous one - so I want the record to reflect the best results: 12 kills, 1 headshot. With my testing it would give me 10 kills, 3 headshots which is not the result of any games played.

Am I missing something?

---

<div class="post-metadata">

**Author:** ![mofirouz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/mofirouz/32/1523_2.png) [@mofirouz](https://forum.heroiclabs.com/u/mofirouz)\
**Post date:** [January 18, 2022, 9:39am UTC](https://forum.heroiclabs.com/t/leaderboard-subscores-update-behaviour/2273/2 "2022-01-18T09:39:46Z")

</div>

I think you maybe right on some aspect of this, I’ll let @zyro chime in and see if there is something more to this. Thank you!

---

<div class="post-metadata">

**Author:** ![adbourdages](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/adbourdages/32/944_2.png) [@adbourdages](https://forum.heroiclabs.com/u/adbourdages)\
**Post date:** [January 20, 2022, 5:55pm UTC](https://forum.heroiclabs.com/t/leaderboard-subscores-update-behaviour/2273/3 "2022-01-20T17:55:50Z")

</div>

I ended up doing a custom check against the existing leaderboard record and using Operator.Set instead of Best. It works well enough at the cost of an additional database check. However, for planning purpose it would be good to know whether this is by-design or to be considered a bug.
