Skip to content

KnowledgeMemory beta ​

Interface of @v12-engine/engine/ai

ts
export interface KnowledgeMemory

What 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

Members ​

army ​

ts
army: ArmySighting[];

Newest first

attacks ​

ts
attacks: AttackSent[];

The attacks a module sent

damage ​

ts
damage: DamageSeen[];

The damage seen in the last thinks

deaths ​

ts
deaths: DeathSeen[];

The deaths seen in the last thinks

gathered ​

ts
gathered: Record<ResourceId, number>;

What was gathered of each resource since the game began, as far as rises in what the player has tell

had ​

ts
had?: Record<ResourceId, number>;

What the player had at the last update, to see the next rise against

heroes ​

ts
heroes: UnitSeen[];

The enemy heroes last seen

history ​

ts
history: {
        tick: number;
        gathered: Record<ResourceId, number>;
    }[];

Samples of gathered, oldest first

looked ​

ts
looked: {
        cols: number;
        rows: number;
        ticks: number[];
    };

The tick each cell of the map was last in sight, row by row (-1: never); cols cells a row

lost ​

ts
lost: Loss[];

The own things that died, newest first

pings ​

ts
pings: PingHeard[];

The pings heard

structures ​

ts
structures: StructureSeen[];

The enemy structures remembered

tick ​

ts
tick: number;

The tick it was last brought up to date

types ​

ts
types: Record<string, TypeSeen>;

The enemy unit types seen, by type id

v ​

ts
v: 1;

The version of the memory's format: 1 so far

workers ​

ts
workers: UnitSeen[];

The enemy workers last seen