GoalDef beta
Interface of @v12-engine/engine/ai
export interface GoalDefA goal: something the computer could do, scored by its considerations, run with what it claims (defineGoal)
Members
claims
claims?: GoalClaims;What it takes to run: units, money. None: it runs on its score alone, holding nothing
commitment
commitment?: number;Seconds it keeps its claim once picked, unless another scores more than it by the margin, or an urgent one scores more at all. The picker's default when left out. Hysteresis: without it two close goals swap every think
considerations
considerations: Consideration[];Its questions: the score is their product (a soft AND: one at 0 vetoes the goal), times the weight
cooldown
cooldown?: number;Seconds after it stops before it may be picked again
id
id: string;Unique among the brain's goals, prefixed as components are (the engine's ai.defend, a game's mygame.raid)
margin
margin?: number;How much more another goal must score to take from this one within its commitment: the picker's when left out
min
min?: number;The score under which it is not picked: the picker's (PickingOptions.min) when left out
run
run(ai: Brain, claimed: Claimed): void;What it does, each think it holds its claim: claimed.first on the first, where its orders are sent once and then watched
scope
scope?: GoalScope;What it is about: army when left out
stop
stop?(ai: Brain, why: StopReason, claimed: Claimed): void;Told when it loses its claim, and why: to let go of what it was doing
urgent
urgent?: boolean | ((ai: Brain) => boolean);Whether it may break another goal's commitment as soon as it scores more: a raid that cannot wait
weight
weight?: number;What it is worth against the other goals at their best: 1 when left out