Coldwave Read the docs

Coming from Unity#

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

You already think in objects, components and a per-frame update, and you can keep writing C#. What changes is where the game lives: in text files you can read and diff, run by a fixed-step engine that replays every run exactly. This page maps what you know to what Coldwave calls it.

Note. There is no importer for Unity projects yet. You move a game over by hand, or with an AI agent working from these pages: scenes and scripts are rewritten, and your art, models and sounds come across as files.

Scrap Riot, a game first made in Unity, was ported to Coldwave this way, and its recorded play-throughs replay exactly.

What maps to what#

In UnityIn Coldwave
GameObjectA thing: a number with an optional name, made of components (things)
Component (Transform, SpriteRenderer, Rigidbody2D)A component: a small record of fields (Transform, Sprite, Body, Collider)
Your own MonoBehaviour's fieldsYour own component, declared under [components] in game.toml
MonoBehaviour Update and FixedUpdateOne Step(dt) a script defines, called 60 times a second at a fixed step
Start and AwakeOnScene, called when a scene has started
Scene (.unity)A scene: a TOML file of named things and their components (scenes)
PrefabNo prefab asset yet: spawn a thing with its components from a script, or keep a group in a scene
ScriptableObjectA data file a script reads (data("levels/one.toml")), or [tuning] numbers in game.toml
Inspector values tweaked in Play mode[tuning] numbers: change them while the game runs, in the editor or with frost run --set
Input System actions[input] actions and [input.keys] in game.toml, read with Input.Get
Play mode testsA recorded run that frost test replays and holds to a checksum (recorded runs)

What carries over#

  • C# stays C#. Scripts ending in .cs get the same engine calls a Luau script has, and reload while the game runs. See gameplay in C#.
  • 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.
  • Your thinking in components. A thing is what its components make it, as a GameObject is.

What does not#

  • Unity's API. MonoBehaviour, transform.position and Time.deltaTime do not exist. Components come to your Step as columns, and everything else is a call such as World.Find, World.Set or Input.Get.
  • A frame-rate-dependent update. Every step is exactly 1/60 s of game time, so the same input always plays the same game. Do not read the clock to decide anything.
  • Some C# today. C# runs on the desktop only for now; phones are in progress and the web runs Fusion, a subset. A multiplayer game must be written in Luau. See what works today.

The same move, before and after#

A hero that walks left and right, in Unity:

C#
public class Hero : MonoBehaviour
{
    public float speed = 90f;

    void Update()
    {
        transform.position += Vector3.right * Input.GetAxis("Horizontal") * speed * Time.deltaTime;
    }
}

In Coldwave, with a move_x action in game.toml and a thing named hero in the scene:

C#
using Ven;

[State]
public struct Game
{
    public Thing Hero;
}

public static class Main
{
    public static void OnScene(string scene, ref Game game)
    {
        game.Hero = World.Find("hero");
    }

    public static void Step(float dt, TransformColumns transform, ref Game game)
    {
        int row = transform.Row(game.Hero);
        if (row >= 0) transform.X[row] += Input.Get(0, "move_x") * 90 * dt;
    }
}

The [State] struct is what your script remembers between steps: it is saved with the game and put back when a run is replayed, which is why the hero is found once in OnScene and kept there.

Where to go next#