Coldwave Read the docs

Protocol: assets#

The assets commands a program sends to a running game, as the engine describes them: what each takes, what it answers and what it does. Back to all commands.

assets.from#

assets.from {path: text} -> {path: text, note: record, note_file: text, hash: text, came: text, changed: value, by: text, problem: text} · read, read-only

Says where one file of the game came from: its source note (the .from.toml file beside it, which the editor writes when a person keeps a service's result or says where a brought file came from), the file's hash now, and whether it changed since the note recorded it as it came. A file with no note was made by hand. A note that does not parse is a problem here, never a reason the game does not load. The engine never writes a note and never calls a service.

ParametersTypeMeaning
pathtextThe file's path from the project file's folder, as the game names it: art/slime.png.
ResultTypeMeaning
pathtextThe file asked about.
noterecordThe note's fields as written (service, through, model, asked, like, try, seed, made, kept, terms, licence, cost, from, came, changed, by, and any other), a date and time as its text. null when the file has no note or it does not parse.
note_filetextThe note's path, the file's whole name and .from.toml: art/slime.png.from.toml. null when there is none.
hashtextThe file as it is now: sha256: and 64 hexadecimal digits.
cametextThe hash the note recorded of the file as it arrived, or null.
changedvaluetrue when the note recorded a hash and the file no longer has it.
bytextHow it was made: "service", "brought" or "hand": the note's own by, else service when it names one, brought when it says where from, hand with no note.
problemtextWhy the note could not be read, as FILE:LINE: what; null when it was, or there is none.

assets.sources#

assets.sources {} -> {files: [record], unlicensed: [text]} · read, read-only

Lists every file the game loads, in the order an export copies them, with how it was made and its licence as its note says, and the files a service made or a person brought with neither a licence in the note nor the service's terms saved beside it (warning W1410, which frost check and frost export give too; saved terms are enough, since the engine cannot judge them). For the editor's Sources and the export's credits.txt.

ResultTypeMeaning
files[record]{path, by, service, model, licence, terms, noted, changed, problem}: by as assets.from gives it; service, model and licence as the note says, empty when it says none; terms the path of the terms file saved beside it (art/slime.png.terms.txt, or the one the note names), empty when none is there; noted whether a note was read; changed and problem as assets.from gives them.
unlicensed[text]The paths of the files a service made or a person brought with neither a licence named nor terms saved.

assets.cooked#

assets.cooked {path: text} -> {path: text, importer: text, key: text, picture: record, frames: [record], parts: [record], clips: [record], bones: [record], problem: text} · read, read-only

Says what the cook makes of one file of the game, as the game loads it: for a picture its size, for an atlas (a .atlas.toml file) its page and every frame on it, for a model each part with its vertices, triangles and the triangles the cook left out. Cooked through the program's cache when it keeps one, so a second ask finds it there; a changed key says the file was cooked again. A file not cooked yet is cooked by the ask itself: no answer means "not cooked yet". Every field is in every answer, null where it does not apply. A file the cook refuses is still an answer, a success, with problem: never a failed command. A path the game does not load is refused (BadParams), naming the files assets.sources lists.

ParametersTypeMeaning
pathtextThe file's path from the project file's folder, with /, as assets.sources gives it: art/hero.atlas.toml.
ResultTypeMeaning
pathtextThe file asked about.
importertextThe importer that cooks it: "image", "model" or "atlas"; null for a file the game reads as written (a script, a scene, a sound).
keytextThe cache key it is kept under, 64 hexadecimal digits: another key means it was cooked again. null when the program keeps no cache or the cook refused it.
picturerecord{width, height, levels, srgb}: a picture's size in pixels and how many levels it has; for an atlas, its one page (an atlas is one page at most: E0530). srgb is whether it is sampled as a colour (true) or as data, a normal map's numbers (false); a 2D picture and an atlas's page are one level, a colour. null for a model.
frames[record]An atlas's frames, {name, x, y, w, h}: in pixels on its page, x from the page's left and y from its top, downward; in the atlas's order (by name, for patterns). A sprite names one by its name in Sprite.frame. null for what is not an atlas.
parts[record]A model's parts, {mesh, part, vertices, triangles, left_out, material}: each mesh's parts counted from 0; triangles at the whole level; left_out the file's triangles with a vertex twice once welded, which the cook does not keep, 0 when none; material its name, or null; paint what that material is, or null: {base_color, base_color_texture, metallic, roughness, metallic_roughness_texture, normal_texture, normal_scale, occlusion_texture, occlusion_strength, emissive_texture, emissive, alpha_mode, alpha_cutoff, double_sided, uv}, the factors as the model gives them (base_color with alpha and emissive times its strength, in linear light; normal_scale and occlusion_strength 1 where the model says none), alpha_mode "opaque", "mask" or "blend", uv the base colour picture's texture transform {offset, rotation, scale} that every picture of it is read through, each picture by its path in the game when it is beside the model or #N for the model's Nth picture inside it, null for none. A model's whole count left out is the sum over its parts. null for what is not a model.
clips[record]A model's clips, {name, seconds, loops}, from the rig the cook keeps in it (its glTF animations): what a Pose plays, by name; seconds the last key of any channel, loops whether it ends where it began. [] for a model with none; null for what is not a model.
bones[record]A model's bones, {name, parent}: the joints of its skins in the order they name them, parent the joint each is under (null for a root). [] for a model with no skin; null for what is not a model.
problemtextWhy the cook refuses the file, as one sentence with its code first (E0526: ..., E0527 a part left with no triangle, E0530 frames that do not fit a page, E0532 an atlas's pattern that matches nothing); null when it cooks.

assets.picture#

assets.picture {path: text, width: integer, height: integer, yaw: number, pitch: number, distance?: number, clip?: text, time?: number, skeleton?: value} -> {png: png, width: integer, height: integer, view: record, bounds: record, clips: [record], bones: [record]} · read, read-only

Draws one model file of the game alone, off-screen, for an asset viewer: apart from the served game, in a world and on a graphics device of its own, so the game's world, step, checksum, device and what render.passes last counted are untouched, whether the game is stopped or playing. The model is framed to its box at rest unless a distance is asked, seen from yaw and pitch round the box's middle, lit by a fixed plain light (a light that is everywhere at 0.35 and a white sun from the eye's upper left, 40 degrees above and 30 to the side, whichever way the eye looks) in front of a dark grey (1d2027), at a moment of one of its clips when asked (a glTF animation of its nodes: a mesh its node moves is moved, a skinned mesh is bent by its joints), with its skeleton over it when asked. A model is kept while its file and buffers are the same, so a second ask draws and reads back only. A picture (.png) or an atlas (.atlas.toml) is answered as itself (an atlas's page), shrunk to fit inside width and height and never made larger, with view and bounds null. A file that is not one of those is refused in words, as is a clip the model has not.

ParametersTypeMeaning
pathtextThe file's path from the project file's folder, with /: art/hero.glb. Any file of the game's folder, loaded by the game or not.
widthintegerThe picture's width in pixels, 1 to 4096, exactly (a picture or an atlas: the most).
heightintegerThe picture's height in pixels, 1 to 4096.
yawnumberDegrees the eye goes round the box's middle about +y: 0 looks at the model's front (from +z, along -z), 90 from +x.
pitchnumberDegrees the eye is above the box's middle, looking down at it: -89 to 89.
distance?numberHow far the eye is from the box's middle, in the model's units. Left out: far enough that the ball round the box fits the picture both ways, with a twentieth to spare.
clip?textOne of the model's clips by name, as the answer's clips give them. Left out: the model at rest, as a game draws it.
time?numberSeconds into the clip, 0 or more: a time past its end shows its end. Only with clip. Left out: 0.
skeleton?valuetrue: the model's bones drawn over it, a white line one pixel wide from each joint to the joint it is under and a yellow (ffec27) square of 5 pixels on each, as bones answers them; where the model is between the eye and the bone, a third as strong over it, so a skeleton inside a body reads as inside. Left out: false.
ResultTypeMeaning
pngpngThe picture as a PNG file, in base64, as frame.capture gives one.
widthintegerThe picture's width in pixels.
heightintegerThe picture's height in pixels.
viewrecord{at, turn, fov, near, distance, view_projection}: where the eye was ([x, y, z] in the model's units) and how it was turned (a quaternion, x y z w), as frame.capture's eye takes them; fov 40 degrees from bottom to top; the near plane; its distance from the box's middle; and the 16 numbers of the matrix from the model to clip space, as frame.capture's view_projection. null for a picture or an atlas.
boundsrecord{min, max}: the box round the model at rest, [x, y, z] each, which it is framed to (the same at every moment of a clip, so a clip played does not move the eye). null for a picture or an atlas.
clips[record]The model's clips, {name, seconds, loops}, in the file's order: seconds the last key of any of its channels, loops whether it ends where it began (each channel's last key is its first). Empty for a model with none, a picture and an atlas.
bones[record]The joints of the model's skins, {name, parent, at, pixel}, in the order the skins name them: parent the joint it is under (null for a root), at where it is at the moment drawn, [x, y, z] in the model's units, and pixel where that is in the picture, [x, y] from its top left (null behind the eye). Empty for a model with no skin.

Generated from Coldwave 0.0.1 r289, 2026-11-30 by the binary itself: do not edit by hand.