/
Stack FAQ

Stack FAQ

How does W3Champions add it’s own UI to Reforged?

Reforged runs on Chromium Embedded Framework - this is a project that lets you run a web-page inside another application. Naturally, a lot of people who work in development understand how to make good webpage UIs, so it became quite helpful to make game UIs using that same tech.

What this means is we can add our own HTML file and have the refoged UI load it.

If you have W3Champions installed you can find the index.html that we use to bring in the W3Champions interface:

That w3champions.js file brings in our entire UI and builds it with JQuery.

Additionally if ever you want to totally uninstall W3Champions, you will also have to remove this file to prevent the game from trying to load the W3Champions interface.


Where does the matchmaking happen?

matchmaking-service, which is a private repository on github for the sake of obfuscation.

This is a node/express app that communicates with the Reforged UI (the section we add above) via websocket and http. It handles:

  • The queue in memory

  • It runs the matchmaking algorithm over all the players in the queue

  • It handles the APIs for various UI data and admin tasks (e.g. banning a player)

  • It has a MongoDB database that records results

  • It communicates with the flo controller to pass off players into a game

  • It sends the data to the Flo node for the game

  • It holds the hardcoded definitions for each game mode, including mappools, vetoes, teamsizes, matchmaking parameters, etc.


How does matchmaking work in the broad sense?

It’s important to understand that systems labelled as “matchmaking” are actually doing three separate things that are entirely independent:

  • Matching players together based on some ranking value that the queuing entity (a team or an individual player) has - usually referred to as MMR or Elo Rating.

  • Using the result of a match to calculate the new Rating for the player.

  • Ranking players based on this rating.

At first glance it would seem like these are all part of the same system, but they are in fact entirely separate.

How you match players together, how you calculate their MMR and how you turn that into a ranking are all totally separate, and in the W3Champions stack, all three of these tasks are done by separate microservices:

  • Matching players that are currently in the queue is done by matchmaking-service.

  • Calculating the new MMR is done by calling mmr-service and then saved to the database by matchmaking-service.

  • The match result is picked up by website-backend which processes it to update the Rankings.


How do players get matched together?

There are some warcraft3.info articles that can give some context on this:

For some history, this is how W3Arena was made, and was also how the first iteration of W3Champions worked: https://warcraft3.info/articles/329

Improvements were made by Toxi and Helpstone that greatly improved the consistency which you can learn about in the Buckets vs Quantiles here: https://warcraft3.info/articles/357

TL;DR - you are matched based on your percentile in the MMR distribution, if you are top 5% it will be looking around that percentile, and not the raw MMR value.

Some other things are worth mentioning about player-matching:

  • The tightness of matchmaking is adaptive to activity - The system looks at activity levels in the past in order to estimate what the activity level should be right now. By knowing the activity level, the system can make educated guesses about how best to tradeoff queuing time for match quality. E.g. in the most quiet periods, matchmaking will loosen the parameters.

  • The tightness of matchmaking decreases the longer a player/team is in the queue - The system is designed such that you will always find a match.

  • The matchmaking will match players based on available servers - If you and another player cannot find an acceptable server to play on, you will not be matched. There are ping caps based on different regions, and those caps are examined and selected carefully to balance all the variables of player expectation, wait time, available servers, acceptable pings, available proxy routes, community feedback, etc.


How do you calculate the rating after a game?

matchmaking-service will call a microservice called mmr-service which does the calculation for what the new ratings should be for all the players in the game.

The exact way this is done is something of a secret-sauce of W3Champions, but if you have the mathematical interest in the process, it is based on the Glicko2 rating system with some improvements and also more adapted to our specific needs in the Warcraft 3 space.

The system was designed and is maintained by Toxi, who is the point of contact for any questions on this.


How do you rank players/what is RP?

RP stands for Ranking Points, and since the start of Season 13 (Oct 2022) they have been readjusted to be on the scale of old Battlenet “levels”, meaning as you play you will progress with a number that goes from ~1 at the beginning to ~65 if you are #1 on the ladder.

How we calculate RP is also something of a secret sauce, meaning we don’t want to give out exact formula values, but we can say a few things:

  • It uses both MMR and your number of games as inputs to the formula.

  • You can gain RP by playing more games, but this effect diminuishes (i.e. your 0-50 games count for more RP than the 500-550 of the season).

  • More RP is rewarded at the beginning of the season for activity in order to promote the new season.


Why do some games people win/lose 100 MMR and someone of the same MMR wins/lose 10?

This is called Rating Deviation.

When you first start playing on W3Champions, the system has no sense of how good you are, so when you win or lose you gain a huge amount of MMR in order to adjust you to your correct level.

Once you’ve played some games, (<10) the system will have a much better idea of where you are, and the adjustments will be much lower.

What this looks like is that sometimes a brand new player will get a huge swings in MMR for their first few games:

This is the 4th game they played
Their 15th game

How do we record stats?

When a game finishes, our UI inside the Reforged client will report the result to matchmaking-service, which will compile the data and put the result into the website-backend database in a collection called MatchFinishedEvent.

The website-backend (previously known as statistic-service) will continuously check this collection for new entries that it hasn’t seen before, and then pass off that data to a number of ReadModelHandlers.

These services all read the data and update the database with various stats.

Classes that implement this interface are parsing from the finished matches

As an example, we have the PlayerOverallStatsHandler, as the title may indicate, it looks through the event for the purpose of updating the stats for players in that game.

Specifically it updates the player’s stats concerned with the players ‘OverallStats' which is their total number of wins and games played:

(The website displays these values summed)

 

It will also update the ParticipatedInSeasons value if this is their first game of that season, which is what enables the badge on their profile.

 

Related content