Coldwave Read the docs

Coming from Defold#

Note. The command is ven in today's builds and becomes frost at launch, and so do the names built from it.

Of the engines people come from, Defold is the closest: small games, Lua scripts and messages between objects. Coldwave's scripts are Luau, a descendant of Lua, so most of what you write reads the same. What changes is where state lives and how a game is tested: the engine steps at a fixed rate and every run replays exactly.

Note. There is no importer for Defold projects yet. You move a game over by hand, or with an AI agent working from these pages. Much of your Lua carries over line by line; the calls into the engine change.

What maps to what#

In DefoldIn Coldwave
CollectionA scene: a TOML file of named things and their components (scenes)
Game objectA thing: a number with an optional name, made of components (things)
Component (sprite, collision object, sound)A component: Sprite, Body and Collider, and sounds played by a script
Script properties (go.property)Your own component, declared under [components] in game.toml, or [tuning] numbers
update(self, dt) and fixed_updateOne step(dt), called 60 times a second at a fixed step
init(self)on_scene(name), called when a scene has started
msg.post and on_messagesend("hit", thing, 1) in one script, events("hit") in another
selfComponents on the thing, or the script's state table
go.get_position() and go.set_position()get(thing, "Transform", "x") and set(thing, "Transform", "x", value)
Factoryspawn(...) with the components the new thing starts with
Collection proxyscene.load("level2.toml")

What carries over#

  • Your Lua. Tables, functions, loops and most of your helpers work as they are. Luau adds optional types and a few conveniences such as +=.
  • Messages between objects. Events play the same role, and they are part of the replay: a run that sent an event sends it again, at the same step.
  • Your art. PNG pictures, glTF models with their animation clips, WAV sounds and OGG music. JPEG pictures are not read yet: convert them to PNG.

What does not#

  • self as memory. Keep what the game must remember in components or in state. A plain local is a cache: a reload or a replay does not keep it.
  • One script per game object. Scripts run once a step for the whole game and walk the things they care about with each.
  • Vector math on positions. A position is fields of Transform (x, y, and z in 3D), read and written one at a time.

The same move, before and after#

A thing that slides right at its own speed, in Defold:

Luau
go.property("speed", 90)

function update(self, dt)
    local p = go.get_position()
    p.x = p.x + self.speed * dt
    go.set_position(p)
end

In Coldwave, with Slider = { speed = 90.0 } under [components] in game.toml:

Luau
function step(dt)
    for _, thing in ipairs(each("Slider", "Transform")) do
        local x = get(thing, "Transform", "x")
        set(thing, "Transform", "x", x + get(thing, "Slider", "speed") * dt)
    end
end

Where to go next#