Coming from Unity#
Note. The command is
venin today's builds and becomesfrostat 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 Unity | In Coldwave |
|---|---|
| GameObject | A 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 fields | Your own component, declared under [components] in game.toml |
MonoBehaviour Update and FixedUpdate | One Step(dt) a script defines, called 60 times a second at a fixed step |
Start and Awake | OnScene, called when a scene has started |
Scene (.unity) | A scene: a TOML file of named things and their components (scenes) |
| Prefab | No prefab asset yet: spawn a thing with its components from a script, or keep a group in a scene |
| ScriptableObject | A 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 tests | A recorded run that frost test replays and holds to a checksum (recorded runs) |
What carries over#
- C# stays C#. Scripts ending in
.csget 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.positionandTime.deltaTimedo not exist. Components come to yourStepas columns, and everything else is a call such asWorld.Find,World.SetorInput.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:
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:
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#
- Install
frost, then make your first game. - Gameplay in C#: columns,
[State]and what C# cannot do yet. - C# or Luau?: how to choose.