Skip to content

KnowledgeOptions beta ​

Interface of @v12-engine/engine/ai

ts
export interface KnowledgeOptions

How 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

Members ​

army ​

ts
army?: (entity: EntityState, view: AiView) => boolean;

What of the enemy's units in sight counts as their army: their soldiers and heroes (UnitSet.fighters) when left out

armyFor ​

ts
armyFor?: number;

Seconds a sighting of the enemy's army, or of a worker, is kept: 180

historyEvery ​

ts
historyEvery?: number;

Seconds between samples of what was gathered, for own.income: 5

keepFor ​

ts
keepFor?: number;

Seconds a structure seen gone is still remembered as gone, and an event, a loss or an attack sent is kept: 300

limits ​

ts
limits?: Partial<Record<'sightings' | 'workers' | 'heroes' | 'structures' | 'lost' | 'events' | 'attacks' | 'history', number>>;

At most so many of each: sightings 12, workers 40, heroes 16, structures 400, losses 64, events 48, attacks 20, samples 36

mergeRadius ​

ts
mergeRadius?: number;

How near two groups of enemy fighters are to be one sighting, and a newer sighting to replace an older: 16