Turn rates, matchmaking, and you

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.

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

PredictedTR = 1000 * (UserDelay + 1) / Latency

  1. 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.

29 Likes

Nice! Thanks for all the work you all put into making matchmaking the best it can be within the limitations of a 20+ year old game!

If you are approaching the upper limit of optimized connectivity, team matchmaking should be edging ever closer! :grin:

13 Likes

Grant this was amazing, so well written and comprehensive. Thank you so much for giving us this deep information, particularly i had no idea “low, high, extra high latency” where in simple terms buffering the “next” things to happen in game. Very informative in fact.

Keep up the good work, i like you are prioritizing this, considering Team Match Making is probably on the way before the end of the year right?, meaning that having a stable game in TMM Rank is something not just “desirable” but a complete need. It fells we are coming to a point that everyone is happy with.

3 Likes

Great, great work. Thanks and keep it up!

2 Likes

Fantastic breakdown, highly appreciate that you took the time to write all this down for us. And yea, the latest patch did wonders, significantly improved the ladder for most non-korean players. Thanks!

5 Likes

Thanks a lot for the feedback and all the detailed explanations. Things like this mean a lot to us players!

Could you please elaborate on why VPN is not necessary anymore? I assume this system is still favors geolocation and lower latency. There’s still the case when you matched with the same person over and over on ladder if you are close to each other geographically.

So if you want to play different players each time and don’t care about lag you have to use Korean VPN still because in that particular region population is times higher than in any other region.

1 Like

So, once Elon Musk’s project Starlink at SpaceX happens, people would have better internet around the world, specially that damn latency for distance issue would become pretty much solved.

https :// en. wikipedia .org/wiki/Starlink_(satellite_constellation)

Till then, good job making all those efforts, thank you Blizzard Classic Team!

GODLIKE POST BASED GRANT DAVIES.
:rofl::rofl::rofl::rofl::joy::joy::joy::joy:

2 Likes

:thinking: :sunglasses: grant :nerd_face:

1 Like

Is this works on europe? Becouse on streams seems not. For example Bonyth can play on VPN vs Koreans but he is still not matched with Koreans wo VPN as i know.

Thanks Grant for your continued efforts and the explanation here. This latest change in matchmaking has been excellent :slight_smile: Thnx to SuGo as well for helping behind the scenes

3 Likes

Previously, the matchmaker would look at your IP address, resolve it to a location (geoip), and take a guess at what your latency would be to other regions based on this geoip location.

Now the matchmaker looks at your latency to key regions instead. This means if you can achieve a good TR game vs Korea, that’s all the matchmaker cares about to get you a fast match with Koreans. It doesn’t care where you’re based; it only cares about the predicted TR based on your ping data.

Since VPNs can add latency (some of them translate UDP ↔ TCP for example), it’s possible that you’re hurting your potential matchups by using one.

TLDR the matchmaker doesn’t care about region - there are no region buckets - it’s a global matchmaker that cares only about actual latency data. If you want more/better matches, you want to be doing everything you can to improve your latency. And that’s likely not using a VPN.

6 Likes

It’s everywhere: the matchmaker is global not regional.

What you’re describing sounds like a bug if it’s correct. We’ll need to investigate that further.

2 Likes

Uhm… in that case, the plans for a unified gateway are still underway I hope?

2 Likes

The gateway is, and has always been, irrelevant in matchmaking.

6 Likes

Okay, but I thought US. East US. West and so on were going to be merged so we could all have everything centralized.

4 Likes

Thanks Grant for your response! Makes sense to me now.

2 Likes

Just want to say a huge thanks again Grant for you and the teams continued support for the game. For our game! You guys are an amazing bunch and the fact we’re still getting patches and fixes at all is a true testamant to how much you guys care about keeping this as one of the best games of all time and finding ways to make it better still.

My matchmaking experience since you put this in (not that I’ve played a huge amount) has been much better and I’m meeting a lot more people that I never did before. I even got a TR16 game with someone from Peru! If you told me I could have that kind of latency with Peru back on the private server days I would have called you crazy haha.

Once again, thanks so much and can’t wait to see whats next!

4 Likes