archive by month
Skip to content

recognizing the enemy’s opening plan

I’ve been adding recognition of the enemy’s opening plan to Steamhammer, as part of the opponent model. Besides making the opponent model smarter, the OpponentPlan is directly valuable to the strategy boss. I’ve been concentrating on enemy plans that the strategy boss is clumsy in reacting to.

After writing recognition code for several plans, I already felt dissatisfied with how it works. It looks at buildings and timings, it counts bases, it notices if zerglings are out suspiciously early, all extremely basic stuff. “2 barracks and no gas, I know what’s coming next.” There is no “You should have a second pylon by now, where is it hiding?” and no “I see more zerglings than you can get from 1 hatchery, you must have 2.” Rich and complex inferences can be drawn from the game information, and the primitive code I wrote draws only simple ones.

So I looked at PurpleWave, which does opening recognition under the name of “fingerprinting”. PurpleWave tries to recognize specific openings for zerg and protoss: This is 4 pool, this is 12 pool, this is 10 hatch, etc. And the way it works is, at heart, the same as what I wrote in Steamhammer. It is written in a different style, but it checks almost exactly the same information.

The biggest difference is that Steamhammer does not try to recognize specific opening builds. I think there are too many, and some of the differences don’t matter. The OpponentPlan groups enemy openings into categories, like “this is a fast rush,” without distinguishing between 5 pool and other early pools, or even between 5 pool and 5 barracks and 5 gateway. 2 barracks no gas gets the same plan label as 2 gateways no gas. If you want to react differently to 2 barracks than to 2 gateways, that is for the strategy boss to figure out. I think the plan categories extract more information from the game and compress it into fewer labels for the rest of the code to handle.

Well, if PurpleWave gets away with it then I guess the primitive recognizers are good enough for now. Someday I hope to write a cleverer plan recognizer that draws the deep inferences, that (like a pro) knows when you’re trying to hide a base and triggers a goal to go look for it. Or that says “You’re proxying something and I don’t know what, but I don’t need to see it because the answer is to build turrets.”

Trackbacks

No Trackbacks

Comments

Dang on :

Thanks for the shout-out (and glad it made for an interesting read). Pros of fingerprints: It's very actionable information. My FFE build uses the fingerprints heavily -- I can do anything from Nexus first versus a 12 hatch to quick cannons and pulling probes vs a 5-pool. The subtle distinctions between builds make a big difference -- it's not safe to go Nexus first versus a 9 hatch because the Zergling flood arrives too soon. Most bots have to choose economically poor builds to survive aggression because they can't be greedy with sufficient precision -- PurpleWave can be almost maximally greedy (limited mostly by building placement now and needing more cannons than a pro would). But there sure are a lot of cons. Fingerprints are hard to implement accurately (mine still have flaws), and relying on bad information is suicidal. And as you point out, it's a very limited approach -- you go blind pretty early in the game and at that point it's very hard to pin down your opponent's capabilities with rules. One such notable problem that bots struggle with: Anticipating Dark Templar without actually seeing the tech.

Jay Scott on :

Ah, it’s true. The forge fast expand is a sophisticated opening and you need fine-grained information to play it safely and efficiently. Ideally, of course, a bot should understand its opponent’s play at all levels of abstraction, but we have to start at one level....

Add Comment

E-Mail addresses will not be displayed and will only be used for E-Mail notifications.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA

Form options

Submitted comments will be subject to moderation before being displayed.