Build groups & Central build AI

Build groups & Central build AI

Here is where ideas can be collected for the skirmish AI in development

Moderators: hoijui, Moderators

Post Reply
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Build groups & Central build AI

Post by AF »

troycheek wrote:Central Build AI works like a "Common non-hierarchical permanent queue" for all the units in that CBAI. That is, unlike the "normal" queue you are used to in the default system, it does NOT have a queue "order", there is no 1st 2nd 3rd, just... orders... and any unit able to perform that build order will start to serve the request nearest to it. When, in a group of units, only one is capable of performing a build order, all the others will auto-guard that unit, until it finishes building. Adding things to the queue doesn't mean it will be performed after or before any other order. Several CBAI groups can be created to satisfy different build priorities. Cobbled from http://springrts.com/wiki/Central_Build_AI

In other words, I could define a group of three T1 builders at the start of a XTA game, assign them to the CBAI, and tell them to build 5 metal extractors, 2 metal makers, 10 solar collectors, and half a dozen missile towers at various locations around my base. I could then go back to micromanaging my flash rush while CBAI constructed those items, each builder starting its own construction, then moving on to another item in the list or assisting another nearby builder when finished, in no particular order but generally building from their current locations outward.

Later in the game, I could add some T2 builders to that CBAI group. If building something outside the capabilities of the T1 builders, those builders would just assist the T2 builders. That way, I wouldn't have to keep track of what builder could build what items or worry about idle builders getting lost and unused somewhere.

You could also give orders to individual members of the group. For example, build this solar immediately or move to this location. The individual would perform that action then rejoin the group. This was useful for a quick build or to move the builder out of harm's way. Sometimes the builder would barely start the action then rejoin the group before finishing, but I think that was a bug.

The CBAI appeared to start by simply cycling through the list of builders and assigning each one singly to the nearest new construction project within its capabilities. As builders became idle again, it would then assign them to new construction or to assist another builder in the CBAI, depending on which was nearer. Builders which couldn't build anything on the list would get assigned to assist other builders. All builders were doing something pretty much all the time, as long as there were any build items left.

I hope that explains it.

Considering the advantages of this mechanism, what would be the optimum number of 'groups' to maintain in an AI based implementation?
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Build groups & Central build AI

Post by hoijui »

that depends mainly on the mod, a bit on the size of the current economy of the team, the map size (and some things i forgot).
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Re: Build groups & Central build AI

Post by AF »

Is there any way other than brute force that would be most appropriate to figure out optimal group size? This applies to hwo many builders should assist a buildign and how many construction projects should be ongoing at any one time too
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: Build groups & Central build AI

Post by Tobi »

You could run a high level planning algorithm to figure out stuff like "total produced resources 2 minutes in game will be highest when 3 groups start in parallel on 3 mexes and then work as 1 group on a strip of solars".
imbaczek
Posts: 3629
Joined: 22 Aug 2006, 16:19

Re: Build groups & Central build AI

Post by imbaczek »

but what if total resources is not what the user wants? this problem cannot be solved in general, because the player may have a scoring function which may change in time in unpredictable ways, and cannot be expressed by a formula anyway.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Re: Build groups & Central build AI

Post by Tobi »

Yeah it will always be an approximation, but you can definitely do high level planning and set short term goals, and optimize builder allocation based on that. (like in the example above maximize resource output at 2 min in game)

Of course if things happen which the planner can not account for (e.g. enemy attacking), it will have to re-plan, possibly after adjusting the short term goals.

EDIT: Oh and I actually assumed AF meant with "AI-based", a central build AI integrated into an AI. (in which case you can, as AI developer, always decide to make cost expressable in a formula, not dependent on time, or continuous, etc.)
Post Reply

Return to “AI”