ViewGround beta
Interface of @v12-engine/client
export interface ViewGroundThe ground as the game's view draws it (GameView.ground): the looks of its tiles and their patterns, the cliffs, the ground's own look, its colours on the minimap and in pictures, the borders between tiles, the layers of cells, and the doodads and scenery on it
Members
cellLayers
cellLayers?: Record<string, CellLayerViewFactories>;How the game's layers of cells (Rules.cellLayers) look, sound and behave on the screen, by id: the parts each is drawn with (CellLayerView), made by the game, or ready-made ones it takes: tall grass over the bushes (foliage), paint on the ground (groundPaint), and its own beside them (gases rising off blight). The client knows nothing of what a layer is; a layer with none is not drawn. Changed in code too (client.cellLayers.set)
cliff
cliff?: TileLook;What cliff faces look like: a texture, or a pattern in a colour (see TileLook). Rock when left out
cliffShape
cliffShape?: CliffShape;The walls of cliffs drawn shaped (CliffShape): each cell of a wall cut detail times each way (4), curved from its foot to its lip, pushed out and in by a noise halfway up (roughness, 0.18 of a cell), the corners of cliffs a quarter of a circle (round). Only what is drawn: units stand, walk and are picked on the grid's heights as before. The grid's two triangles a cell when left out; SHARP_GROUND has the client's (cliffShape: {}). It costs the vertices of the walls: (detail + 1)² a cell of a wall, 25 at 4 (melee's Bay: 1,120 cells of walls, 28,000 vertices; nothing of the frame that can be measured)
cliffStyles
cliffStyles?: Readonly<Record<string, CliffStyleDef>>;The game's own styles of the walls of cliffs, by id (defineCliffStyle): over the client's of the same id (CLIFF_STYLES: rough, strata, columns, boulders, eroded), offered in the Ground editor beside them
colors
colors?: GroundColoring;The colours of the ground where nothing is painted, by height and slope: lush, dry, dirt, rock, a bed under water (GroundColors), or a function of the slope and the height. The client's grass and rock when left out; the ground, the minimap and pictures of maps go by it
decals
decals?: Record<string, DecalLook>;The marks the game lays on its maps' ground (MapDecal), by id: scorches, blood, a road's ruts, runes, each a picture and how a new one is tinted and sized (DecalLook). The editor's Decals palette offers them; the client's ready-made ones are there to take (presetDecals). A map's decal names one of these, or a picture by its path
doodads
doodads?: string[];The models the editor offers as scenery (MapDoodad), by their path in models/. While developing, every model of the game's folder and the shared ones is offered too, and those a map brings
ground
ground?: Partial<TileLook>;What the ground looks like where nothing is painted: a texture drawn as it is, or a pattern laid over the colours of its slope and height. Grass over them when left out
patterns
patterns?: Record<string, PatternDef>;Patterns of the game's own to make a ground's texture of in code (PatternDef), by id: a shade written from a noise with the parameters it declares, or pixels. The Ground editor offers them before the client's, each parameter a slider; a tile's look names one (TileLook.pattern: 'cobbles') and so does a map's own ground (MapTile.pattern.kind)
relief
relief?: number;How deep the ground's pictures stand out as it is lit: each tile's normals tilt the ground's, from its file's normal map where there is one beside it (<texture>_n.png, x right and y up the picture, as most are drawn) or made from its height (heightNormals, the height tiles blend by: a file's lightness or its height picture, a pattern's PatternDef.height). 0 or left out: flat, and nothing more is sampled; 1 as SHARP_GROUND has it. It doubles the ground's samples of its tiles (a normal beside each colour) and the memory of its textures
scenery
scenery?: Record<string, SceneryDef>;What scenery (MapDoodad) of a model gives besides its model, by the model's path in models/: its lights (SceneryDef). Every doodad of the file gives them, placed, turned and scaled with it
sceneryLights
sceneryLights?: (doodad: MapDoodad, declared: readonly ModelLightDef[]) => readonly ModelLightDef[] | undefined;The lights a doodad gives, decided for it: by its name, where it stands, its tint. Its model's (scenery) when it gives back nothing; none for an empty list
textureSize
textureSize?: number;The side of every texture of the ground, in pixels: the client's TEXTURE_SIZE (256) when left out. 512 or 1024 draws files and patterns sharper close up, at 4 or 16 times the memory of the card a layer (1024: about 5.3 MB a layer with its smaller sizes) and the time to make the patterns (about 0.2 s each at 1024, in the ground's worker). A power of two from 64 to 2048. SHARP_GROUND is a preset of it with the ground's other sharpening
tiles
tiles?: Record<string, TileLook>;What the game's tiles look like, by id (Rules.tiles): a colour, a picture, a pattern (the client's, or the game's own in code). Nothing is laid on a tile the game says nothing of; the client's preset (TILE_LOOKS: grass, road, sand...) is there to take
tint
tint?: GroundTint;A tint over many cells that breaks the repeats of the ground's pictures (GroundTint): the ground multiplied by one colour where a large, slow noise is low and another where it is high (drier and greener, the client's), patches of it size cells across (24). Costs a few operations a point, no sample. None when left out; SHARP_GROUND has the client's
transitions
transitions?: MapTransition[];Textures along the borders of the game's tiles (see MapTransition): grass next to sand drawn with an edge of its own. A map's go over these for the same two tiles