Skip to content

@v12-engine/engine/ai ​

Core ​

What a game meets first.

NameKindWhat
defineBrainfunctionDefines a brain: what a computer player is made of, to seat at a world (world.computers.seat(player, { ...options, brain }), world.computers.seat) and to list in Rules.brains, for a save to find it by its id. Modules that keep state are given as functions of the brain, as systems are of the world
defineModulefunctionA module made for each brain by a function of it, with its id known before it is made: what a brain's without leaves out by name (meleeBrain.with({ without: ['scouting'] })). The kit's modules are all defined so
meleeBrainvalueThe engine's melee computer player as a brain: what world.computers.seat seats where no brain is named and the game lists it first. It thinks as its profile says (the difficulty's every), unless the seat's options say how often. The file's comment lists its modules
missionBrainfunctionA computer player for a mission: a brain (defineBrain) of what every mission's computer has (its rules, the words every brain may be told, the goals' picker, squads, micro) and the parts it is given (modules: holdPosition, patrol, guard, ambush, waveFrom, fleeWhen, surrenderWhen, any module of the kit's or of its own). Nothing builds, trains, gathers, scouts or answers raids on its bases unless a module for it is given (economy(), scouting(), defence()). Everything else of BrainDef as for any brain (goals, micro, without, knowledge)

Advanced ​

Classes ​

NameWhat
AiView betaA computer player's reading of its picture of the game (Brain.view): the snapshot of its seat, indexed once a think and queried as sets (UnitSet): mine, allies, enemies (what is in sight now; enemies.known() adds the structures remembered), hostile (enemies and creeps), creeps, neutral, resources, all; the player's own state (me); what unit types are for (roles, typesOf); where things are (near, home, bases, mines, camps, regions); how strong things are (strength: odds, matchup, counterFor) and where the strength is (threat, the map made when first asked); what the game tells this player (report, component, events.game); and the map's facts (canPlace, findPath, cellAt). Made from the snapshot as the think begins; a set of it is good for the think
Brain betaA computer player made of modules (defineBrain), seated at a world (world.computers.seat). What a module is handed as it thinks (ai): the picture of the game (snapshot), the seat it plays through (session), its options, its numbers (rng), its log, and send for its commands. A brain is a ComputerPlayer: think, and save and restore for what it remembers
BrainChecks betaChecks a brain against the invariants after each of its thinks, through what it is watched by (Brain.watch): what checkBrain makes, and keeps the broken rules in violations
BuildPlan betaThe brain's build plan (ai.plans.build): its wants, the steps to each, the spots, the builders, the purse. Add a want with want, read where each stands with report, and let think act on them once a think
Decisions betaThe last fifty things a computer player decided (Brain.decisions, written by ai.decide), oldest first: kept in a save, plain data
EnemyKnowledge betaWhat a computer player remembers of its enemies (knowledge.enemy): their structures and bases, their army as last seen, their workers and heroes, the types and tech seen. Creeps are no one's enemy here
Goals betaThe brain's goals and their picker (ai.goals): what the computer could do, scored each think, the best given what they claim (think, once a think: run by the goals() module, or by a module of the brain's own in its place among the others). What each holds is read here (held, holds, holder, pool), taken by a rule or a module (take), and reported (report)
HeardEvents betaWhat a computer player heard (knowledge.events): pings, damage to its own and its allies', deaths, each with its tick, the oldest first
Knowledge betaWhat a computer player remembers of the enemy, the map and itself, with when (Brain.knowledge). Brought up to date once a think from the view; asked through its parts: enemy (structures, bases, army seen, workers, heroes, tech), map (when a place was last looked at), own (losses, attacks sent, income), events (pings, damage, deaths heard). Plain data underneath (data), saved with the brain
LanesPlay betaThe lanes of a lanes brain, read as its side sees them, and what its heroes do on them (ai.module('lanes')'s play): the module's goals read it
MapKnowledge betaWhat a computer player remembers of the map (knowledge.map): when each place was last in sight. The cells are of the view's grid (8 units)
MeleeArmy betaThe melee player's army: its waves of its own and the goals beside them (the file's comment), its numbers from its options (firstAttack, attackEvery, waveSize) and the defence's radius, its memory. Made for a brain by the army() module; reached as ai.module(MELEE_ARMY)?.army (meleeArmyOf(ai))
OwnKnowledge betaWhat a computer player remembers of itself (knowledge.own): what it lost, the attacks it sent, what it gathered
Plans betaA brain's plans (ai.plans): build for what is to be built, production for what is to be trained and researched, the game's build order over both. want is the one door: a want of a building goes to the build plan; one of a unit goes to the build plan for its buildings, and the production plan trains it
ProductionPlan betaThe brain's production plan (ai.plans.production): what it trains and researches, by the wants of units, the composition and the counters, with supply kept ahead. train and research are the primitives any module uses to queue something through the purse; think runs the plan once a think
Purse betaWhat a computer player has to spend this think (ai.purse): its resources less what is promised and held, spent through spend. Rebuilt from the picture each think
Roles betaWhat the unit types of a game are for (AiView.roles): the inferred roles (inferRoles, or a game's own finder in its place) with what the game declares on a type over them (UnitTypeDef.ai), and the queries over them
Squad betaA squad of the brain (ai.squads.make, named, all): a handle over its data, with the task methods. A squad's units are as of the think's picture: the dead and those its owner no longer holds are dropped as the squads module looks at it
SquadGroup betaSome squads together (ai.squads.all(), idle()): read as a list, told as one (ai.squads.all().defend(home): each squad is given the task)
Squads betaA brain's squads (ai.squads): made by its goals, rules and modules, watched by the squads() module each think (think): the dead dropped, what the owner let go of let go of, each task looked at, regroups, retreats and reinforcements seen to. Kept in the brain's memory (BrainMemory.squads)
Strength betaHow strong things are, to a brain (AiView.strength, Brain.strength): one unit or type (of), a group (sum, what UnitSet.strength() asks), one force against another (matchup, odds), and what to train against what was seen (counterFor). The formula is the kit's (defaultStrength) unless the brain was given one (AiOptions.strength, BrainDef.strength); a type's declared strength (UnitTypeDef.ai.strength) goes before either. What a type's numbers come to is worked out once and kept across thinks; a seen unit's own stats (EntityState.stats: its upgrades, items, levels, buffs) are read each time
ThinkBudget betaThe budget of the think under way, as a module reads it (ai.budget): what this tick may still do, and the way to say what was looked at (spent) and to go on at the next tick (later). A module that walks units looks at them a few at a time: for (; this.cursor squads.length; this.cursor++) look(squads[this.cursor]) if (!ai.budget.spent(squads[this.cursor].size) && this.cursor + 1 squads.length) return ai.budget.later()
ThreatMap betaWhere the strength is, on a coarse grid over the map (AiView.threat, Brain.threat): at(point) reads a place, around(point, radius) the worst cell near it, hot() the cells where the enemy is strongest near what is one's own, cells() every cell with something in it (for a drawing of it). Made from the view's picture when first asked, once a think; all zeros for no point, or one off the map, so that a question about "the first base known" needs no guard
UnitSet betaA set of entities as the view gives them, in the snapshot's order, with the questions a brain asks as methods, each giving a set again, so that they chain: ai.view.mine.withRole('worker').idle(), ai.view.enemies.near(home, 20).fighters(). It reads as an array (length, for..of, map, filter, find, some, every, forEach, first, at; items is the plain array) but is not one: map and filter give plain arrays, where gives a set. (Not an Array subclass on purpose: the engines run filter and find on one several times slower, species lookup, and a think asks dozens.) A set is of one think: it reads the view it came from
ViewEvents betaThe events of a think, by kind (AiView.events): what happened in the tick of the picture that cannot be read from the state (deaths, damage, pings, the game's own)

Interfaces ​

NameWhat
AbilityAiView betaWhat a computer player sees as it weighs an ability, for the ability's ai to decide with (AbilityDef.ai)
AiActionData betaWhat a rule does, as plain data: a word the brain tells itself ({ say: 'attack', data: { at } }), answered by the words() module or a told rule of its own, the same think where they come after the rules
AiCheckOptions betaHow a brain is checked (checkBrain, watchComputer)
AiDecision betaOne thing a computer player decided, as a line of text: what it did and the reason that weighed most
AiEndLimits betaSeconds a thing may go on before the ends invariant says it is stuck (AiCheckOptions.limits)
AiFlags betaThe classic RTS behaviour flags, where the meaning holds, and the kit's own beside them: each a yes or no, a number where one says how much, or a function of the brain
AiHandicap betaWhat a computer is given beyond the rules (AiProfile.handicap): each a factor, 1 (or left out) for none
AiHints betaWhat a game declares of a unit type for the computer player (UnitTypeDef.ai), where what the kit infers from the definition is wrong or cannot be known: its roles, words of the game's own about it, what it answers, how much it is worth hitting. A declared role is in place of the inferred ones, not beside them
AiModule betaOne named part of a computer player's think (defineBrain's modules). Modules run in their order each think, over the same picture of the game, each reading it through the brain it is handed (ai.snapshot, later ai.view) and acting through ai.send. A module is made for each brain (AiModuleDef: a function of the brain), so that what it keeps in itself is one seat's. What it remembers between thinks goes through save and restore, as plain data
AiOptions betaWhat a computer player is seated with (world.computers.seat): where its rivals started, its difficulty, its personality and its settings (Brain.options). The data in it (numbers, lists, names) is kept in a save with the seat; a function given as an option is not (world.computers.seat says what becomes of it)
AiProfile betaHow a computer player plays, as plain data: the settings of its areas (AiSettings) and how well it plays, every field optional, layered (see the file's comment). What a difficulty, a personality and a game's defaults give
AiRange betaAt least min and at most max, each left out for no bound: a count, an amount, a level
AiReport betaWhat a computer player is thinking, as plain data (Brain.report, Brain.inspect): what the debug panel's AI tab draws, and what a test reads. Each module adds its section (AiModule.report, AiModule.inspect)
AiRule betaA rule of a brain (when(condition).do(action)): checked each think by the rules() module, its action done as its condition becomes true. Code: given again by the brain's definition, as goals are; what it remembers is data
AiSettings betaWhat a brain's areas play by, by area, each under its own names (see the file's comment): what every layer gives, from the brain's definition to the seat. Plain data where a lobby, a map or a save holds it; a function in it is code, not kept in a save
AiStats betaWhat a computer player's play adds up to since it was seated (Brain.stats, AiReport.stats): the numbers simulate reports beside who won, and a test reads to see that the squads send an order once and watch it. Counted, never decided on
AiViolation betaA rule a computer player broke, at a think: which, whose, when, and what exactly, in words
ArmySighting betaA group of the enemy's fighters, seen together (enemy.armySeen): where its middle was, the tick, how many, of what types, with how much health and strength, whose (the owner of most of them)
AttackGroup betaWhat a wave is made of: so many of each unit type (by id) or role (caster, a game's own), by name, under a condition
AttackPlan betaAn attack the computers of a team agree on (together): where, when, who proposed it, who joined and who did not
AttackSent betaAn attack a module sent (own.attackSent): when, where to, with how many
AttackWave betaOne wave (the classic attack wave): its group, when it goes, how much of it is enough, how long it gathers, whether it goes again, together or not, and where to
Base betaOne of a player's bases, as the view clusters its buildings: around each building that takes deposits (a hall, what stands on a mine), or around any building where none does
BrainContext betaWhat a seat hands a brain as it is made, besides its session and its options (createComputerSystem's make)
BrainDef betaWhat a computer player is made of, defined once (defineBrain) and seated as often as wanted (world.computers.seat). A game lists the brains it seats in Rules.brains, so that a save that remembers a seat by its brain's id finds it again when loaded
BrainMemory betaWhat a brain remembers between thinks, as a save keeps it: its own numbers, each module's memory with its version, the words it was told and not yet taken
BrainWatcher betaWhat follows a brain's play from outside it (Brain.watch): the commands it sends, its thinks as each ends, what it decides. For tests and tools (watchComputer, recordDecisions, the invariants of ai/checks.ts): a watcher reads, it never changes what the brain does
BuildPlanMemory betaWhat the build plan remembers between thinks, for a save: each want's memory, and the wants added as the game went that are plain data (a rule's), to have them again
BuildPlanOptions betaHow the build plan goes about it (BrainDef.plans.build, the build() module; the data of it in AiOptions)
BuildPlanReport betaThe build plan as the report shows it: its wants, and which one saves up
Claimed betaWhat a picked goal was given (GoalDef.run): the units it holds this think (the dead and the lost dropped), the money, when it was picked, and whether this is the first think it runs
CompositionReport betaOne type as the production plan weighs it, for the report: its share of the army wanted (target, 0..1), its share now (share), how well it answers their army (counter: 1 is as good as against anyone), and what the two come to (urge: the most urgent is trained next)
ComputerPlayer betaA computer player: whatever plays a seat of a world from what it sees, through commands as a player does. The engine's own is a Brain of modules (defineBrain), the melee player among them; a game gives its own in code (defineComputer, listed in Rules.brains). think is asked about once a second (createComputerSystem); save and restore keep what it remembers through a save
ComputerSeat betaA seat as a save keeps it (core.computers): the brain by id, and the data part of its options
ComputerSeatOptions betaHow a seat asks its computer player to think (createComputerSystem)
ComputerSystem betaThe system a computer player plays from: it is asked to think about once a second (every, in seconds), each seat at another tick of it, to spread the work; it is named for its seat (ai-<player>), which a save keeps what it remembers by
ComputerTiming betaMilliseconds a computer player's thinks took: for the report and the stats panel, never for a decision
Consideration betaOne question a goal asks of what it sees, and how much the answer matters: read gives the raw number, curve turns it into 0..1. The report keeps both
Counter betaHow well a type answers a force (Strength.counterFor): its strength against them over its plain strength. 1 is as good as it is against anyone, 0 is useless (it cannot hit them), above 1 it is the answer
DamageSeen betaDamage seen done to one's own or an ally's entity in a think (events.damage): added up over the think, one line an entity
DeathSeen betaA death seen (events.deaths): of anyone known to the seat in the think before
DefenceMemory betaWhat the defence remembers between thinks, as a save keeps it: each base's raids
DefenceOptions betaHow a brain defends its bases (BrainDef.defence, the seat's AiOptions.defence over it, the defence() module's own under both). Data, kept in a save
DefenceReport betaThe defence as the report shows it (AiReport.defence): the raids on now with what answers each, every base's raids so far, the towers it wants
DefinedBrain betaA brain as defineBrain gives it: with its with, for variants of it
EconomyBase betaOne base as the economy sees it (ai.economy.bases(), the report): its deposits, what they serve, the workers it wants and has on each resource
EconomyMemory betaWhat the economy remembers between thinks, as a save keeps it: the workers that fled a raid
EconomyOptions betaHow a brain runs its economy (BrainDef.economy, the seat's AiOptions.economy over it, the economy() module's own under both). Every field has a data form a save keeps; the function forms are the brain's to give again
EconomyReport betaThe economy as the report shows it (AiReport.economy.bases, fled): each base with what it wants and has, the workers that fled, how many it trains, what the next expansion waits for
EnemyBase betaAn enemy's base, as its structures remembered cluster (enemy.bases): around what takes deposits (a hall), or around any structure where none does. gone when every structure of it is known gone; expansion for every base of an owner but the first seen of theirs
GameAi betaWhat a game says of its computer players' profiles (Rules.ai): difficulties and personalities of its own, and defaults over the engine's
GoalClaims betaWhat a goal claims to run: units from the pool and money from the purse. The picker gives each goal what it asks of what is left, best goal first
GoalDef betaA goal: something the computer could do, scored by its considerations, run with what it claims (defineGoal)
GoalReport betaOne goal as the picker last saw it: for the debug tools, and for "why did it do that"
GoalsMemory betaWhat the goals remember between thinks: what each holds, and until when each is on cooldown
HeroPlan betaA hero the brain means to have (MicroOptions.heroes): which, what it learns in what order, what it buys
HiringItem betaA line of what a brain hires (MicroOptions.hiring): a unit a place hires out, how many of it to have, when
Hold betaWhat a goal holds while it runs: its units (ids, of the player's), its money, when it was picked and until when it is committed. Plain data, kept in the brain's memory
KnowledgeMemory betaWhat a brain's knowledge is, as plain data: what a save keeps (Brain.save, under knowledge), what a game's module may read or add to through Knowledge
KnowledgeOptions betaHow a brain's knowledge remembers (BrainDef.knowledge): how long, how much, what counts as the army. Every field has its default; numbers are seconds where they say so
KnowledgeReport betaWhat a computer player remembers of what it saw, in short, for the report: its rivals' bases and their army as last seen, with how many seconds ago, and the tech seen
LaneSide betaA lane as one side reads it (LanesPlay.lanes): the path, measured from that side's end (from: the end its own spawner stands at), its length
LanesModule betaThe lanes module, with the play it runs (LanesPlay): what the tests reach
LanesPlayMemory betaWhat the lanes module remembers between thinks, as a save keeps it: the heroes resting, since when; when each last used an ability that takes it home
LanesPlayOptions betaHow a lanes brain plays (lanesPlay(options), the seat's AiOptions.lanes over it): its heroes' rest, how far it goes for an ally or a camp, how near its wave it walks. Data, but for units and home as functions
LaneState betaA lane as it stands this think, for one side: its waves' fronts (in cells along it from its side's end), who is on it, the towers by it
Look betaA place in the plan of looks: where, what kind of place it is, when it was last in sight
Loss betaSomething of one's own that died (own.lost): what, where, when, to what type of killer where it was seen
MapAi betaWhat a map says of how its computer player plays (MapPlayer.data.ai, decision 6 of the AI plan), for a player the map gives the computer (controller: 'computer'): a difficulty and a personality by name, and settings (AiSettings: its flags, its build order as plans.order, its waves as waves.waves, any area's numbers). Plain data, as the map's file holds it
Matchup betaWhat one side of a matchup is worth against the other, with how (Strength.matchup): the strength of each of its units against the opponent, summed
Me betaThe player a brain plays, as its picture of the game shows them: what the snapshot has of one's own player (PlayerState.own), beside who they are. Mutable for the think: a module that sends a train bumps supplyUsed itself, so that the next module does not queue past the cap before the command lands
MeleeArmyMemory betaWhat the army module remembers between thinks, as a save keeps it (BrainMemory.modules['melee.army'])
MeleeArmyModule betaThe army module, with the army it runs (MeleeArmy): what the tests and the debug tools reach (meleeArmyOf)
MeleeArmyOptions betaHow the melee player's army goes about its own waves and the goals beside them (AiSettings.army over the melee brain's army(options)). Data: a save keeps the seat's
MeleeBuildOptions betaHow the melee brain builds (build() of the melee brain): its ladder of wants, and how much better an answer to their army must be for its building to be put up
MeleeHeroesOptions betaHow the melee brain makes its heroes (heroes() of the melee brain): how many once the game is under way (the profile's heroes), from when, and how important their price is to the purse
MeleeSurrenderOptions betaWhen the melee player gives up (MeleeArmyOptions.surrender): the condition, and how long it holds first
MeleeWant betaOne rung of the melee player's ladder of wants: what to have, by role, how many, how important, money to spare, when. counter and tier are worked out each think (the file's comment); any other role is the first type of it the player can make
MicroMemory betaWhat the micro module remembers between thinks, as a save keeps it
MicroOptions betaHow a brain fights (BrainDef.micro, the seat's AiOptions.micro over it, the micro() module's own under both): whom it hits first, whether its ranged units kite, when its units flee, how it casts, what it buys, how its siege is used, which heroes it makes. Every field has a data form a save keeps; the function forms are the brain's to give again
MicroReport betaThe fights as the report shows them (AiReport.micro): each squad in one, its foes, its odds, whom it hits; the units that fled; the heroes and what each learns next; who shops for what
MissionBrainDef betaThe mission brain's definition: a brain's (BrainDef) with the parts given as modules, after the ones every mission has. Its id is what a save remembers the seat by: list the brain in Rules.brains
MissionPartMemory betaWhat a part remembers between thinks, as a save keeps it: its own units, and what its kind adds (an ambush's spring, a wave's count)
MissionPartOptions betaWhat every part of a mission takes
MissionUnitsData betaWhich of its units a part takes, as data: those named (named), of a type, a role or a tag, near a place (near, within), at most so many (count, the nearest the part's place first). Its fighters (soldiers and heroes) where none of named, type, role, tag is given
ModuleKey betaWhat finds a module of a brain with its shape (ai.module(key)): its id, typed. The kit's are MELEE_ARMY and LANES; a game makes its own with moduleKey
PickingOptions betaHow a brain picks among its goals, where a goal does not say for itself (BrainDef.picking)
PingHeard betaA ping heard (events.pings): who marked where, of what kind
PlansMemory betaWhat the plans remember between thinks, for a save
PlansOptions betaHow a brain plans (BrainDef.plans): the build plan's options, the production plan's, the build order
PlansReport betaThe plans as the report shows them: the purse, and each plan's part
ProductionPlanMemory betaWhat the production plan remembers between thinks, for a save: what its want of supply was set with
ProductionPlanOptions betaHow the production plan goes about it (BrainDef.plans.production, the production() module; the data of it in AiOptions.composition and research)
ProductionPlanReport betaThe production plan as the report shows it: the composition as weighed, what it trained and researched this think, the unit wants it trains towards, and why it did not train where it did not
PurseReport betaThe purse as the report shows it: what is free, what builders on their way will pay, what is held and by whom, with how important each holder is
Raid betaThe intruders at one base, as the defence sees them this think (ai.defence.raids())
ResolvedProfile betaA profile resolved (resolveProfile): what it plays by, and its settings' layers as given, lowest first, for the brain to work out each think (a flag may be a function of it)
RoleEntry betaThe roles and tags of one unit type, with why (why: a line per inferred role, for the report; none for a declared one)
RolesPlayer betaThe player the roles are found for, where finding them depends on who asks (AiOptions.roles)
RuleBuilder betaA rule being written: when(...), then any of once, every, priority, named, then do
ScoutingMemory betaWhat the scouting remembers between thinks, as a save keeps it
ScoutingOptions betaHow a brain scouts (BrainDef.scouting, the seat's AiOptions.scouting over it, the scouting() module's own under both). Data, but for the function form of scout
ScoutingReport betaThe scouting as the report shows it (AiReport.scouting): the plan of looks with how old each is, the scout, where it goes
SeatRequest betaWhat a seat is asked for (world.computers.seat(player, request)): the brain (one of the game's, defineBrain, or its id; the first the game lists when left out) and what it is seated with (AiOptions)
ShoppingItem betaA line of a hero's shopping list (MicroOptions.shopping, HeroPlan.items): an item to carry, how many, when
SiteRequest betaWhere a type is wanted: near a place, no further than within, and which of its kind this is (ordinal, so that two farms do not try the same corner first)
SquadData betaA squad as the brain remembers it: plain data, kept in a save
SquadOptions betaHow a squad behaves around its task (SquadsOptions, ai.squads.make(name, units, options)): when it regroups, reinforces, retreats. Plain data, kept in a save
SquadReport betaA squad as the report shows it: who it belongs to, its units and their strength, where it is, its task and how it goes
SquadsMemory betaWhat the squads remember between thinks, for a save
SquadsOptions betaHow a brain's squads behave, where a squad says nothing for itself (BrainDef.squads, the seat's AiOptions.squads over it); and the tasks of the game's own (defineTask) a save of the brain may name
StrengthInput betaWhat a strength formula is given of one unit or type: its definition, its stats as they stand (the type's, with what the snapshot shows of a seen unit's own: upgrades, items, levels, buffs), the entity where there is one (its health, its level) and the view, for the roles and the registry
StructureSeen betaAn enemy structure as remembered: where, what, whose, and when it was first and last in sight (ticks). gone is the tick it was known to be gone: seen destroyed, or its spot seen empty
TargetRule betaOne rule of who is worth hitting first (MicroOptions.targets): what it picks out, how much it adds, when it counts. Plain data
TaskDef betaA kind of task (defineTask): what it sends as it begins (start), what it looks at each think (think), and the place it is about (where, for the squads module's regroup and reinforcements and for the report). The squads module runs it with its own regroup, reinforce and retreat around it, but for what it handles itself
TaskOrder betaA task to give next (then): its kind (the kit's attack, a game's defineTask id) and what it is given
TaskState betaWhat a squad is doing, as plain data kept in the brain's memory: the kind of task, what it was given, where it is in it (phase: going, regrouping, fighting, gathering, holding, the task's own words), since when, the last order it sent, and how it ended
TeamBoard betaA team's board as the world keeps it (core.ai.teams, by team): plain data, kept in a save, never replicated
TeamOptions betaHow a brain plays with its team (BrainDef.team, the seat's AiOptions.team over it, the team() module's own under both). Data
TeamPlayMemory betaWhat a brain remembers of its team play between thinks (BrainMemory.team): up to when it heard, when it last said each line
TeamReport betaTeam play as the report shows it (AiReport.team): the team, its computers, the requests on its board, the plan of an attack together, how many enemy bases the team knows
TeamRequest betaSomething one computer of a team asks of the others, on the team's board: help at a place
TechPath betaThe steps from what the player has to being able to make a type (techPath): the prerequisites, the producer, in the order they can be taken; the type itself is not among them. cycle names the definitions that go round in a circle where they do, impossible the type nothing of the player's can make, and the steps are then as far as the walk got
TechStep betaOne step towards a type: a building to build (by a worker), a building to turn another into (morph, from the type that turns into it), or a unit to train (at the type that trains it). for is what the step is on the way to
ThinkBudgetOptions betaHow much of a think one tick may do (AiOptions.budget, AiProfile.budget, ComputerSeatOptions.budget), counted in work and never in milliseconds: the same on every machine, so that a game with a sliced think is the same game everywhere. Nothing is limited where a field is left out
Threat betaWhat the threat map reads at a place: the strength of the friendly units (one's own and allies') and of the enemy units (rivals' and creeps') that can reach it, and the difference
ThreatCell betaA cell of the threat map with what it reads (ThreatMap.hot, cells)
ThreatQuery betaWhat a read of the map is for: the layer the thing asked about is on (ground when left out: what can reach things on the ground), and whether the enemy structures remembered and out of sight count too (a tower seen before)
ThreatReport betaThe threat map as a computer player read it last think (ThreatMap.cells, on the ground, the enemy structures it remembers counted): what the game view's AI overlay draws as heat over the ground. The size of a cell, the grid's cells across and down, and each cell with something in it as [col, row, friendly, enemy]
Told betaA word the game told a computer player (world.computers.tell), waiting for a module to take it
TypeSeen betaA unit type of the enemy's as seen (enemy.typesSeen): first and last tick, and the most seen at once
UnitSeen betaAn enemy unit as last seen (enemy.workersSeen, enemy.heroesSeen): level for a hero, died the tick it was seen to die (a hero may come back)
ViewOptions betaWhat the view is handed beside the snapshot: the last think's view, whose roles it keeps where the game's definitions stand, and a game's own way of finding the roles (AiOptions.roles)
Want betaA want with the function forms: how many as a function of the brain, a condition as code, a place found each think, a placement strategy of the game's own (ai.plans.want, BuildPlanOptions.wants)
WantData betaSomething a computer player wants built or trained, as plain data (a map's file, a rule's action, a seat's options): a type, how many, under what condition, where, how important. WantData is what a save keeps; Want is the same with the function forms
WantReport betaOne want as the report shows it: what it is, how far along, what it waits for (status), the steps to it, what it holds in the purse
WavesMemory betaWhat the waves module remembers between thinks, as a save keeps it
WavesOptions betaHow a brain sends its waves (BrainDef.waves; the seat's AiOptions.waves and groups, the data of it, go over)
WavesReport betaThe waves as the report shows them (AiReport.waves): the wave whose turn it is, its group as it stands, when it may go; the waves sent
WordData betaWhat the words a brain may be told (words()) come with: where (at, a point, or a name the map or rules gave an entity or region), and for how many seconds the army is the word's, not the goals' (seconds)

Functions ​

NameWhat
ambush betaIts units wait at a place on hold (they hit what walks into reach and move for nothing), and spring once a rival's unit comes within radius of it (or once trigger holds): they go for the intruders, fighting what they meet. Once that fight is over, then (AmbushThen). once: it springs the first time only. Its units: those at the place as it is first picked, or what units say
an betaA thing as a decision writes it, with its article: a farm, an altar
build betaThe build module: runs the brain's build plan (ai.plans.build.think()) in its place among a brain's modules, after what adds wants (rules, goals) and before what gives idle workers something else to do. With options for the plan
checkBrain betaChecks a brain against the invariants after each of its thinks from now on: throws at the first broken rule, or tells onViolation of each. Returns the checks (their violations) and the way to stop: what watchComputer does for a seat, and every brain does by itself while debugChecks.ai is on const checks = checkBrain(brain, onViolation: (each) = found.push(each) )
consider betaA consideration: a question with a name, and the curve that says how much its answer matters (curve.linear() when left out: the number is a ratio already)
createBrain betaMakes a brain from its definition for a seat: the session it plays through, the options it is seated with. What a brain's seat does (createBrainSystem); for a seat made another way (createComputerSystem's make)
createBrainSystem betaSeats a brain at a world as one of its players, asked to think as its definition or the options say (every), with the budget the options give. Add the result to the world, or go through world.computers.seat
createComputerSystem betaSeats a computer player at a world: made of a session of its own (it sees what that player sees, and plays through commands, so it cannot cheat), asked to think about once a second. make is handed the session and what a brain takes besides (BrainContext: a seed of its own, the budget, whether the world profiles). Add the result to the world (world.addSystem), or seat through world.computers.seat, which remembers it for a save
defence betaThe defence module: the raids on the bases counted each think, the towers a raided base wants (ai.defence.think), and the defend goal put on the brain's picker, which answers each raid with a squad of its own. With how it defends where the brain's definition and the seat's options say nothing (DefenceOptions)
defineComputer betaA computer player of the game's own that is not made of modules (a ComputerPlayer: anything that thinks), as a brain the game lists (Rules.brains) and seats as it does any (world.computers.seat(player, { brain })): found again by its id when a save is loaded. make is handed the seat's session, its context and what it was seated with, the map's under the seat's; it thinks as often as those say (every, 1 second when left out)
defineGoal betaDefines a goal: checked, and given back as it is, for a brain's goals, meleeBrain.with({ goals }), or ai.goals.add
defineTask betaDefines a task: a kind of thing a squad can be told to do (squad.task(def, data), its data typed by the task), the kit's and a game's own. List a game's in the brain's settings.squads.tasks, so that a squad on it goes on after a load
difficultiesOf betaThe difficulties a game's computers may play at, by name: the engine's, the game's over them
economy betaThe economy module: the workers base by base each think (ai.economy.think): builders to sites, workers off a raid and back, the idle where they are missing, the spare moved, the other resource's gatherers, what the money is gathered at, workers trained, another hall wanted. With how it runs where the brain's definition and the seat's options say nothing (EconomyOptions)
enemyDirection betaWhich way the enemy is from a place, as a unit vector: towards the nearest of their bases it knows of, else the nearest base the seat was told of (AiOptions.enemyBases), else towards the strongest enemy reaching its own (threat.hot). Nothing where it has no idea
evaluate betaWhether a condition holds for the brain now: a function is asked, data is read as its form says. A form the kit does not know (a game's own not defined) is no, and the log says so once
flagOf betaA flag's value as asked now: a function of the brain worked out, data as it is. For a flag no area has a name for (No Mercy, Random Paths, Allow Home Changes): the rest are the areas' (ai.settings)
fleeWhen betaWhen the condition holds, its units run: to to (a place), else home, else away from the nearest rival; and stand there while it holds. Once it no longer does, they are let go of, and the parts that had them take them back. An urgent goal worth 10: it takes its units from any other. Its units: its fighters, or what units say
goals betaThe goals module: runs the brain's picker (ai.goals.think) in its place among the brain's modules, after what reads the game and before what acts on orders. With goals of its own to add to the brain's
guard betaIts units stay by an entity, by its name (world.named) or its id: a unit they follow, a building they hold round (within radius, 12 when left out), fighting what comes near it. While the entity stands: once it is gone, its units are let go of. Its units: those near it as it is first picked (within 20), or what units say
holdPosition betaIts units hold a place: they go there, fight what comes within its reach (radius, or the region's size, else 10), and go back once it is gone. Its units: those at the place as it is first picked (within its reach and a little), or what units say
inferRoles betaInfers what every unit type of the game is for, from its definition: the rules, written down once, each with its reason (RoleEntry.why). What a game declares (UnitTypeDef.ai.role) is not looked at here: findRoles puts it over what is inferred
laneAt betaThe point so far along a side's lane from its end
lanesBrainOf betaThe engine's computer player for a game of lanes (lanesPack): a brain of its rules, the words, lanesPlay, the team, the picker, squads and micro (the file's comment). Heroes walk the lanes with their waves, rest at home when hurt, help an ally's hero, take a camp with no wave to walk with. A variant is lanesBrain.with({ ... }); a game's own lanes brain is lanesBrainOf({ id, lanes, ... })
lanesPlay betaThe module of a lanes brain: the lanes read for its side, its heroes' rest, and its goals put on the picker (the file's comment). Its options under the brain's settings (AiSettings.lanes)
lanesTargets betaWhom a hero of a lanes brain hits (micro's targets, the file's comment): the minion its next hit kills, one of their heroes not under their tower, a building (a tower its side's minions take the shots of), the weakest of the rest; never what stands where their tower would turn on it
meleeArmy betaThe melee brain's army module: the goals of the army put on the picker (attack, creep, raid, harass, expand), the wave's wait counted. Before the picker (goals), after the building and the production, as the old turn had it. With how the army goes where the seat says nothing (MeleeArmyOptions)
meleeArmyOf betaThe melee brain's army (MeleeArmy) of a brain: its waves, numbers and memory, for the tests and the debug tools. Throws for a brain without the melee.army module
meleeBuild betaThe melee brain's build module: the ladder of wants set on the build plan each think, the counter and the tier worked out, the plan thought. After the heroes, before the production and the picker, as the old turn had it; steps.construction honoured
meleeHeroes betaThe melee brain's heroes module: a fallen hero revived, the next trained while it wants more, their price held in the purse meanwhile. After the economy, before the building, as the old turn had it; steps.heroes and steps.buildOrder honoured
meleeProduction betaThe melee brain's production module: the production plan thought, after the building and before the picker, as the old turn had it; steps.production honoured
meleeSurrender betaThe melee brain's surrender module (melee.surrender): gives up once it cannot come back (see MeleeSurrenderOptions), the engine's surrender command sent once. Its options under the settings' (army.surrender)
micro betaThe micro module: the fights of the brain's squads each think, after the squads sent and watched their tasks (ai.micro.think): focus fire, kiting, siege, fleeing and coming back, spells, items, the heroes' skills. With how it fights where the brain's definition and the seat's options say nothing (MicroOptions)
missionRules betaMission rules as data (campaign plan MS1): the rules a map keeps (MissionRule, under GameMap.data.rules, written in the editor's Rules panel) run as the game plays, rules of the game's own code beside them. Each when a condition of the computer players' language holds (docs/ai/scripting.md), asked as a player, does its actions (MissionActionData: an objective of the map's given, done or failed, a line said, a cinematic played, a prefab spawned, a computer told, a relation set, a timer started, win, lose). Checked once a second; what the rules remember is in the world's state, so a save mid-mission has it. The code reaches the rules with tellRules and hears them fire as ruleFired; the map's checks say what is wrong with them (checkMissionRules). Of @v12-engine/engine/ai, as a condition is asked of a watcher seated as the computer players are (ruleWatcher); the map objectives pack (mapObjectives) goes with it, for the objectives a rule gives
moduleKey betaA key to a module of a game's own (ai.module(key) gives it with its shape)
onLane betaWhere a place is on a side's lane: how far along from the side's end, how far off the line
pair betaA point as a report has it: [x, z], rounded
patrol betaIts units walk a round of places, one after the other and back to the first, fighting what they meet on the way. Its units: those near the first place as it is first picked, or what units say. Places it does not know are passed over
personalitiesOf betaThe personalities a game's computers may have, by name: the engine's, the game's over them
plural betaUnits counted as a decision writes them: 1 unit, 3 units
point betaA point as plain data, for a save or a task's data: { x, z } and nothing else
production betaThe production module: runs the brain's production plan (ai.plans.production.think()) in its place among a brain's modules, after the build plan (which puts up what a want needs) where a brain has both. With options for the plan
resolveProfile betaThe profile a seat plays by (Brain.profile): the brain's settings (BrainDef.settings), the game's defaults, the race's (GameAi.races, for the race the seat plays), the difficulty, the personality, the seat's own (AiOptions.settings, the map's under it), each over the one before; how well it plays from the engine's defaults, the game's, the race's, the difficulty, the personality and the seat's every and budget. A name the game does not have is passed over, and unknown names it
resolveSettings betaThe settings layered, lowest first (see the file's comment): each area's values key by key, a flag taken into the area it names in its own layer. A flag that is a function of the brain is asked of ai, and left out where none is given
rings betaThe rings around a place, walked out from from to within (then in from from to the nearest ring where inward), each at so many angles; the first point that stands clear and that accept likes. Deterministic, but not the same corner for every building: the angles start where ordinal says. Nothing a worker cannot walk to
rules betaThe rules module: checks its rules each think, in their order (by priority, then as given), and does each one's action as its condition turns true. Ahead of the modules that act on units, where a brain lists it: what a rule takes is then not given orders by them first. Its id is rules (give id for a second one)
scouting betaThe scouting module: puts the scout goal on the brain's picker, which sends one unit at a time to look at what is due (ai.scouting). With how it scouts where the brain's definition and the seat's options say nothing (ScoutingOptions)
squads betaThe squads module: looks at every squad of the brain each think (ai.squads.think), after the goals, the rules and the words that make them: their units, their tasks, regroups, retreats, reinforcements. With how they behave where the brain's definition and the seat's options say nothing
surrenderWhen betaWhen the condition holds, the computer gives up: the engine's surrender command, as a player's, once. Out of the game as if beaten
team betaThe team module: the team's board brought up to date each think (ai.team.think: itself and what it knows written, pings and an ally's damage heard as calls for help, its own raids asked help for, the plan of an attack together answered), and the help goal on the picker. With how it plays where the brain's definition and the seat's options say nothing (TeamOptions)
techPath betaThe steps from what the player has to being able to make a type: what it requires that it lacks, each of those in turn, and the type's maker where it has none (the hall that trains the worker, the worker that builds the barracks, the hall that turns into the keep). What stands finished (view.me.tech, with what it counts as) or is on its way (onItsWay: under construction, a builder sent, a morph queued) is had already. A requirement no type has as its id is met by a type that provides it
waveFrom betaThe units that come out of a spawner (what the mission's own rules spawn there, or what a building there trains), gathered there and sent as a wave: once there are as many as group says (a number, or so many of each type or role: { footman: 4, caster: 1 }; 4 when left out), or, with every, every so many seconds with what has gathered (at least minForces of the group: a share, any when left out). A wave goes for target (MissionTarget) and, once that is cleared, for the next it knows of. first: seconds before the first wave may go (every, else none). Nothing is trained or built: a mission with no economy feeds it
waves betaThe waves module: the wave whose turn it is, each think (ai.waves.think): its group wanted, sent once enough of it is free and its time has come, gathering at the rally, then attacking. Idle without waves given. With how it sends waves where the brain's definition and the seat's options say nothing (WavesOptions)
where betaA point as a decision writes it: (40, 60)
words betaThe 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

Values ​

NameWhat
AI_INVARIANTS betaEvery invariant, in the order they are checked
AI_PHASES betaThe phases of a think, in the order they run (AiModule.phase): hear what it was told and its rules, sense what threatens it and its team, plan its economy, buildings and training, decide what its own goals are, act the picker, the squads and the waves, fight the micro
aiTeams betaThe boards of the teams' computers (TeamBoard, AI plan C5), by team: in the world, so that a save keeps the requests and the plan of an attack together, and never replicated, so that no player gets it in a snapshot
ATTACK betaAttacks a place or a target, by a way round where told: done cleared with nothing left to fight there, lost with its target gone
CAPTURE betaTakes a capture point of the game (capturePack): done captured, or lost where it is gone
CREEP betaTakes a camp of creeps: done cleared once the map says the camp is
curve betaThe usual response curves, each a line (consider(name, read, curve.saturate(6))): how a raw number becomes "how much do I care". A curve gives 0..1; what gives nonsense (NaN) counts as 0
DEFAULT_PROFILE betaThe engine's defaults of how well it plays: the bottom layer. The areas' numbers are each area's own where no layer says them (Economy's 8 workers)
defaultStrength betaThe kit's formula for how strong a unit is, under a square root so that it adds up over a group (Lanchester): sqrt(toughness × offence) × hero, where - toughness is the health it has left, more by its armour and magic resist (the middle of the two, since no opponent is in question: 100 of armour doubles it, as the engine's mitigation halves what arrives), - offence is its damage a second (attackDamage × attackSpeed), up to a quarter more for reach (at 10 of range) and a tenth for speed (at 8), - hero is 1 for a unit, and 1.1 + 0.1 × (level − 1) for a hero: its spells, and more as they level. 0 for what has no attack: a building that does not shoot, a worker with no weapon. A declared strength (UnitTypeDef.ai.strength) is taken in its place by Strength, before this is asked
DEFEND betaThe id of the defence's goal: what a game weighs it by (AiOptions.weigh)
DEFEND_TASK betaHolds a place against what comes within its radius, one foe at a time
DIFFICULTIES betaThe engine's difficulties: how well it plays. normal is the areas' own numbers. insane sees through the fog and gets half again of what its workers bring in, as the classic insane computer does
ESCORT betaFollows a unit and fights what comes near it: done lost with it gone
GATHER betaGathers at a rally: done arrived once enough are there, or the time is up
HARASS betaGoes for the workers at a place, one at a time, round their army where told
HELP betaThe id of the help goal
HOLD betaStands its ground (defensive where the game has stances), where it is or at a place
LANES betaWhat finds a lanes brain's module with its shape (ai.module(LANES))
lanesBrain betaThe engine's computer player for a game of lanes, as it is: lanesBrainOf({ id: 'core.lanes' }). List it in the game's Rules.brains and seat it (world.computers.seat(player, { brain: lanesBrain }))
MELEE_ARMY betaWhat finds the melee army's module with its shape (ai.module(MELEE_ARMY))
MELEE_LADDER betaThe melee player's ladder as it stands: a hall, a barracks, another hall once the mine at home runs low, an altar, the building its best answer needs, the next tier of its hall once a barracks stands (FJ1: before the workshop, so that what the tier opens is trained while it matters), a workshop, a second barracks with money to spare
MOVE betaWalks to a place: done arrived
PATROL betaWalks a round of places for ever, fighting what it meets
PERSONALITIES betaThe engine's personalities: how it likes to play. Over the difficulty, so a rusher rushes on any of them
placements betaThe kit's placement strategies, by name (PlacementName), for a game that wants to call or wrap one
RETREAT betaFalls back to a place: done retreated
SCOUT betaThe id of the scouting's goal
SCOUT_TASK betaLooks at places in turn: done arrived after the last
UPKEEP_SPARE betaThe money free past which the production plan reads no upkeep: what would lie idle else (upkeepSpare)
UPKEEP_TIER betaThe tier of upkeep the production plan trains no further into where its options say none (upkeepTier)
when betaA rule: when(condition).do(action), with once(), every(seconds), priority(n), named(id) between. The condition is a function of the brain or plain data (AiCondition). when.told(word) fires once for each time the word is told, taking it, its action given the word's data

Types ​

NameWhat
AiAction betaWhat a rule does: a function of the brain and, for a told rule, what came with the word; or plain data (AiActionData)
AiCondition betaA condition: a question with a yes or no, as a function of the brain, or as plain data (AiConditionData)
AiConditionData betaA condition as plain data: what a map's file, a mission's JSON or the editor holds. Each form is one question; the table in docs/ai/scripting.md says what each asks
AiConditionTest betaA condition of a game's own or a brain's, for the data form ({ is: id, args }): a map's file names it, the game (GameAi.conditions) or the brain (BrainDef.conditions) gives the code, by an id prefixed as components are (mygame.bridgeDown)
AiFlag betaA flag's value: as data, or worked out by the brain as it is asked (code, not kept in a save)
AiInvariant betaThe name of a rule every computer player keeps (checkBrain): see the table in ai/checks.ts
AiModuleDef betaA module of a brain: made for each brain by a function of it, so that two brains never share one; or one as it is, for a module that keeps nothing. A function made with defineModule carries the module's id before it is made, which is how BrainDef.without names it
AiPhase betaA phase of a think (AI_PHASES)
AiProfileTable betaA difficulty's or a personality's profile, the engine's or a game's
AiRole betaWhat a unit type is for, to a computer player: the engine's roles, or a word of the game's own. A type can have several (a ghoul is a gatherer and a soldier) - worker: gathers and builds; gatherer: gathers (a worker is one too); topper: what is put up on a deposit of the money to gather it there (builtOn) - hall: takes deposits and trains workers; supply: provides supply and trains nothing; barracks: trains soldiers; altar: trains or revives heroes; workshop: researches; tower: a building that attacks; shop: sells or hires - soldier: a unit that fights and is no hero; hero; caster: fights with mana; healer: has an ability that heals; siege: attacks that splash, fell or are aimed at the ground; air: flies; scout: the fastest of the soldiers; detector: finds the invisible
AiWhose betaWhose units a condition counts: the player’s own (the default), its rivals’ in sight, its allies’
AmbushThen betaWhat an ambush does once the fight it sprang is over: return to its place and wait again (the default), stay where it is, or an action (a word it tells itself, { say: 'attack' }, or a function of the brain), done once
BrainExtension betaWhat BrainDef.with adds to a brain: goals, modules, rules and modules left out beside its own, settings over its own, the rest in place of its own
BrainSeat betaHow a brain is seated at a player (BrainDef.seat): the system the seat is, a computer thinking in it. What defineBrain and defineComputer give a brain, so that the core seats it without knowing how
BuildOrderItem betaOne item of a build order: a type to have (one of it), or a type and how many. Counts of a type add up along the order
CaptureData betaWhat the capture task is given
Composition betaThe army a computer player wants, as shares by unit type id or tag (the kit's ranged, melee, hitsAir, a game's own): { footman: 2, rifleman: 1 } is two footmen to a rifleman. A tag's share is split among the types that have it; a type named gets its own beside. Types it cannot train yet are left out until it can
CounterHint betaWhat a game declares a type good against (UnitTypeDef.ai.counters): a tag ('air'), a role ('siege') or a type id, as a word, or with how much it counts (weight, 0.5 when left out: a unit whose whole opponent it counters is worth half again)
CreepData betaWhat the creep task is given: the camp
Curve betaA response curve: a number (how many, how strong, how long) to how much it matters, 0..1
DefendData betaWhat the defend task is given
DefendMemory betaWhat the defend task remembers
EscortData betaWhat the escort task is given
FightData betaWhat a task that fights somewhere is given (attack, harass, creep): a place, or a target (an entity, as it goes), a way round their army (avoid: 'army') or by a place (via)
FightMemory betaWhat a task that fights remembers: its way round, and the worker it hunts (harass)
Force betaA force to weigh: a set of entities as the view gives them (view.enemies.fighters()), a plain array of them, or types with counts ({ footman: 6, gryphon: 2 }), as the knowledge keeps an army it saw (ArmySighting.types, TypeSeen): those are taken at full health with the stats their type starts with
GatherData betaWhat the gather task is given
GoalScope betaWhat a goal is about, and so what it competes with: army goals claim units, economy goals money, squad and hero goals are about one of those (scored once each until squads (C1) and heroes (C2) score them apiece), or a game's own word
HoldData betaWhat the hold task is given
MissionPlace betaWhere a mission's part is: a point, or a name the map or the rules gave an entity (world.named) or a region of the map
MissionTarget betaWhere a wave goes: a place (a point, or a name), or a function of the brain. The nearest building of a rival's it knows of when left out, else the nearest rival it sees, else the first base the seat was told (AiOptions.enemyBases)
MissionUnits betaWhich of its units a part takes: data (MissionUnitsData), or a function choosing from those it may have (available: what no goal holds, and what goals it may take from hold)
MoveData betaWhat the move task is given
PlacementName betaThe kit's placement strategies, by name: nearHome (rings around the place, keeping the way to the mine clear), byResource (on the nearest deposit it is built on: a mine), atEdge (at the edge of the base towards the enemy, for a tower), behind (away from the enemy, for supply), cluster (beside another of its type, barracks by barracks; cluster:<type> beside another type), onLayer:<layer> (where the whole footprint is on a layer of cells the game paints: onLayer:blight for a race that builds on blight)
PlacementStrategy betaA way of finding a spot for a building: the kit's by name, or a function of the game's own. Nothing (undefined) when there is no spot it likes
PlacementTable betaWhich strategy a type goes by (AiOptions.placement, BuildPlanOptions.placement): by type id or by role, a name or a function
RetreatData betaWhat the retreat task is given: where to (home when left out), and why, for the report
RolesFinder betaA game's own way of saying what unit types are for, in place of the kit's inference (AiOptions.roles): every type it has a role for, with its roles and tags. What is declared on a type (UnitTypeDef.ai) still goes over it
RoleTable betaThe roles and tags of every unit type of a game, by type id: what inferRoles gives, and what a game's own AiOptions.roles gives in its place
RoundData betaWhat the scout task is given
RoundMemory betaWhat the scout task remembers
SpellAim betaWhere to use an ability, in code (MicroOptions.spells, by ability id): where (point) and on whom (target), null for not now, undefined to leave it to what the kit works out from the effects. foes are the enemies within the ability's reach of the caster, friends its own and its allies' fighters near it
StopReason betaWhy a goal lost its claim (GoalDef.stop): beaten by one that scored more by the margin, urgent by an urgent one, done as its own score fell to nothing, told by a rule or a module that took its units, removed from the brain
StrengthFormula betaHow strong a unit or a type is, as a number that adds up over a group: the kit's formula (defaultStrength), or a game's own in its place (AiOptions.strength, BrainDef.strength). Given the unit's definition and stats as they stand, the entity where there is one, and the health it has left as a part of its most. Must give a finite number, 0 for what does not fight
TargetPicker betaWho a squad hits, in code (MicroOptions.targets): of the foes in its fight, the one; nothing to leave the units to themselves this time
TaskCommon betaWhat any task may be given beside its own (TaskState.data): the task after it (then), and regroup: false for one not stopped for its stragglers
TaskData betaWhat a task is given, as plain data (TaskState.data): each task says its own shape (defineTask<Data>)
TaskDone betaHow a task ended (TaskState.done): arrived where it was sent, cleared with nothing left to fight where it went, lost its target (gone from sight: killed, or out of it), retreated home after a fight it was losing, wiped with none of its units left; or a game's own word
TaskMemory betaWhat a task remembers of its own, as plain data (TaskState.memory): each task says its own shape (defineTask<Data, Memory>)
WaveTarget betaWhere a wave goes: their base nearest home, their weakest (the fewest towers and army seen there), an expansion of theirs, their army as last seen, a place, or a function of the brain
WorkersPer betaHow many workers a base wants on each resource (EconomyOptions.workersPer): as numbers by resource id, or a function of the base (index 0 is home)