archive by month
Skip to content

production goals (and addons)

A couple days ago I wrote about Steamhammer’s addon bug, and everyone who offered advice suggested more or less the same plan: Keep track of addon production yourself. Fix the bug by retrying if necessary.

That plan happens to fit with another plan I’ve been nurturing, the idea of abstract opening strategies that I wrote about in March. In an abstract opening strategy, you specify a goal like “get me 3 hatcheries and spire tech, go!” That’s a high-level production goal, while adding a control tower to a starport is a low-level production goal. But they are both production goals, and both can be implemented by the same software system. After all, to achieve a high-level goal, you have to achieve several low-level subgoals.

Today I drew up the first draft of a ProductionGoal class. So far it can only represent goals to build addons, to solve the immediate problem. That will be enough for the next version. As a next step in a later version, I might add goals to create morphed zerg buildings with dependencies. Then you can order a lair, and it will reason “you have the hatchery and stuff, here’s your lair.” Or order a sunken and it will build the creep colony first if necessary. Right now if you ask for a sunken at the natural and there is not enough creep there yet, Steamhammer will build it in the main instead as a fallback (and it’s usually a mistake). With a persistent goal data structure, it will be easy to duplicate Killerbot’s skill of waiting until there is enough creep at the natural to start the building. It will also be easy to add goals like “make 1 sunken at each base,” which you might want when vultures are roaming. Protoss might want the goal of putting 1 pylon at each base, in case cannons are needed later.

I’ll work in stages toward full-power production goals. One of the steps will be to add a production status data structure, after which I’ll be able to turn off latency compensation, another thing that’s needed sooner or later. The plan is growing more concrete.

Trackbacks

No Trackbacks

Comments

Anon on :

Hmmm... "make 1 sunken at each base" got me thinking of something you may consider: make it possible to specify priorities, or perhaps an explicit order. Otherwise, you may end up randomly building first at a far base (which may not be the most important one to defend) and you won't have the resources to start all buildings at the same time. Just my 2 cents. :)

Jay Scott on :

Yes, I think an industrial strength system needs some fancy features. It needs priorities. I think it also needs flexible unit mixes, where the production system (not the strategy boss) decides on details like how many vultures vs. how many tanks, to efficiently use both gas and mineral income. And other stuff.

Bruce on :

Sounds good! If you extend it with anboptional condition, the production goal system might also be able to simplify a lot of reactive logic, like building static detection when the opponent gets cloaked units, clearing up supply blocks, etc. You would just have a persistent production goal for each that only kick in when the condition is met.

Jay Scott on :

That’s one way. I was thinking of doing that analysis in separate strategy code, on the theory that it keeps related code together. We’ll see what I decide when I get that far.

Marian on :

I was thinking that it would be good to extend production items from UnitType => { UnitType, PurposeFlags }; where PurposeFlags would be something like building sunken in mineral like, in main on front.. Additionally you could say whether you want macro hatchery, expansion or offensive hatchery. Or hydralisk for defence say vs consair harass, idk, could have a lot of uses...
Just something to consider if you can affort to make a change like that for your bot.

Jay Scott on :

Oh yes, I’ve thought a lot about purposes. It’s complicated, though, and I haven’t decided on an implementation.

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.