Skip to content

AiOptions beta ​

Interface of @v12-engine/engine/ai

ts
export interface AiOptions

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

Members ​

budget ​

ts
budget?: number | ThinkBudgetOptions;

How much of a think one tick may do (ThinkBudgetOptions): so many of the brain's modules, so many units looked at as they say, a think with more going on at the next tick over the same picture of the game, so that no tick does all of it; and the milliseconds a module is warned over. Counted in work, never in milliseconds, so that the game is the same on every machine. Over the profile's (AiProfile.budget); a number is the modules a tick. Everything in one tick when left out. Data

difficulty ​

ts
difficulty?: string;

How hard it plays (easy, normal, hard, insane, or a game's own: Rules.ai.difficulties): how often it thinks, when it first attacks and how many it sends, how far it comes to defend, how many workers it keeps, how many commands a think, how often it slips, whether it sees through the fog (insane). A layer of the profile (AiProfile): the personality's, the map's and the seat's settings go over it. normal when left out

enemyBases ​

ts
enemyBases?: Vec2[];

Where opponents started. Known to everyone at the start of a game, as in classic RTS games. A brain that goes by what it sees does without

every ​

ts
every?: number;

Seconds between thinks. What the brain says when left out: its profile's (the difficulty's), 1 for a brain that says nothing

goals ​

ts
goals?: GoalDef[];

Goals of the game's own, picked with the engine's each turn (ai.goals): a goal that scores itself from considerations and claims units (defineGoal). A raid on workers, holding a hill, escorting a caravan. Code: not kept in a save; a brain's own goals are (meleeBrain.with({ goals }), Rules.brains)

personality ​

ts
personality?: string;

How it likes to play (balanced, rusher, turtle, expander, harasser, or a game's own: Rules.ai.personalities): the weights of its goals, when it attacks and expands, its towers. Over the difficulty. balanced when left out

roles ​

ts
roles?: RolesFinder;

What the game's unit types are for, found the game's way (RolesFinder): in place of what the kit infers from the definitions (inferRoles); what a type declares (UnitTypeDef.ai) goes over either. Code: not kept in a save

settings ​

ts
settings?: AiSettings;

The seat's own settings (AiSettings, keyed by area: economy: workers: 6 , army: firstAttack: 90 , flags: kite: false ): the top layer, over the personality and the map's (MapAi.settings). Data, but for a flag given as a function

strength ​

ts
strength?: StrengthFormula;

How strong a unit is, in place of the kit's formula (defaultStrength): what odds, matchup, the threat map and UnitSet.strength() are made of. Being code, it is not kept in a save: a brain's own goes in BrainDef.strength