Skip to content

WarmWhat beta ​

Interface of @v12-engine/client

ts
export interface WarmWhat

What a warm-up makes ahead (client.warm, GameView.world.warm). Left out, each is as WARM_DEFAULTS says: the unit types on the map, in their owners' colours, the model each is drawn with up close, as many copies as there are of it (4 at most), and the transitions' pass

Members ​

colors ​

ts
colors?: 'owners' | 'players' | readonly (PlayerId | Rgb)[] | ((player: PlayerState) => boolean);

The players' colours each unit type is warmed in: owners (the colours of the players who have units of the type on the map, or every player's where none does: the default), players (every player's but the neutral's), a list of player ids or colours, or a test of each player. A model whose material has no cells in the player's colour is one material whatever the colour: one copy of it serves them all only where it is the colour asked

copies ​

ts
copies?: 'map' | number;

How many copies of each unit type, colour and level are built and kept for the units that come up close to take (they are let go of past 24): map (as many as there are units of it on the map, 4 at most, 1 at least: the default), or a number. One compiles the shaders; the rest spare the frames the build of each

fx ​

ts
fx?: 'all' | WarmPick<string>;

Effects by id (GameView.fx.defs, client.fx), all, or a test of each id: each played once behind the loading screen, its particles' shaders compiled, its meshes' materials too, and drawn by the view's piece so that the pipelines its draws need are made (WebGPU makes one as a draw first needs it: an effect not warmed stops the frame of its first cast for them); then stopped, its systems put back in the pool. In the background (the game running) or without the view's piece, stopped before a frame draws it. None when left out

levels ​

ts
levels?: 'near' | 'all' | readonly number[];

Which of a unit's levels of detail are warmed (ModelDef.detail, GameView.world.detail): near (the model it is drawn with up close, the default), all (each level drawn with a model whose file has loaded), or levels by index (0 the nearest). A level of a model made in the page, a picture or nothing is skipped

materials ​

ts
materials?: WarmPick<string>;

Materials of the scene (or their names) compiled on the meshes that draw them, or a test of each: one made in code that nothing draws yet is compiled on a plane of its own, let go of after

models ​

ts
models?: readonly (string | ModelDef)[];

Models by file or as said (ModelDef), drawn as shared meshes (the scenery's, the buildings', copies of one mesh): their mesh built and compiled, in no player's colour. A model of the map's scenery is compiled before the game starts anyway (client.prepare); this is for one that comes later

transitions ​

ts
transitions?: boolean | readonly string[];

The transitions between a cinematic's shots: true (the cut's pass and its copy made ahead: the default), transitions by id (a game's own with a mask or a pass of its own, its pass made too), or false. A cinematic that starts makes the cut's ahead anyway

units ​

ts
units?: false | 'map' | 'all' | WarmPick<string>;

The unit types whose copies are built and compiled: map (the types of the units on the map, units when left out), all (every type whose model has loaded), a list, a test of each type, or false for none. A type whose model has not loaded is skipped (not loaded)

view ​

ts
view?: boolean;

The view drawn behind the loading screen, as the camera starts, again until a drawing makes no shader that is not there: what the first frames draw that nothing else made (the ground and the water in their variants, the crowds' copies as they are drawn, the picture's passes). With priority: 'block' only: in the background the frames draw it anyway. Yes behind the loading screen when left out (GameView.world.warm); in code (client.warm), where the game's frames are drawn too, only when asked