Simulation
Interface of @v12-engine/engine/testing
export interface SimulationA game to play many times (simulate): the rules, the map, who the computer plays and how, and what to count
Members
ai
ai?: (player: PlayerId, world: World) => Partial<AiOptions>;How the computer plays a player, over what it is given (enemyBases: where the others start)
brains
brains?: Record<number, BrainDef | string>;The brain each player is played by, or its id (one the game lists in Rules.brains, or the engine's core.melee): two brains against each other, for a balance run. A player not named here is played by the first brain the game lists
computers
computers?: PlayerId[];The players the computer plays: every player of the map with a start, the creeps apart, when left out. One left out is the game's own (start) to move, or stands
difficulties
difficulties?: Record<number, string>;How hard each player's computer plays, by name ('hard'): under what ai gives. The seat's own when left out
map
map: GameMap;The map each simulated game is made from
measure
measure?: (world: World) => Record<string, Counted>;What to count at the end of each game, by name: units alive, gold gathered, the hour
onStart
onStart?: (world: World) => void;What the game does once a world is made, before the first tick: units of its own, a rule turned on
rules
rules: Rules;The game module's rules each simulated game is played with
seconds
seconds?: number;Seconds of the game at most: twenty minutes when left out
until
until?: (world: World) => boolean;Whether the game is over before that: once there is a winner, when left out