Skip to content

CreateWorldOptions beta ​

Interface of @v12-engine/engine

ts
export interface CreateWorldOptions extends WorldChecks

What a new world is made from: terrain, rules, players, seed and navigation

Members ​

components ​

ts
components?: readonly Component<unknown, unknown>[];

Components the app keeps in the world beside the game's own (Rules.components): what is the app's, not the game's rules (where the screen is played from, a tool's own; Component.portable false). Its game's and the engine's when left out: one neither lists is an error (UnlistedError)

log ​

ts
log?: Logger;

The logger the world's own is made under (world.log): a server's, a page's. The root one when left out

ts
navigation?: GameNavigationOptions;

Options for how the world's units find their way, over the game's (Rules.navigation)

onError ​

ts
onError?: ErrorPolicy;

What becomes of a part of the game that throws, where the game does not say (Rules.onError)

players ​

ts
players: PlayerInit[];

The players of the world, in order

randomRaces ​

ts
randomRaces?: readonly string[];

The races one is drawn from for a player given random (PlayerInit.race): all of the game's when left out

rules ​

ts
rules: Rules;

The game's rules the world runs

seed ​

ts
seed?: number;

Seed of the world's random numbers: the same seed gives the same game; 1 when left out

terrain ​

ts
terrain: Terrain;

The terrain the world stands on

tickRate ​

ts
tickRate?: number;

Simulation steps per second: 30 when left out. A save made at another rate is refused (loadWorld), so a game that changes it starts new games