Changelog, part 7#
project.addandfrost add scene|script NAMEadd a scene or a script to a game: the file is written from the engine's stub and named in the project file'sscenesorscripts, the project file edited in place with its comments kept.E0446(new) when the name is taken, is not a plain path, or is outside the project. It is the one command that writes a project's files, in the trusted class. Nothing a game does changed.- A number kept in
statethat is not finite reads as"Infinity","-Infinity"or"NaN"inscript.state,save.listandfrost run --state, where all three werenull. Nothing a game does changed. frost run --setloads the game once, with the values in place, where it loaded it, set the values and loaded it again: the top of each script runs once (oneprintWorld.Printwhere there were two), and what a script saves as it loads is saved once. The run itself, and its checksum, are as before.bit32.mul(a,andb) math.roundeven(x), for code ported from C, C# or JavaScript: the product of two 32-bit words wrapped as C wraps it (wherea * bpasses 2^53 and drops low bits), and rounding with halves to the even whole number (math.roundtakes them away from zero). Nothing a game does changed.session.handssays what each hand last ran, and where its code changed:last_run {to_step, checksum, matches_replay, n}for a run to the end of the recording (matches_replaytrue or false only where nothing but the recording moved the game, else null),lineon a script.reload'slast_change, andtag, the editor's own name for a hand's task (session.hello {tag},frost mcp --join --tagorFROST_HAND_TAG). A joinedfrost mcpthat sees its session end exits with status 2, as every error offrostdoes. Nothing else changed.frost test --says PART[@STEP]... [--against REV] [--json]holds a change to what it said: the game on disk may differ from the game at REV (HEAD) only in the parts said, asworld.checksumnames them, each from its step on, and a changed shot only where a said part differs. Without a repository, a change or areplayit says so (E0523). Nothing else changed.- An agent can act on the game the editor shows:
frost mcp --join 127.0.0.1:PORT --token-file PATH [--who NAME]serves the same MCP tools for a session that runs already (frost serve --port 0 --stdio,frost dev) in place of a game of its own. It saysE0521when it cannot join andE0522, and exits, when the session ends. - A connection says who it is, and blame names it:
session.hello {who, kind, model?}makes the connection a hand (an MCP client'sinitializedoes it by itself), andsession.handslists them with what each last did and who moved the game's step last (clock). Blame answers a client writer withhand,whoandagentbesidetrust: hand 0, "a client", for a connection that never said. No checksum moves. [export] credits = "full"ships the source notes with the game: each.from.tomlnote and.terms.txtfile goes beside its file undergame/, as well ascredits.txt. Left out, or"file", onlycredits.txtis written, as before. They are no part of what the web page downloads.[export]is a new table of the project file; any other value ofcreditsisE0408, with its line.- Source notes:
assets.from,assets.sources,credits.txtandW1410. A file of the game can have a note beside it,NAME.EXT.from.toml, saying which service made it, with which words and under which licence, and the service's terms asNAME.EXT.terms.txt; the editor writes them, the engine only reads them.assets.from {path}answers the note, the file's SHA-256 (sha256:…) andchangedwhen the file is no longer what the note'scamerecorded;assets.sourceslists every file the game loads and theunlicensedones.frost exportwritescredits.txtbeside the game when any file has a note, and warnsW1410(new) of a file a service made or a person brought with neither a licence named nor terms saved, asfrost checkandgame.checkdo; they also warnW1411(new) of a note whose file is gone. The notes are not copied into the exported game. Nothing changed for a game with no notes. frost check --costsandfrost exportsay what a game's files cost a download: the bytes as exported and with gzip, by kind (pictures, sounds, fonts, scripts, scenes), the five largest, and where a saving is known, one line: a picturefrostwould write smaller with the same pixels (exact), or a WAV sound of ten seconds or more as Ogg Vorbis formusic.playMusic.Play(an estimate, with the web player's decoder counted). Nothing is re-encoded.frost check --costs --jsonadds the object ascoststo the line it prints:{bytes, gzip, kinds, files, largest}. Nothing else changed.- Pictures
frostwrites are smaller, with the same pixels. A frame of at most 256 colours (frost run --shotand--frames,frost check --shots --write-shots,frame.capture) is written as a palette PNG (colour type 3, withtRNSwhen a colour is see-through) instead of eight bits a channel: the test games' 61 shots went from 648,555 bytes to 466,920, and those kept in the examples'shotsfolders were written again from their own pixels. A frame of more colours is the same file as before. A tool that reads these files with a PNG library that does not expand palettes must ask it to (thepngcrate:Transformations::EXPAND | Transformations::ALPHA); browsers, image viewers andfrost check --shotsread both. profile.steps {totals: true}adds up a stretch of the game: every span of the steps whose spans are kept, each place in the tree once, ms and count summed, with the first and last step added and how many. Nothing else changed.profile.stepssays where a step's time went, down to the line of a script: each span of a step's record hasparent, the index of the span it ran inside, andat, where in a script it is. Insidescript NAMEare itsstep()Step()andon_scene()OnScene(), and inside those each engine call they made whose cost depends on the world (findWorld.Find,each,spawnWorld.Spawn,despawnWorld.Despawn,eventsEvents.Read,tweenWorld.Tween,library,physics.rayPhysics.Ray,physics.castPhysics.Cast,physics.overlapPhysics.Overlapandsave's), added together per line that called it.profile.frameandprofile.framesadd the places of one name together, so they liststep()Step()and those calls by name too. Timing a call costs a tool about 55 ns (a game made to calltweenWorld.Tween2,000 times a step steps about 5 % slower underfrost dev,frost serve,frost runandfrost bench); an exported game times nothing. No checksum changed.game.restoresays what it does not undo:edits_after, the steps of a client's changes made after the snapshot (a write to the world,scene.loadScene.Load,saves.set,debug.evaluate), which playing on with the same input does not make again, andcode_changed, the scripts reloaded since, which run as they are now.input.historylists the changes on the game's line of time asedits. Nothing a game does changed.world.seriesreads a field's value over a stretch of the recording:{entity, component, field, from?, to?, buckets?}answersvalues, one{step, value}a step (at most 3,600), or withbuckets: Nthe{from, to, min, max, last}of N stretches, andplayed_from. It plays the stretch again aside and changes nothing of the game.game.seekgoes back by keyframes. A seek to a step behind the game used to load the files and play from step 0; it now puts back a moment the session kept on an earlier seek (one every 300 steps) and plays on from there, where that makes the same game, and loads as before where it might not (a changed file, ascript.reload,tuning.setorblame.onsince the load, a debugger attached). What a client sees differently: the session's snapshots survive such a seek (a load forgot them),events.sincestarts at the keyframe and not at step 0 (fromsays where), and a game that keeps state in a script'slocalgets warningW0445once and is loaded as before.game.seekanswerskeyframes:{every, kept, bytes, most_bytes}.frost play DIRplays a folderfrost export webwrote: it serves the folder as it is on 127.0.0.1 and printsserving http://127.0.0.1:PORT/, with the media types and refusals offrost dev --web, and no protocol, no reload and nothing written. A folder without the page, both players andgame/is refused (E0520, new). Nothing else changed.frost new --listnames the templates for a program: one a line, the name, a tab and theaboutline of itstemplate.toml, in the order of their names. A downloadedfrostwith no templates beside it says where they belong in one sentence (E0519, where it saidE0515with "no templates were found", and no longer looks in atemplatesfolder of the current folder), and--listthen prints nothing and exits with status 2.frost new --helpsays the same.frame.capturesays which part of the world its picture shows:view,{left, bottom, right, top}in world units, asframe.viewgives it. Nothing else changed.world.insertandworld.removeput a component on an entity of the running game and take one off, and the entity keeps its id: what an editor's "Add a part" and "Remove" send. An insert is held to whatworld.spawnis held to. A remove takes the tweens of the component's fields with it, and is refused with the code that says why when something else needs the component: a joint that holds the entity by itsCollider(E1111), aTileColliderbeside itsTilemap(E1107), a node in it (E1301). A script then sees the entity as any that lacks the component:hasWorld.Hasis false andgetWorld.Getof it stops the step withE0003. Neither writes a file.- Each of the engine's components says what it is, in a sentence:
world.componentsgives it as the component'sabout, where it was null, andfrost reference --typesas the comment above its type. It is a row of its own above the component's fields in each crate's reference table, with the field cell empty, asScreen's was; the pagefrost referenceprints leaves those rows off, but forScreen's, to stay within its budget. Nothing a game does changed. - A
Tweenthat would stop every step is refused before the first: one whosecomponentorfieldis empty (E1004, new), whose field holds no number (E1003) or whose easing is not one (E1002). A scene file with one fails to load andfrost checksays which, andworld.spawnmakes no entity; before, the game loaded and stopped at a step. A tween a script makes withtween()World.Tween()is as it was. profile.stepskeeps an hour of step times, and a replay hides nothing played. Each step is kept by its number: where its time went for the last minute, its time for the last hour (an older step is told withspans: null). A step the engine plays again to reach another (game.seek,blame.on) no longer writes over the same step as it was played, though it gives an older step's spans back, and agame.tryfrom a kept moment keeps nothing.stepsrows sayreplayed, a list is of the last minute unlessfromsays otherwise, atopast the game's step tells the steps still kept there, andkeptis now a record of what is held ({spans, steps, bytes, bytes_per_span, bytes_per_hour}), where it was a number.buckets: Ncuts a range of any length into N stretches with the slowest step of each.- A turned thing's hit has its outline, and
frame.viewsays what the frame shows. A hit offrame.at,frame.inandblame.pixelhasturnedbesidebox:{x, y, w, h, angle}, the box along the thing's own sides in the frame's pixels and its turn in degrees, or null for what is not turned.frame.viewanswers the frame's size and the part of the world it shows,{left, bottom, right, top}in world units, as the camera looks. Nothing else changed. Mover.stepis new: the highest ledge a mover walks up onto, 0 when left out, so a game that does not write it plays as before; the checksum of a game with a mover moves once, the field being new in each. The numbers on softness and swing moved from the scripting reference todocs/physics.md.Collider.surfaceis new: a belt's speed. A game that does not write it plays as before; the checksum of a game with colliders moves once, the field being new in each.- A game has the physics' components only when it has the physics, and
Fontonly with a[fonts]table or aFontin a scene. A game has the physics when its project file has a[physics]table or one of its scenes gives an entity aBody,Collider,TileCollider,MoverorJoint. Scripts are not read to decide it: a game whose scripts make colliders in scenes that have none must add[physics](an empty table will do) togame.toml; without it the script's first use stops with the unknown-component error, which says so. No recorded game's checksum moves and none of the test games or templates needed the table.world.componentslists fewer for a game without them, and a client naming one there is refused (E0415) with the same advice.frost exportlinks the physics by the same rule. - A field can say that its text names an entity, and
frost checkwarns when it names none (W0436). A game marks its own in the project file as{ entity = "" }; the engine's are marked:Node.parent,Node.up,Node.down,Node.left,Node.right,Slider.fill,Slider.label,Choice.label,Toggle.mark,Bar.fill,Joint.fromandJoint.to.world.componentsreports"role": "entity"for such a field. The warning is new for games that already had a focus neighbour that is not there, or, in a scene the game does not start in, a parent, a part or a joined body that is not there. It reads the scene as its files say: an entity a script spawns later is not seen. No value and no checksum changed. profile.stepssays what each step took: the time of each of the last 3,600 steps, and the slowest of a range with where their time went (each stage, each script, the picture drawn of the step). It is kept infrost dev,frost serveandfrost mcpwhether or not anybody asks, at about a tenth of a microsecond a step; an exported game keeps nothing. No checksum and no frame changes.- A hit of
frame.at,frame.inandblame.pixelhas itsbox:{x, y, w, h}in the frame's pixels, around everything the entity draws with that component, so a tool can outline a sprite drawn at its picture's own size. Nothing else changed. - A failing shot in
frost testsays where the game changed. When the run holds and a picture does not, and the folder has changes git has not committed, the line leads with the first step and value that differ from the committed game, as a failed checksum does; when the world is the same at every step it says so and names the files that changed. frost checkwarns of a script variable a snapshot does not hold (W0309): alocaldeclared outside a script's or a library's functions that a function writes, or writes a field of, with the line of the first write. Such a game goes wrong aftergame.restoreandgame.try, whichfrost test --restorefinds by running it; move the variable intostate. The game loads and runs as before. The platformer and the brick breaker templates kept their tilemap that way; they now read it once a step intostate.landand take it out when the step ends, on the same checksums.- A failing
frost testsays the step, the value and the line. When the game's folder is in a git repository and has changes that are not committed, the failure is: "FAILED: at step 131 ball.Transform.x is 131.5 and was 131.0; last written by script go.luau:5 in step. That is the first step that differs from the game as committed (git HEAD a1b2c3d)." The two checksums are not printed then. The committed files are played in memory beside those on disk; nothing is stored, and a game that passes is not played twice. Without git, or with nothing changed since the commit, the message is the one it was. frost testfails a game that cannot be put back to a snapshot. It plays one stretch of the recording twice (from the checkpoint nearest the middle to the next, put back from a snapshot in between) and both times have to come to the same worlds. A game that kept part of what it is in a script's own variable (alocaloutside its functions) passed before and fails now, with the step and what to do: move it intostate.frost test --restoredoes the same at every checkpoint.frame.atandframe.insay what is drawn at a pixel and inside a box of the frame, the one in front first, with no blame on and no picture taken: what an editor asks to pick the thing under the pointer.blame.pixelanswers the same hits with who made and placed each, so its hits have four fields more (tile,node,coverage,fills); nothing it answered is gone.- A node with a
Textand noworhhas the size of its words, where before it was a point. One anchored by its middle is where it was; one anchored by an edge (Anchor = { y = 1, dy = -14 }) now has that edge of its words there, not their middle: movedxanddyby half the text's size. In a stack it takes its room, and a press on it is the interface's (Node = { pointer = false }lets it through). - A
StackorGridwith noworhis as big as what is shown in it: before, it was a point and its nodes hung from that. Write the size for the old layout. Anchor.stretch_xandstretch_yare read in a stack and a grid: a node stretched across its stack fills it, those stretched along it share what is left, and one in a grid fills its cell. Before, both were ignored there.- A fill node with an
Anchor.dxkeeps that much clear at both ends of its slider or bar: before, only at its left, and a full bar ran past the right end bydx. - A tween of the
Transformof a node the interface places is an error (E1306): before, it did nothing. TweenAnchor.dxordy,ScaleorOpacity. - The pointer uses a button, a choice or a toggle when it lets go on it, not when it presses: sliding off first cancels. A recording made with the pointer sends its events as many steps later as the press was held, and one that pressed here and let go there no longer uses anything. Keys and a gamepad are as they were.
- The focus is remembered. A screen that is hidden and shown again has the focus where it was left, and when a modal node closes the focus is back on the node that had it; before, both went to
[ui] start. A modal node still opens onstart. For the old behaviour callui.focus(find("play"))Ui.Focus(find("play"))when showing the screen.
Generated from Coldwave 0.0.1 r335, 2026-11-30 by the binary itself: do not edit by hand.