Skip to content

createComputerSystem beta ​

Function of @v12-engine/engine/ai

ts
export declare function createComputerSystem<C extends ComputerPlayer>(world: World, playerId: PlayerId, make: (session: LocalSession, context: BrainContext) => C, options?: ComputerSeatOptions): ComputerSystem<C>;

Seats a computer player at a world: made of a session of its own (it sees what that player sees, and plays through commands, so it cannot cheat), asked to think about once a second. make is handed the session and what a brain takes besides (BrainContext: a seed of its own, the budget, whether the world profiles). Add the result to the world (world.addSystem), or seat through world.computers.seat, which remembers it for a save