Build Flags research

Started by MTops, August 20, 2010, 09:19:30 AM

Previous topic - Next topic


We all know the SetStockEx function has a buildFlags argument that gives the scripter a bit of control over the building placement of the AI.

There is a list of different options in the BuildAI.galaxy file which can be combined to produce specific results.

I would like to combine all our knowledge about these options so we can get a better understanding of what our technical possibilities and limitations are.

First of all most of the options can be split into three categories:

The avoid/near part is obvious, do you want the building placement to be NEAR the spot you specify or AVOID that spot.

The close/far part is not obvious. At least not to me. Close and far usually mean a relative distance. Relative to what is unclear...

As for the location options, let's take a look at them individually:
- PowerOrCreep: the meaning seems obvious, but how does it work exactly in relation with the close/far options. This option is helpful for new pylons to avoid Close- and FarPowerOrCreep to have them build outside of an existing power field, for more coverage.

- Factory: I assume this means any building capable of producing units. So you can either build more factories right next to them, or have your tech buildings avoid them, I guess. No idea about the close/far thing.

- Defense: I'm thinking defensive buildings, but not 100% sure.

- Dropoff: not a clue.

Now let's move on to the other options.

- Resource: available in the near/avoid variety. Used for building themain building near the resources, or building defensive structures near the workers to give some harassment protection.

- ChokePoint: also available in the near/avoid variety. This is a popular one. You can have the AI build buildings near the choke point/ramp with this one. However, since it's NEAR and not AT, you will never be able to get the AI to wall off his ramp with only this.

- ValueSpace: comes with the minor and major options. Not sure what it does, but I'm guessing it takes into account to amount of free space around the spot.

- CanLower: this is usually given to supply depots, to let the AI know this building won't block unit movement after being build.

- OnVespeneGas: obvious on. Only works on geyser buildings.

- OnlyHere: no idea, the AI doesn't seem to build the building at all if this flag is set.

- IgnoreDanger: no idea either. Does it normally take danger into account? How? What is the result? What is danger exactly?

If there is any information you have that could make this post more complete, please post it so we can have a reference for all AI developers out there.

PS Some months ago, I saw a YouTube video of an AI developer who managed to get his AI to build Pylons all around the edge of his base. Anyone know who that was, or how he did it? Was it just with the build flags or is there another way to control building placement?


You could create AI Build function that let the AI build at certain point with coordinate.

It help me out to create some proxy building. The problem is how to determine coordinate to build.

Also the AIBuild or AITrain function is more useful than the AISetStock because it has priority variable.

For example with resources of 300 and 200, with a priority 10, it can make the AI build Thor rather than the lower cost units.

This can also apply for units, in case of Protoss, a Warpgate can warp in units, we can warp to near one pylon or Warprism when attackings.

You can look at the video below of my GT AI
GT AI 0.56 Zerg Power - part 1.avi


Thanks for your reply. It made me dig through the GT AI files to see how you had the AI build at specified coordinates. It never occurred to me that you can create a build command with AICreateOrder.

This is actually huge. This amount of control can really make a difference. Big hug! :jig:


You're welcome ^^. Hope to see your AI soon