Game AI Wish-list

Game AI Wish-list

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

Moderators: hoijui, Moderators

Post Reply
User avatar
munch
Posts: 311
Joined: 26 May 2005, 20:00

Game AI Wish-list

Post by munch »

Hi Guys,

Thought I'd start a wish-list for things we want for the game AI (I think you've called it "Group AI", let's just say GAI), as opposed to the AI Player(s). These are things I always wanted in OTA, which we have a chance of fixing at last!

1. When there is an energy crisis ONE Con unit builds an energy making structure before beginning its next build queue item.

2. When patrolling, Con-units automatically build mexes on empty metal spots (provided there isn't an energy crisis).

3. Energy usage gets prioritised so that if energy using weapons are under attack, they get the energy they need to fire, along with any energy making structures which are being built.

4. Units don't fire mindlessly if they're going to damage freindlies! (Somebody else posted this, I agree, I see it happening all the time in OTA)

5. GAI manages construction resource for you - i.e. you can say "I want a DT'd HLT here", and the GAI finds the Con-unit that is close by or under utilised. Similarly, you might say "I want to build an force of flash and mavericks at this point" (user interface issues here), and the GAI works out what production facilities to use to achieve your objective. This is about moving the UI away from you commanding individual constrtucion units/facilities and instead saying what it is you want to happen.

It would be cool to keep this as an idea generating thread and keep the discussion of whether an idea is good or bad in other threads, or this could get very messy!

Do chip in!

Cheers

Munch
renrutal
Posts: 84
Joined: 28 Apr 2005, 16:45

Re: Game AI Wish-list

Post by renrutal »

munch wrote:Hi Guys,

Thought I'd start a wish-list for things we want for the game AI (I think you've called it "Group AI", let's just say GAI), as opposed to the AI Player(s). These are things I always wanted in OTA, which we have a chance of fixing at last!
I'll also use this thread to do some really abstract coding based on your requests. This way I can also ask the developers what I'd need in the interface.
PS: I'm really not telling you what is a function or procedure, this should be pretty language-independent even if it looks like a OOP language.

Let's get started:
1. When there is an energy crisis ONE Con unit builds an energy making structure before beginning its next build queue item.

Code: Select all

if (game.energy <= player.minenergy) {
  units.con.all.holdqueue; // Meaning no unit should start a new project
  unit = units.con.select.idlelist
  // The game should keep an organized list with con units
  // the list is ordered by: least building priorities, highest build speed, highest speed.
  unit.stop(MAINTAIN_QUEUE);
  unit.build.energy(NOW); // It will help to build or build a new one.
  units.con.all.continue;
}
2. When patrolling, Con-units automatically build mexes on empty metal spots (provided there isn't an energy crisis).

Code: Select all

for every (feature = map.metalpatch) { // this command runs in parallel
  if (feature.threat == 0) { // Area threat evaluator
    if (game.energy > player.minenergy) {
      unit = feature.closest.unit.con.select.patrollist;
      unit.stop(MAINTAIN_QUEUE); //stops patrolling, removes itself from the list
      unit.build.metal(feature);
      unit.continue; // continues patrolling, goes back to the list.
    }
  }
}
3. Energy usage gets prioritised so that if energy using weapons are under attack, they get the energy they need to fire, along with any energy making structures which are being built.

Code: Select all

catch (event.unit.underattack) {
  while (unit.underattack) {
    player.energy.reserve(unit.weapons.all.energyusage);
  }
  // The amount of energy used in all the weapons of the unit will be reserved
  // This means the amount will be subtracted from the player's total available energy
}
Dunno what you meant with energy making structures.
4. Units don't fire mindlessly if they're going to damage freindlies! (Somebody else posted this, I agree, I see it happening all the time in OTA)
Wow, this one is quite different.

Code: Select all

while (!unit.weapons.clear) {
  if (unit.problem.friendfire) {
    ffunit = unit.problem.friendfire.unit;
    if (ffunit.priority < unit.priority) { // based on veteranship, health, etc.
      ffunit.move(GROUPAI_PRIO_POS); // Go to the position it should be, told by its groupai
    }
  }
}
5. GAI manages construction resource for you - i.e. you can say "I want a DT'd HLT here", and the GAI finds the Con-unit that is close by or under utilised. Similarly, you might say "I want to build an force of flash and mavericks at this point" (user interface issues here), and the GAI works out what production facilities to use to achieve your objective. This is about moving the UI away from you commanding individual constrtucion units/facilities and instead saying what it is you want to happen.
Now this is just mean.

Code: Select all

catch (event.player.build) {
  build = event.player.build; // Should find pre-defined and user defined instructions
  while (build.priority != fullfilled) { // select as many cons as possible up to a limit
    unit = build.pos.closest.unit.con.select.availablelist; //idle+patrol
    unit.build(build.pos, build.instructions);
  }
}
It would be cool to keep this as an idea generating thread and keep the discussion of whether an idea is good or bad in other threads, or this could get very messy!

Do chip in!

Cheers

Munch
Sorry for hijacking your ideas. ;)
--ren
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Ah, interesting.

The GAI is another description of TAI::Construction Agent, the same agent which in the current AI Version maintains a global build queue, (later to be joined by local build queues in Factory GroupAI). Selective Weapon energy use would be a matter of Tactical Agents and the GroupAI that cotnrols the attacking unit (give GroupAI attack command, groupAI finds the best way of doing it and if it can do ti rather than simply blindly following orders.)
Organising thigns so that they arent built before the resource fcilities to support them are built would be a matter of making the construction agent stick in the required resource facilities to support it at a higher priority.
2. When patrolling, Con-units automatically build mexes on empty metal spots (provided there isn't an energy crisis).
That sounds very easy, *points to spring source* I see not why a groupAI could not eb written to do this already, though you may need a little help when ti comes to building the metal extractor and choosing the building without hardcoding metal extractor.
User avatar
Veylon
AI Developer
Posts: 174
Joined: 21 Sep 2005, 19:45

Post by Veylon »

Just have it flip through it's build list and check the UnitDef's until it comes to a metal extractor. Then build it.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

If you get the possible commands of a unit and look at all those less than zero, you can get the build orders name by looking at the commands description or name, which can then be used to get a unitdefinition to tell if its a mex. Much easier when your performing this on possible groupAI commands where the groupAI is SJ's central build AI.
User avatar
Guessmyname
Posts: 3301
Joined: 28 Apr 2005, 21:07

Post by Guessmyname »

Let the AI use transports effectively, and build defenses at logical points. (Ie high ground with good lines of fire. I'm sure someone made that thing that lets you see what a unit can shoot at. Maybe that could be used to help find good defensive spots?)

Make it so that the metal makers only make metal if they are supported, and metal gathering is proving difficult.

Make it so that if a unit needs something to fire (ie, needs to have a unit loaded in it, or needs to be loaded in a unit) then the AI will fill said presquites (I cont speel wery bell) so that the unit will fire.

Make it so that the AI uses jammers and radar and that effectively - ie, they send a peeper over your base, check out your defenses and start building units best suited to destroying them - maybe an fbi tag that lists good counters for the unit? ie counter=ARM_FAV, ARM_COM; )

and so forth and so forth

(If all that gets properly implemented they you lot are truely coding gods)
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

Not so much a coding god challenge, see the threat matrix documents at darkstars or ask/look at how zaphods doing it.
Post Reply

Return to “AI”