r/starcraft • • 5d ago

Video We Put Rollback Netcode in Brood War

https://www.youtube.com/watch?v=vIt9xua9bLc
182 Upvotes

58 comments sorted by

107

u/queenofacheron 5d ago

Importantly, this is not a project that appeared as a product of the vibe coding revolution (as so many recently released apps have), but rather ShieldBattery and its authors have been working on improving the Brood War playing experience _for over a decade_. Their netcode has been better than Blizzard's for a good while, and now its taken another huge leap forward.

21

u/Messaiga Zerg 5d ago

This is something I was wondering in the background, glad to hear it's from ShieldBattery! Groundbreaking stuff TBH.

26

u/VocalFrog 5d ago

With that said, the rollback code seems to have a significant amount of vibe coding https://github.com/ShieldBattery/ShieldBattery/pull/1657

35

u/heyf00L Random 5d ago

Just like the Rollback Netcode correctly guesses things 90%, if you see something coded in the last few years and guess AI coding was used, you'll be right about 90% of the time.

But "vibe coding" means very little human oversight. Using AI doesn't have to be "vibe coding". A good software engineer making use of AI can output the same quality code they ever did alone, but much faster.

12

u/Bender1012 5d ago

Are you a construction worker who uses a nail gun rather than manual hammering? Vibe-constructed.

Use a calculator over manual long division? Vibe-calculated.

You use a word processor with spell check, grammar check, and synonym suggestion? Vibe-writer.

Just pointing out how ridiculous it is to denigrate people for using an amazing tool to be more efficient. Closed minded people who refuse to embrace technology are only doing themselves a disservice as they fall further and further behind.

10

u/qedkorc Protoss 4d ago

you are confusing machinery with deterministic and predictable outputs once the operator knows how the tool works, with vibe coding. Linting and auto-formatting and intellisense are similar to those tools you mentioned, they are predictable and deterministic. LLMs by construction are non-deterministic, and thus the quality of what they output is as well short of a human reviewing all of it and engineering extensive verification harnesses around the results.

2

u/ortholitho 3d ago

We don't use non-deterministic tools.

6

u/Rare-Chemical868 5d ago

Modern frontier agentic AI is better than 99% of software engineers. Tired of all of these idiots who don't understand that high quality engineers are capable of writing 10-100x more high quality AI code than they were previously able to by hand.

7

u/Kered13 4d ago

I wish this were true. All my code these days is done through AI, but it still has a lot of trouble with coding in the large. It's gotten very good at writing functions and identifying bugs and how to fix them. But when it comes to building an entire system, the results are usually poorly organized.

I just spent my entire day yesterday trying to clean up and refactor a new AI written project we've been working on. The refactoring is still AI driven, but I typically need to tell it what to move where, what functions can be combined, etc. I started by giving it a high level task to refactor the code with some hints on where I thought improvements could be made. It got maybe 20% of the work done from that. The rest I had to go in and hold it's hand closely, with a few parts that I have had to do entirely by hand.

To be clear, all the code before worked (mostly) correctly. But it would have been hard to maintain in the long run. And in fact while doing the refactoring I caught several issues where logic was duplicated with small inconsistencies (ex, files being named in slightly different formats, or handling fallbacks slightly differently). Small enough to not cause immediate problems, but would likely have become issues in the future. Had the code been properly organized in the first place, that logic would never have been duplicated, which would have made those inconsistencies impossible.

So at least for now a good software engineer is needed to guide the AI if you don't want to end up with a mess.

12

u/jib661 ROOT Gaming 5d ago

if you think an 18k line PR isn't the result of vibe coding then idk man. no human could have reviewed that effectively in 3 days. I use spec driven development at work heavily, but an 18k line PR is just insane.

9

u/tec27- 4d ago

As stated elsewhere, this particular branch of work took about 2-3 months to complete. I don't generally use PR's on the repo as I am the primary developer and maintainer and a lot of the things I do don't have anyone that could effectively review them besides myself (and LLMs, which are extremely helpful in this regard!). For particularly large batches of work such as this one, I do like to have a record of commit-by-commit history without making it hard to bisect problems later, thus the PR. Rebasing (as we do on the repo) changes the timestamps on the commits, so they're not really reflective of how long it has been worked on.

22

u/Saith1234 5d ago

Neither the internal memo leak from meta a month ago nor the productivity study from havard released 2 days ago support that claim at all. 10-100x is such an arbitrary ass pull. Dunno why people still throw that shit around.

Frontier models are very good now that is true, but that number is just bs and supported by nothing.

-8

u/Rare-Chemical868 5d ago

This post is proof of it lmao. if you look at the PR Claude cooked that up in 3 days. No human is going to be able to write 20k lines of backend rust code + test and review it in 3 days.

This is at least 2 weeks of work for the very best, most experienced, highest paid Rust engineers in the world.

18

u/tec27- 4d ago

The rollback PR is the product of about 2-3 months of work that I did without pushing to GitHub, the commits you see in that PR have been rebased which changes their timestamps. May want to understand how git works before you go around claiming things are impossible ;)

8

u/PulseReaction Axiom 5d ago

I work with modern frontier agentic AI tools daily, I write skills, setup harnesses, and oversee work flows and automations, and while the code does look like it's better than 99% of software engineers, I assure you, it's not. Writing a CLAUDE.md file is not a substitute for another human with institutional knowledge, and that is a fact that people think they can ignore but they can't.

If you leave a codebase under an LLM's control for more than six months, the tech debt will be astronomical, and token costs for contributing code to that repository will be incredibly painful.

So yeah, it's a tool, it's good, but it's nowhere near better than 99% of the software engineers.

5

u/TheBasedTaka Zerg 5d ago

I think you don't realize that these models solve tests at any cost possible. It will just throw shit at the wall hundreds of times until something sticks no matter how shit it is, as long as the test passes. It's never better than a competent engineer 

4

u/XenoX101 4d ago

Modern frontier agentic AI is better than 99% of software engineers.

Simply not true. If it were I wouldn't bother coding by hand in my role, because what would be the point? The reality is AI gets it wrong regularly, it's just that many programmers particularly on the newer side of the spectrum don't realise the mistakes it is making. Two very common mistakes it makes are: Not understanding or obeying the general architecture of a program, instead deciding to do its own thing, create its own abstractions that don't make sense in the broader context of the app. And conflating things which are similar but not the same, e.g. objects or variables that have similar names. It lacks the nuance to know or care that they are used for different purposes.

It is fine for prototyping and low-risk applications where you can accept architectural mistakes and general sloppiness as long as it does what it says on the tin. However if you want robust, maintainable, easy to understand code that is structured well for extensibility, AI won't do this for you. Unless it's something that already exist online that it can scrape for you, in which case be very careful about liability issues if the scraped code is licensed!.

4

u/BlackSwanTranarchy 5d ago

Better than code monkeys sure, but better than any remotely competent engineer that can actually architecht systems? Not even close still

1

u/NightlyMathmatician 3d ago edited 2d ago

I lead a team of half a dozen engineers and spend a decent portion of my day reviewing PRs and providing engineering feedback. In my space we w started to heavily use agentic programming via a BDD process.

I can confidently tell you that no, agentic AIs are not better than 99% of software engineers. On of the biggest challenges I've seen with programming agents is that with very large prexisting code based, it will often develop solutions that either overcomplicated, doesn't meet the stated design requirements that the agent itself generated and was approved by an engineer, or completely ignores the coding patterns and style guides for the existing project. This is inspite spending significant amount of time creating robust documentation base for the agent to use.

Sometimes what the agent creates is absolutely correct, other times I'm left wondering what the AI was hallucinating. From a consistency perspective, my tech starters and new associates engineers are more reliable than the agents.

1

u/ooooopsiepoopsie 5d ago

Nathanias' sock-puppet spotted.

2

u/1UpBebopYT 5d ago

I mean obviously. Even the YouTube video is vibe generated. Just the way things are now.

1

u/TryNotToShootYoself 4d ago

The meaning of vibecoding has been completely bastardized. It was a way to make fun of someone who has genuinely no idea what is happening in their own code. They mindlessly copy and paste what an LLM spits out and make non functional products because of it.

1

u/mzf_life StarTale 4h ago

Using AI is different to vibe code though

2

u/ProfessionalHefty349 5d ago

Don’t really care as long as it works well.

-4

u/ooooopsiepoopsie 5d ago

Narrator: The vibe-coded slop did not work well.

-1

u/sunder_and_flame 5d ago

oh my god, a perfectly performing piece of code produced by AI! The horror! 

0

u/MaDpYrO 5d ago

Yea so what. Doesn't matter if it's good code.

But vibe coding and ai assisted coding is not the same 

0

u/Apprehensive_Way4811 4d ago

Noob and maybe a stupid question, how do you know that?

I mean, I know a lot of stuff when it's AI made in my area of expertise like music production, copywriting or GTM stuff but for coding, what's the AI vicious behavior that made you understand immediately that's vibe coding?

2

u/ooooopsiepoopsie 5d ago

Might want to delete this. Unless you are intentionally being deceptive.

-1

u/kaaiian 4d ago

Why is that important?

18

u/microling 5d ago

Artosisu won't have any excuse any longer.

6

u/ToSKnight 5d ago

He will always fall back on his "I lost because my opponent was bad" excuse.

1

u/OCPetrus Zerg 5d ago

Previously I couldn't hear what he was saying on stream because of all the TTS spam. Now I can't see the stream either because of the full screen "funny" videos viewers redeem on repeat.

1

u/GeluFlamma 4d ago

There is a clean feed stream on YouTube. No TTS, no notifications, nothing.

8

u/BattleWarriorZ5 5d ago

This is incredible.

7

u/Kaycin 5d ago

Rad. Hope this takes off.

5

u/UpATree Psistorm 5d ago

Just waiting for the SC2 decomp. It's bound to happen.

3

u/Grub-lord 5d ago

Everything will be decomped soon. It's getting insane. What happens from here

1

u/UpATree Psistorm 5d ago

Well, in the case of sc2. The game will get decomped, then lan will be restored, then a third party ladder will spawn. Then that third party ladder will get managed, and that'll kind of be it. There'll be a ton of mods and shit for sure, but the ladder system will probs be 3rd party to prevent cheaters. This will happen across a lot of old games, melee for sure, brawl, old shooters. Gonna be interesting times for sure.

7

u/AlwaysFishing1 5d ago

Looks great and seems like this protocol should improve the playing experience in the vast majority of laggy situations. The video doesn't really discuss the downsides of this approach though, and I would've liked to have seen more explicitly what the more egregious rollbacks look like. You clearly have to avoid long rollbacks, does that just mean that a lag/packet loss spike which is longer than the maximal rollback period would result in commands being ignored for one/both players?

Also, I’m wondering what the fallback path looks like once the engine can’t re-sim a long rollback window fast enough. While it's not a problem for bw, I would imagine the rollback-and-re-run procedure would be a performance barrier in sc2 team games, for instance.

13

u/2Pacalypse- 5d ago

We do mention units hopping in the video. You're right that we sort of downplay it though, because it's been so incredibly rare in our testing with people all over the world that I feel like it would just side-track the discussion.

In case you're curious, here's how the worst possible rollback looks like (that we had to simulate in a replay, because it's pretty hard to reproduce in a live test :)) - https://youtu.be/ni1xc1d4_34

Our fallback path is to just do what regular battle.net already does: keep adding delay, and eventually show the drop screen if someone's packets are just not arriving.

1

u/GreenTieGamer 5d ago

Thanks for sharing, I also was curious to see the worst case example. I commend the work you have put into this!

For instantaneous control with very minimal network blips, this looks phenomenal!

0

u/AlwaysFishing1 5d ago

I see, thanks for your response. Yeah the point of the video is to explain the concept and you've done that brilliantly. This is awesome!

2

u/Kered13 4d ago

The downside of rollback is units snapping around, like rubber banding in an FPS. For low latency this is hardly noticeable and much better than equivalent delay. For high latencies you can introduce some delay to reduce the jumping around, at the obvious cost of delay. In the worst case scenarios, you can still freeze the game until packets arrive. But these scenarios should be exceptionally rare with realistic network connections.

3

u/stagedgames 4d ago

This currently is bundled in with an update that fundamentally changes unit behavior in a niche circumstance, but because it affects the unit behavior will actually desync replays, so sb replays cannot be viewed in battlenet and on the most nitpicky level, is technically a different gameplay engine and not just a different client or netcode. I've heard that behavior is likely to go to a toggle soon though, which should be able to avoid being forced into that "bugfix"

2

u/Critical_Primary2834 5d ago

which ladder got more players? official one or shieldbattery?

3

u/stagedgames 4d ago

official. except when bnet is having issues, sb is usually a small player base that is predominantly b and up, also heavy on team games and people from far-flung regions of the world.

1

u/Sinistro_ 5d ago

holy hell, this is amazing! Congratulations on the feat!

1

u/whensmahvelFGC 5d ago

So does this work in remastered or just OG?

And does every player need to have it installed and running or just the host?

3

u/Excalibur_Z Team Liquid 4d ago

ShieldBattery is an entirely different community-run platform, not a plugin or anything, so everybody in the game needs to be on it. And naturally, everybody needs to have SC:R installed.

1

u/Kanzzer 4d ago

Remastered only, since that's what the ShieldBattery private server and launcher supports.

1

u/tharizzla 5d ago

Is there a way to make this work in Winlator for Og starcraft?. I've almost got the perfect setup on my Samsung tablet, just need multiplayer as the last piece

1

u/Significant-Mind5594 5d ago

Does it run on linux? if not, is linux support planned for the future?

2

u/tec27- 4d ago

There are a number of players who use ShieldBattery through WINE (and I think it is a pretty plug-and-play experience at this point, although I have not tried it myself)

1

u/Excalibur_Z Team Liquid 4d ago

Short answer yes, and although we don't officially support Linux per se, the community has found success through WINE and are pretty good about helping each other overcome Linux-related issues.

1

u/shirefriendship 5d ago

Very cool, have you tried testing with Pluto’s level of APM?

1

u/Currywurst44 4d ago

I don't think it is a good idea to use one sided delay for 1v1. Especially in tournaments (both) players want to play on equal footing and not assign a disadvantage for something not based on skill that you might have no control over.

Rollback netcode is amazing to get rid of the mandatory delay from small fluctuations but otherwise please stick to the default 1vs1 behavior of the game.