Hi folks!

As we promised in our 2019 Priorities list, over the last 12 months we’ve been working on some improvements to our global matchmaker.

Although I’m always in favor of full transparency with the community, we’ve done a couple of deployments in secret so that the placebo effect wouldn’t taint the results. I figured if we made actual progress, we’d hear about it one way or another. After our last deployment on 8/8, that was certainly the case! It seems the new algorithm has been favorably received across the board, and has provided a significant improvement to global matchmaking.

So what’s changed?

The primary change has been to use actual ping data from your PC to one of our data centers as a variable in the calculation of estimated latency based on region. This provides a more accurate prediction of what Turn Rate (TR) you’re likely to achieve when matching other players. This also means that players who were previously using VPNs no longer need to use them - and you may see better latency from not using them.

Let’s talk about Latency and Turn Rates

I’ve seen a lot of speculation about latency and turn rates and what was and what is, so let’s dive into the math and history a little bit.

StarCraft uses a turn locked networking model. You can think of this as playing a board game - everybody takes their turn, and we can only move on to the next round once everybody’s turn is agreed upon and resolved. In StarCraft, everybody’s turn is happening simultaneously, but the important part is that we can only move onto the next round when everybody’s current turn is done. Now, turns happen a little faster in StarCraft than a board game - StarCraft is capable of processing up to 24 turns every second. We call this the Turn Rate (TR). So TR24 means 24 turns are being processed per second. However, input processing happens faster than this, which means we can provide multiple actions per turn.

Prior to 1.18, StarCraft’s codebase supported 3 possible TRs - 24, 12, and 8. In LAN, the game was configured to use TR24. In Battlenet, it was TR8. Over the years, community developers created addons, which offered the ability to change the TR inside StarCraft. They used an L notation to achieve this - L1, L2, and L3. This translated to 24 / L. In other words L1 was TR24, L2 was TR12, and L3 was TR8. LatencyChanger was an example of such an addon.

In SCR, we expanded the code to allow any TR (up to 24, the maximum that the SC engine permits). This opened the door to TR10, TR14, TR16, and eventually TR20. We also added a Dynamic Turn Rate system (DTR), where the code will adjust the turn rate in response to the in-game latency.

The cold hard math

Now that the background is covered, there are a couple of formulae that underpin all of this.

Given the latency to my opponent, what is the best TR that we can hope for?

PredictedTR = 1000 * (UserDelay + 1) / Latency

For us to achieve a certain TR, what latency do I require to my opponent?

MaxLatencyPermitted = (1000 * (UserDelay + 1)) / TR

UserDelay is:

2 for Low Latency

3 for High Latency

4 for Extra High Latency

For full disclosure, UserDelay is a variable I’m using since I’ve seen it used in other community posts/sites. Under the hood, UserDelay is a calculation from other variables, but it’s not really helpful to grok the details of that since it always resolves to 2, 3, or 4 in SCR. It may have been different values in 1.16 or earlier.

Using formula 2, we can easily throw together this table for quick comparison of TRs, UserDelays, and Latencies:

TR Low latency High latency Extra high latency 24 125 167 208 20 150 200 250 16 188 250 313 14 214 286 357 12 250 333 417 10 300 400 500 8 375 500 625

What this table shows is the maximum ms latency you can have to your opponent to achieve the TR listed on the left. For example: if you have a latency of 200ms to your opponent, you can expect to achieve:

TR14 if you only want Low Latency,

TR20 if you’re OK with High Latency,

TR24 if you’re OK with Extra High Latency.

What are these Latency settings (Low, High, Extra High) anyway?

Essentially, the Latency settings describe how many turns are “in flight”. If we return to my board game example, playing the board game on Extra High latency would be akin to announcing your current turn to your opponents plus your next four upcoming turns. You could also think of it as buffering in the same way as YouTube or Netflix works (except a really, really small buffer in our case!). And just like Netflix, the buffering removes stuttering and provides a smoother experience at the expense of responsiveness. On the other hand, insisting on playing at a TR beyond that which your connection can sustain will introduce a different type of lag - a stuttering experience as the game waits for the next turn to be received and confirmed by all players.

So what’s next?

Since launch, we’ve rolled out numerous improvements to vastly improve on StarCraft’s networking well beyond that offered in 1.16:

Dynamic Turn Rate (DTR)

TRs 10, 12, 14, 16, 20, and 24 on Battlenet.

STUN servers

Proxy servers

Continual iteration of the matchmaking algorithm to support both our high population, low latency Korean players and our lower population, higher latency foreign population

Bug fixes to the underlying networking layer

At some point, though, there’s a hard limit, and that’s the latency between two players. Latency is often a factor of distance, though other factors can also (sometimes precipitously) increase latency such as playing over wifi, the quality of internet in regions between you and your opponent, the quality of wiring at your or your opponent’s location, and so on. If you want to get an idea of your latency, there are various sites that run a battery of latency tests to data centers such as Google, Amazon, etc. This is certainly not a 100% accurate report, but it will give you an idea of the best TR you can hope to achieve against each region (and you’re probably most interested in Korea).

So, certainly we’re limited by the physicality of the internet and factors outside of the game’s control, but we’ll continue to tweak the matchmaker with the goal of being as inclusive as possible and getting as many people matching as we can!

Last but not least: a word of thanks

It seems like a good time to thank everyone involved in this community for, well, being the greatest, most passionate gaming community on the planet, and helping us level up our matchmaker with continual feedback. I’d also like to give a special shoutout to SuGo, who provided us with some fantastic data - VODs, testing, and accurate feedback to help us very quickly identify one of the final bugs in the new algorithm which paved the way for a new release on 8/8.