Skip to content

AiReport beta ​

Interface of @v12-engine/engine/ai

ts
export interface AiReport

What 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)

Members ​

brain ​

ts
brain: string;

The brain's id (core.melee)

budget ​

ts
budget?: ThinkBudgetOptions & {
        ticks: number;
    };

How much of a think one tick may do, where its budget slices it (ThinkBudget), and the ticks its last think took. Left out where a think is one tick

decisions ​

ts
decisions: AiDecision[];

What it decided, the last fifty, oldest first

defence ​

ts
defence?: DefenceReport;

The raids on its bases with what answers each, every base's raids so far, the towers it wants (DefenceReport)

economy ​

ts
economy: {
        resources: Record<string, number>;
        income: Record<string, number>;
        supply: [used: number, cap: number];
    } & Partial<EconomyReport>;

What it has to spend and how it comes in: its resources, its income a minute, its supply; and its economy's say (EconomyReport): each base with its workers on each resource against what it wants and what is served, the workers that fled a raid, the workers had against wanted, where the next hall stands

goal ​

ts
goal?: string;

The goal that scored highest above the minimum this think: what the army is on. None when nothing is worth doing

goals ​

ts
goals: GoalReport[];

Every goal as the picker last saw it: its score, each consideration's raw and curved value, what it holds, why not

held ​

ts
held?: number;

Commands it would have sent its last think past what its profile lets a think send (commandsPerThink)

knowledge ​

ts
knowledge?: KnowledgeReport;

What it remembers of the enemy: left out by a brain that keeps no knowledge

micro ​

ts
micro?: MicroReport;

Its fights: each squad in one and whom it hits, the units that fled, its heroes and what each learns next, who shops for what

paused ​

ts
paused?: true;

Whether it sits still (world.computers.pause)

plans ​

ts
plans: PlansReport;

Its plans: the purse (what is free, promised, held), and every want of the build plan with what it waits for

player ​

ts
player: PlayerId;

The player it plays

playing ​

ts
playing?: AiProfile;

What it plays by (Brain.profile): the profile resolved, layer over layer; code (a flag's function) left out

profile ​

ts
profile: Record<string, unknown>;

What it was seated with: the data of its options (AiOptions: the difficulty, the numbers); code left out

roles ​

ts
roles: Record<string, string[]>;

The roles it found among the types it can make: { worker: ['peasant'] }

scouting ​

ts
scouting?: ScoutingReport;

Its plan of looks with how long since each was in sight and whether it is due, its scout and where it goes (ScoutingReport)

sections ​

ts
sections: Record<string, unknown>;

What each module says of itself that the report has no part for (AiModule.inspect), under the module's id

sent ​

ts
sent: number;

Commands it sent its last think

squads ​

ts
squads: SquadReport[];

Its squads: whose each is, its units and their strength, where it is, its task and how it goes, its last change

stats ​

ts
stats: AiStats;

What its play adds up to since it was seated (AiStats): commands, idle army seconds, churn, seconds blocked on money

team ​

ts
team?: TeamReport;

Its team: the computers of it, the requests on its board, the plan of an attack together (TeamReport)

thinks ​

ts
thinks: number;

How many times it has thought

threat ​

ts
threat?: ThreatReport;

Where the strength is, as its threat map read it last think (ThreatReport): what the AI overlay draws as heat

tick ​

ts
tick: number;

The tick of its last picture of the game

tickRate ​

ts
tickRate: number;

Ticks a second: what turns a decision's tick into the game's time

time ​

ts
time: number;

Seconds into the game, as of its last picture

timing ​

ts
timing?: ComputerTiming;

Milliseconds its thinks take, for reading only: the last, an average, the longest, and by module while the world profiles. Given by the seat (inspect of the player), which times the thinks

told ​

ts
told: {
        word: string;
        tick: number;
    }[];

The words the game told it that no module has taken yet

v ​

ts
v: 1;

The version of this shape

waves ​

ts
waves?: WavesReport;

Its waves: the one whose turn it is, its group as it stands and when it may go, the waves sent (WavesReport)