Projects

Records

Online Trackmania leaderboard with a map list, statistics and hunting suggestions

View / Source
Type

website

Active

2021 - 2026

Status

Done

Tags

Trackmania, Leaderboard, Pantry

Projects
Recordswebsite2021 - 2026View / Source

Online Trackmania Nations Forever leaderboard from our community server stored by Xaseco, a Trackmania server plugin system. This project is a collaboration between me and Jokler, who built the back-end which also includes the track name parser.

At this moment, the server has 443 maps, and over its existence more than 36 players from 14 countries have driven at least one map, according to the statistics.

Records leaderboard

The project was an experiment to see if my libraries can be used in a real-life application, and it served as a good ground to test them on.

How does it work?

We collect the records and format them on the backend. Trackmania allows players to create very colorful map names using different symbols. For instance, $faf will produce pink text. A $B will produce bold text. And these can also be set per letter.

This can get out of hand pretty quickly. Here’s an example: Bad style.

<span class="wide">
  <span class="shadow">
    <span style="color: rgb(0, 102, 68)">
      Ba
      <span style="color: rgb(0, 102, 102)">
        d
        <span style="color: rgb(0, 102, 136)">
          st
          <span style="color: rgb(0, 102, 153)">
            yl
            <span style="color: rgb(0, 119, 0)"> e. </span>
          </span>
        </span>
      </span>
    </span>
  </span>
</span>

We also have the statistics page with graphs provided by Chart.js. It was quite simple to integrate the library into Cascade and I haven’t come across any issues.

canvas().setup((ctx) => {
  // Called whenever the component is inserted into the DOM
  ctx.onMount(() => {
    chart = new Chart(
      // ctx.el references the underlying HTML element
      ctx.el,
      {
        data: {
          labels: data.value.map(item => item.country.name),
          datasets: [{
            label: 'Players',
            data: data.value.map(item => item.players.length),
          }],
        }
      }
    )
  })
})

Our metrics


An interesting use of all the data we collected is to suggest players which maps they can hunt next. I personally hated booting up the game and having to switch between maps to see where I am on the leaderboard.

Now you get them handed to you and know exactly which map to play next.

Hunting suggestions

This is how the sorting works:

  1. We pick all maps where the player is in 2nd place and sort them by how close they are to the WR
  2. Sort maps by the most players and then sort again by the player’s worst times
  3. Simply list maps the player has not played in a while and doesn’t hold a WR on

Closing note

I am super proud of this project. Not only does it combine my passion for Trackmania with my absolute love for web dev, but it showed me I am capable of using my own tools to create something.