• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 23:52
CEST 05:52
KST 12:52
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
BGE Stara Zagora 2025: Info & Preview27Code S RO12 Preview: GuMiho, Bunny, SHIN, ByuN3The Memories We Share - Facing the Final(?) GSL46Code S RO12 Preview: Cure, Zoun, Solar, Creator4[ASL19] Finals Preview: Daunting Task30
Community News
Weekly Cups (June 2-8): herO doubles down1[BSL20] ProLeague: Bracket Stage & Dates9GSL Ro4 and Finals moved to Sunday June 15th12Weekly Cups (May 27-June 1): ByuN goes back-to-back0EWC 2025 Regional Qualifier Results26
StarCraft 2
General
Weekly Cups (June 2-8): herO doubles down The SCII GOAT: A statistical Evaluation BGE Stara Zagora 2025: Info & Preview Magnus Carlsen and Fabi review Clem's chess game. Jim claims he and Firefly were involved in match-fixing
Tourneys
Bellum Gens Elite: Stara Zagora 2025 Sparkling Tuna Cup - Weekly Open Tournament SOOPer7s Showmatches 2025 Master Swan Open (Global Bronze-Master 2) $5,100+ SEL Season 2 Championship (SC: Evo)
Strategy
[G] Darkgrid Layout Simple Questions Simple Answers [G] PvT Cheese: 13 Gate Proxy Robo
Custom Maps
[UMS] Zillion Zerglings
External Content
Mutation # 477 Slow and Steady Mutation # 476 Charnel House Mutation # 475 Hard Target Mutation # 474 Futile Resistance
Brood War
General
Will foreigners ever be able to challenge Koreans? BGH auto balance -> http://bghmmr.eu/ Mihu vs Korea Players Statistics BW General Discussion [BSL20] ProLeague: Bracket Stage & Dates
Tourneys
[ASL19] Grand Finals NA Team League 6/8/2025 [Megathread] Daily Proleagues [BSL20] ProLeague Bracket Stage - Day 2
Strategy
I am doing this better than progamers do. [G] How to get started on ladder as a new Z player
Other Games
General Games
Stormgate/Frost Giant Megathread Armies of Exigo - YesYes? Nintendo Switch Thread What do you want from future RTS games? Path of Exile
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
LiquidLegends to reintegrate into TL.net
Heroes of the Storm
Heroes of the Storm 2.0 Simple Questions, Simple Answers
Hearthstone
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
US Politics Mega-thread Things Aren’t Peaceful in Palestine Russo-Ukrainian War Thread Vape Nation Thread European Politico-economics QA Mega-thread
Fan Clubs
Maru Fan Club Serral Fan Club
Media & Entertainment
Korean Music Discussion [Manga] One Piece
Sports
2024 - 2025 Football Thread Formula 1 Discussion NHL Playoffs 2024
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread Cleaning My Mechanical Keyboard
TL Community
The Automated Ban List
Blogs
Cognitive styles x game perf…
TrAiDoS
StarCraft improvement
iopq
Heero Yuy & the Tax…
KrillinFromwales
I was completely wrong ab…
jameswatts
Need Your Help/Advice
Glider
Trip to the Zoo
micronesia
Poker
Nebuchad
Customize Sidebar...

Website Feedback

Closed Threads



Active: 22299 users

Preventing Observer Desyncs

Forum Index > BW General
Post a Reply
tec27
Profile Blog Joined June 2004
United States3696 Posts
February 08 2022 02:03 GMT
#1
In the latest version of ShieldBattery, we've identified and fixed the bug that has been causing desyncs for observers. Since not every tournament is played through ShieldBattery, I thought I'd explain what the underlying cause is and how you can avoid triggering it in games you are observing.

tl;dr: How you can avoid triggering a desync as an observer
  • Observe games through ShieldBattery. We've fixed the bug so it won't occur in any games there.
  • Don't change the player vision settings once a unit requiring detection is in the game (includes both stealth and burrowed units)


Example of this occurring:

(starts around 44:11 in case the embed doesn't get the time)


What's going on

In StarCraft, detection is not removed immediately when the unit/building providing it goes away. You can see this pretty clearly if you kill a detector, there will be brief period where cloaked units can still be seen. When Blizzard added the observer mode, they mostly reused existing game logic to implement the various features, including switching between different player's vision. At some point they decided that the existing logic around stealth units (that detection would be applied after a delay) was unacceptable for observer mode: they wanted switching to a player's vision to apply the detection status immediately.

So, Blizzard wrote code to call a function to update the sprites for those units immediately, thinking it was safe. *But* that code actually calls through to update the "real" detection status for this unit as well (a value used by the game for simulating actual game logic). If this value differs from the values the actual players have, it risks causing a desync between the players and the observer.

Desyncs are often very subtle, e.g. they may just result in a different amount of random numbers being generated during a particular turn. But these things quickly add up over time: one extra random number during a turn might make a unit miss on one person's game when they hit on everyone else's, which then results in a unit dying when it lived in the "real" game, and then on and on until you get to extremely observable effects: tons of idle workers, units running to their death with no micro, etc.

So in the linked VOD above, the observer changes player visions around 44:27, when a DT is on the field. This triggers this desync, which the broadcast crew + Tastosis do not notice for about 2 minutes (although they are very confused!), which can show you how subtle this is.

On ShieldBattery, we've fixed this by preventing changes to the unit detection status outside of a particular code path, so if you're playing/observing games there, everything will fine. If you're playing games on LAN or Bnet, avoiding changing the player vision once any stealthed units are out should avoid the desync as well.
Can you jam with the console cowboys in cyberspace?
Dakota_Fanning *
Profile Joined January 2008
Hungary2347 Posts
Last Edited: 2022-02-08 11:51:31
February 08 2022 11:51 GMT
#2
Good job tec27, I still don't understand why Blizzard pays its employees instead of you.
https://repmastered.icza.net
Ziggy
Profile Blog Joined June 2013
South Korea2105 Posts
February 08 2022 11:51 GMT
#3
another victory for the private sector
WriterDefeating a sandwich only makes it tastier. @imjustziggy
oxKnu
Profile Joined December 2017
1178 Posts
Last Edited: 2022-02-08 13:07:32
February 08 2022 13:07 GMT
#4
Such a significant game-breaking bug for observing/replays.

At least the players can't be affected by it, which is just the fortunate side of it.
M3t4PhYzX
Profile Joined March 2019
Poland4170 Posts
February 08 2022 17:54 GMT
#5
Man I love this community.
odi profanum vulgus et arceo
IntoTheWow
Profile Blog Joined May 2004
is awesome32274 Posts
February 08 2022 18:18 GMT
#6
tec27, the one true king
Moderator<:3-/-<
ZZZero.O
Profile Joined July 2011
Poland1489 Posts
February 08 2022 19:06 GMT
#7
So all the desyncs could have been avoided! It was all my fault!
https://www.patreon.com/Bombastic || https://liquipedia.net/starcraft/Bombastic_StarLeague || https://linktr.ee/bombastic
earob84
Profile Joined October 2017
Germany175 Posts
February 08 2022 19:17 GMT
#8
Wow great Job tec!
Maybe you are the first person that found the reason for the obs-desyncing. Or does the korean community know about it?
Cryoc
Profile Joined July 2011
Germany909 Posts
February 08 2022 19:28 GMT
#9
Very nice find! With the workaround of not changing the vision, the future ASL games will be safe as well.
http://www.twitch.tv/cryoc
Grouhh
Profile Joined May 2019
56 Posts
February 09 2022 12:07 GMT
#10
You guys are awesome!
GG WP
oxKnu
Profile Joined December 2017
1178 Posts
February 09 2022 12:15 GMT
#11
Yeah, I imagine that the Korean community also knows about it now.

I know some users here are Koreans and will probably share this on ygosu and whatnot..
y2kid
Profile Joined May 2018
92 Posts
February 09 2022 12:51 GMT
#12
@ZZZero.O I do not think all the desyncs could have been avoided. Correct me if I am wrong, Tec, but he found one of the reasons why this happens. I have noticed that sometimes replays that are saved as LastRep.rep are desynced every time you watch them, but if you find the "auto-saved" replay it renders just fine. So the vision bug is one of the reasons for desync but I do not think all. Of course, we are talking replays vs live games but still it happens for a variety of reasons. Additionally, from watching the BSL casts, I have noticed that desyncs are more likely to occur if the latency between the players is not very good, i.e., when players from two continents play more desyncs occur compared to two opponents located geographically closer.
tec27
Profile Blog Joined June 2004
United States3696 Posts
Last Edited: 2022-02-09 19:49:29
February 09 2022 19:46 GMT
#13
On February 09 2022 03:18 IntoTheWow wrote:
tec27, the one true king

Credit where it's due, neive is the one who found this for us and developed a fix (and also developed our fix for the floating SCV glitch and various other exploits that still work on Bnet). He just doesn't post on TL and I thought this would be helpful for the community in general

On February 09 2022 21:51 y2kid wrote:
@ZZZero.O I do not think all the desyncs could have been avoided. Correct me if I am wrong, Tec, but he found one of the reasons why this happens. I have noticed that sometimes replays that are saved as LastRep.rep are desynced every time you watch them, but if you find the "auto-saved" replay it renders just fine. So the vision bug is one of the reasons for desync but I do not think all. Of course, we are talking replays vs live games but still it happens for a variety of reasons. Additionally, from watching the BSL casts, I have noticed that desyncs are more likely to occur if the latency between the players is not very good, i.e., when players from two continents play more desyncs occur compared to two opponents located geographically closer.

Yeah, replay desyncs are (mostly) a separate issue, and have been around since before SC:R and this change. If the same code is used while watching replays when changing player vision (I'm honestly not sure if it is or not, given that the UIs are implemented differently) this could have caused the same issues there, but there are also other cases where replays desync and I'm not entirely sure what the underlying cause is there.
Can you jam with the console cowboys in cyberspace?
Please log in or register to reply.
Live Events Refresh
Next event in 7h 9m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
NeuroSwarm 213
Nina 211
Livibee 205
RuFF_SC2 170
StarCraft: Brood War
PianO 98
Sharp 87
Bale 12
Icarus 9
Terrorterran 5
Dota 2
monkeys_forever638
League of Legends
tarik_tv6429
JimRising 949
Super Smash Bros
Mew2King121
Heroes of the Storm
Khaldor151
Other Games
summit1g8364
FrodaN3299
shahzam1922
WinterStarcraft433
ViBE243
Models3
Organizations
Other Games
gamesdonequick669
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 17 non-featured ]
StarCraft 2
• Berry_CruncH293
• practicex 30
• IndyKCrew
• Migwel
• AfreecaTV YouTube
• sooper7s
• intothetv
• Kozan
• LaughNgamezSOOP
StarCraft: Brood War
• RayReign 8
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• Ler64
League of Legends
• Doublelift5787
• Shiphtur943
• Lourlo939
Upcoming Events
Wardi Open
7h 9m
Replay Cast
20h 9m
Replay Cast
1d 6h
WardiTV Invitational
1d 7h
WardiTV Invitational
1d 7h
GSL Code S
2 days
Rogue vs GuMiho
Maru vs Solar
Online Event
2 days
Replay Cast
2 days
GSL Code S
3 days
herO vs Zoun
Classic vs Bunny
The PondCast
3 days
[ Show More ]
Replay Cast
3 days
WardiTV Invitational
4 days
Korean StarCraft League
4 days
CranKy Ducklings
5 days
WardiTV Invitational
5 days
Cheesadelphia
5 days
GSL Code S
6 days
Sparkling Tuna Cup
6 days
Replay Cast
6 days
Liquipedia Results

Completed

CSL Season 17: Qualifier 2
BGE Stara Zagora 2025
Heroes 10 EU

Ongoing

JPL Season 2
BSL 2v2 Season 3
BSL Season 20
KCM Race Survival 2025 Season 2
NPSL S3
Rose Open S1
CSL 17: 2025 SUMMER
2025 GSL S2
BLAST.tv Austin Major 2025
ESL Impact League Season 7
IEM Dallas 2025
PGL Astana 2025
Asian Champions League '25
ECL Season 49: Europe
BLAST Rivals Spring 2025
MESA Nomadic Masters
CCT Season 2 Global Finals
IEM Melbourne 2025
YaLLa Compass Qatar 2025
PGL Bucharest 2025
BLAST Open Spring 2025

Upcoming

Copa Latinoamericana 4
CSLPRO Last Chance 2025
CSLPRO Chat StarLAN 3
K-Championship
SEL Season 2 Championship
Esports World Cup 2025
HSC XXVII
Championship of Russia 2025
Murky Cup #2
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025
FISSURE Playground #1
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.