Skip to content

words beta ​

Function of @v12-engine/engine/ai

ts
words: () => AiModuleDef

The words module: answers the words any brain may be told (world.computers.tell(player, word, data)), taking them:

  • attack { at?, seconds? }: the army (its fighters) attacks there, fighting what it meets on the way; where no place is given, at the nearest building of a rival's it knows of, else at the first rival's base the seat was told (AiOptions.enemyBases). - defend { at?, seconds? }: the army goes to fight there, home when left out. - retreat { seconds? }: the army comes home, fighting nothing on the way. - hold { seconds? }: the army stands where it is, fighting what comes in reach. - pause: the brain sits still until told resume (or world.computers.resume); resume the brain answers itself.

The army goes as one squad on the kit's task of the word (attack, defend, retreat, hold, in the squad word), so that where the brain has the squads() module it regroups, focuses, kites and falls back on the odds as any squad does. The army is the word's for seconds (attack 60, defend 30, retreat 15, hold 30): no goal claims it meanwhile, then the squad goes and the goals have it again. Its id is words; put it after rules, so that a rule's { say } is answered that think