FoliageLook beta
Interface of @v12-engine/client
export interface FoliageLook extends FoliagePartsGrass and bushes over a layer of cells (foliage): tall grass made in code, or the game's own models, swaying in the wind, moved by who goes through them, rustling as they do, and see-through around the player's own units. The look of the whole layer, and of each of its styles over it (styles): a patch of the layer painted with another value looks its own way. Every field is data, so the editor writes it to the game's cellLayers.json (layCellLayers) or to a map (MapEnvironment.bushes); who takes code too.
color, tip, size, sway, shake, tilt and far are the old way of saying colors.foot, colors.tip, sizes.each, wind.sway, walked, rotation.lean and levels: read as ever, the new place winning where one look says both (foliageLookParts)
Members
color
color?: FoliageColor;The colour at the foot of the blades, 0 to 1 each: of the grass, not of models. colors.foot said the old way
density
density?: number;Tufts to a cell, 3 when left out; or models to a cell, 0.7 when left out (a part of one is a chance of one). Fewer on low graphics
far
far?: {
from: number;
to: number;
keep?: number;
};Thinned out with the distance: past from cells from the camera, fewer and fewer tufts are drawn, down to the part keep of them at to cells and past (0.25 when left out), the ones left a little wider to cover what was taken. Every tuft is drawn when left out. levels said the old way (mid, far, farKeeps)
height
height?: number;How tall it stands, in world units: 0.6 when left out for the grass (FOLIAGE_HEIGHT: knee-high to a unit of 1.5, a sixth of a tree; tall grass that hides a unit is about 1.4). A model is sized to it where it is given, and drawn at its own size (its scale) where it is not
leaves
leaves?: string | false;An effect of the view's (GameView.fx.defs) played where one steps into it and now and then as one moves about in it: leaves flying (the ready-made leaves). None when left out
models
models?: BushModel[];The game's own models, drawn as the bushes in place of the tall grass: one picked for each, by weight, turned, sized and leaned a little each its own way. Tall grass when left out or empty
on
on?: FoliageOnTiles;Grass grown from the ground's paint (FoliageOnTiles): on every cell of these tiles that nothing of the layer is painted on, of the screen alone. None when left out: grass grows where the layer is painted, nowhere else
seeThrough
seeThrough?: boolean;Whether it is see-through around the player's own units in it: yes when left out
shake
shake?: FoliageShake | false;How it is shaken by who goes into it (FoliageShake); false for not at all. walked said the old way
size
size?: readonly [number, number];How much each differs in size, the smallest and the biggest of 1: [0.8, 1.25] when left out. sizes.each said the old way
sound
sound?: string | false;The sound of moving through it, by name: none when left out (or false). The client's own rustle, made in code, is 'rustle': named, not given, since grass that rustles under every unit of an army is more than most games want
styles
styles?: Record<number, FoliageStyleLook | false>;The look of each style of the layer, by the value of its cells (1 to 255): what it says over the layer's own, field by field (a group, colors or wind, field by field too), or false for a style nothing is drawn of. A value with none is drawn as the layer
sway
sway?: number;How much it sways in the wind, 0 for none: 1 when left out. wind.sway said the old way
tilt
tilt?: number;How far a model leans each its own way, at most, in degrees: 6 when left out. rotation.lean said the old way
tip
tip?: FoliageColor;The colour at the tips of the blades, 0 to 1 each. colors.tip said the old way
volume
volume?: number;How loud it is, 1 the loudest: 0.7 when left out
walked
walked?: FoliageWalked | false;How it moves as it is walked through, and whether the grass stays down (FoliageWalked); false for not at all