Leaderboard Template

TEMPLATE NAME: Utterly Leaderboard

Leaderboard template that is derived from the META Leaderboards. It addresses the issue where a players score reverts to the historical total after a monthly/weekly/daily board reset.

Note: wherever I mention kills below this also applies to deaths.

Digging into how the original leaderboard worked I found that after a player gets a kill it queries the player storage for their kill score and adds the new kill to it before submitting a leaderboard update request. This is fine for Global leaderboards but for ones that reset, it means the players new kill score includes all kills scored prior to the leaderboard reset. As the scripts were using the default kills field in player storage there is no way the scripts could differentiate between a daily, weekly or monthly score.

To get around this situation I adjusted the scripts to store the players scores under the leaderboard TYPE and STAT eg "GLOBAL_deaths" in player storage. When a player joins a game their player store entry for that leaderboard type and stat gets overwritten with their score from the leaderboard. If the leaderboard has been reset then the score is set to zero. The new leaderboard scripts do not use the default kills, deaths, etc in the player store so any other systems referencing those values will not be impacted.

The template comes with two leaderboards (Global and Daily) which will display Kills, Deaths and KDR.
In order to display kills and deaths I created a child-parent relationship between the two boards for each Leaderboard Type eg Global Kills and Global Deaths.
The child board has no physical presence ingame and is used purely to record and store scores that are then retrieved by the parent board. Each board has two new custom properties

  1. altLeaderbaordReference - netReference to a child board.
  2. isChildBoard – Boolean,
    A parent board will have their usual netReference set and the altLeaderbaordReference set.
    A child board will just have isChildBoard set to true and the altLeaderbaordReference left blank.

I also took the KDR value out of the cloud leaderboard store and is now calculated in the client script as the board entries are populated for display.
I’m only using kills and deaths and KDR in my maps so that is the only functionality I’ve tested. If intending to use this tempalte for damage dealt or resources, then I strongly recommend thorough testing first. :blush:
There still appears to be an issue where leaderboards do not reset on the correct schedule but that isn’t something we creators can address and will just have to wait for Manticore to sort.
Let me know if you find any issues etc.

planned updates, additions, fixes, enhancements to your template

log of your template's version notes example:
1.0.0 - Initial release


All additional information here