We Put Fighting Game Netcode in Brood War

Lobsters Hottest Tools

Summary

Shield Battery now adds fighting game-style rollback netcode to StarCraft: Brood War, turning the latency and stutters of the lockstep network model into nearly imperceptible frame skips and giving online matches near-local responsiveness.

<p><a href="https://lobste.rs/s/gr0ptb/we_put_fighting_game_netcode_brood_war">Comments</a></p>
Original Article
View Cached Full Text

Cached at: 10/12/26, 09:45 AM

# We Put Fighting Game Netcode into Brood War Rollback netcode is now live on Shield Battery: your units respond on the very next frame, and the lag that used to freeze the game outright has been replaced by barely perceptible micro-skips. ## The Infuriating Experience of Brood War Online If you've ever played StarCraft online—even if it was a long time ago—you know exactly what this feels like: - Mid-game team fight, you're microing your units to dodge damage, and the game just freezes. - Units always feel a beat behind your commands. - That Supply Depot never gets built. Latency has always been the nemesis of Brood War online play. Until now. ## Lockstep: How Brood War Runs Over the Internet To understand why rollback works, you first need to understand how Brood War actually runs its game. In Brood War, every computer independently runs a full game simulation. Unit positions, resource counts, fog of war—none of that is sent over the network. Instead, each player only sends their own commands, such as "move here," "attack that," or "cast this spell." Everyone starts from the same state and executes the same commands on the same frames, so everyone sees an identical game. This method of synchronized execution is called **lockstep**: 1. On every frame, every player sends a turn packet containing the commands they just issued—even if they issued no commands, an empty packet must be sent. 2. Your computer will only execute a given frame after it has received that frame's turn data from every player. This mechanism works reasonably well, but it has one fatal flaw: I cannot execute your command before I know what it is. This means I have to wait for your command to reach me over the network. ## Latency: The Fundamental Tradeoff of Lockstep The time it takes for this data to travel over the network is called **latency**. It can be nearly instantaneous—such as on a local area network—or it can be a quarter of a second or more if you're physically far from your opponent. So to keep the game functional, the game adds a deliberate delay to every command: - To avoid freezes, this delay must be at least as long as the round-trip time between you and your opponent. - As a safety margin, modern Battle.net always adds at least two frames of delay—**84 milliseconds**, roughly the time it takes for data to travel between the US West Coast and Western Europe. - When necessary, the delay goes even higher. In the worst case, every command can be delayed by nearly **half a second**. That genuinely feels awful. So even on your own screen, your Marines wait a beat before they move. ### What Happens When a Turn Packet Is Late or Dropped? If a turn packet arrives late, or a packet is lost, no one can execute that frame. The game stalls until the data arrives: - For short delays, the game hitches—felt as a stutter that disrupts your rhythm. - For delays of several seconds, the game displays a disconnect screen for that player until the data comes through. Adding delay prevents freezes, but higher delay means slower unit response. That is the fundamental tradeoff of lockstep. ## Rollback Netcode: Act First, Apologize Later Can we avoid this tradeoff? Is there a way to keep the game moving forward even before receiving your opponent's commands? That's where rollback netcode comes in. Rollback has revolutionized online fighting games over the past few years, and its core idea can be summed up in a single phrase: **act first, apologize later.** The key insight is that most of the time, a player's input on this frame is identical to the previous frame. - In fighting games, this means holding the same buttons or directions. - In an RTS like Brood War, this means **no new commands**. If you watch real StarCraft matches, this holds true: even at APMs above **300**, top players only issue a new command roughly once every **10 frames**. For the other nine frames, their units simply continue executing prior orders. So "no new commands" is an excellent prediction. ### How Rollback Works With rollback, the game no longer waits: 1. The game executes every frame on schedule using whatever turn data it currently has. Your own commands take effect as soon as the next frame—just like playing single-player. 2. If your opponent's turn packet hasn't arrived yet, the game guesses they did nothing new and moves forward. Most of the time, this guess is correct and no correction is needed. 3. But sometimes they did issue a command. Say a command arrives three frames late, and those frames have already been shown. The game finds the last frame where it had all players' turn data, rolls back to that frame's snapshot, injects the late command, and then rapidly re-simulates all subsequent frames. At full speed, all of this completes within **one millisecond**—less than a single frame. The worst you'll actually see is a Zergling micro-"jump" to the position it was truly supposed to be in. For most corrections, you won't notice anything at all. ### Rollback and Latency Working Together When commands are only a few frames late, rollback hides the delay—the skips are tiny and virtually imperceptible. This allows many matches to perform even better than the best latency previously achievable, bringing single-player-level responsiveness to online play. If you experience a brief hiccup or packet loss, rollback can rewind further rather than freezing the game. But larger rollbacks are visually noticeable, so the rewind window doesn't extend too far. For sustained slow connections, latency is still added on top—but only the portion that rollback alone can't cover. ## Side-by-Side Comparison on the Same Connection The same few seconds of gameplay on the same network connection: - **Lockstep mode**: Every click waits out the full latency; when the connection stutters, the game freezes outright. - **Rollback mode**: Your Marines respond instantly; stutters manifest as just a few micro-skips, and the game continues normally. ## You Only Pay for Your Own Network Quality On Shield Battery, there's another major benefit: you only bear the cost of your own network quality. If your opponent is on laggy Wi-Fi on the other side of the world, that's their latency, not yours. Shield Battery adjusts connection parameters for each player individually. Players with better network connections get a better experience. No more having five players in a 3v3 dragged down by one player with a bad connection. ## Summary: What Rollback Brings You - Your commands take effect on the **very next frame**. - Late commands become micro-skips instead of game freezes. - Latency is only added when your own connection requires it—and it only affects you. Rollback netcode for Brood War is available exclusively on Shield Battery. Source: We Put Fighting Game Netcode in Brood War (https://www.youtube.com/watch?v=vIt9xua9bLc)

Similar Articles

Battle Drones - a vibe coded RTS with audio-based multiplayer

Simon Willison's Blog

Simon Willison 分享了他用 Claude Code 等编码代理「vibe coding」开发的命令与征服风格 RTS 游戏 Battle Drones,历经 12 次大迭代、321 次提交,支持音频同步的本地多人及在线多人对战。

Starcraft: Ashfall

Hacker News Top

《星际争霸:灰烬长桥》是一款基于网页的竖屏粉丝自制射击/塔防小游戏,玩家指挥人族陆战队员对抗虫群。

@mattshumer_: Fucking incredible

X AI KOLs Timeline

Rishi introduces Super Smash Royale, a browser-based battle royale game with 45 characters from Super Smash Bros. Melee and Brawl, built using AI tools like GPT-6 Astra, ElevenLabs, MeshyAI, Blender, and threejs, supporting solo, multiplayer, and controller play.

Total Annihilation, rebuilt for modern computers

Hacker News Top

Nanolathe 是一个 MIT 许可的开源 2.5D RTS 引擎,通过干净室研究重新实现经典游戏《横扫千军》(Total Annihilation),支持现代 GPU 渲染、浏览器演示以及 Windows/Mac/Linux 原生运行。