Molten

Devtools (the editor)

molten-devtools is Molten's editor: a native desktop app (Dear ImGui) that draws your level with the real renderer. It works like a normal engine editor with two modes:

  • Edit: shows the open level as written in its files. No game is running. Changes are written straight to the .chunk and .object files and can be undone.
  • Play: launches your game as its own process and window, and mirrors it live. The editor keeps its own free camera; Inspector edits change the running game.

Devtools never loads your gameplay code into itself, so a game crash can't take it down.

The welcome screen

Start devtools with no folder (dev-run, or molten-devtools alone) and it opens on the welcome screen:

  • New project... (Ctrl+Shift+N) picks a template, a name and a location, creates the folder and opens it in Edit mode. Templates: Empty (one level with ground, a sun, a camera and a cube turned by a starter Cast behavior), four playable starters, and copies of the Spin, Physics Yard, Render Yard and Gridline samples. The project folder is the name in lower case with spaces as dashes (My Game goes to my-game); game.toml gets the name you typed. New projects go to Documents/Molten unless you choose another place.

    Starter Controls
    First Person WASD to move, click the game to capture the mouse for look, Tab to release it, J to jump
    Third Person WASD or arrows to move with a follow camera, J to jump
    2D Top Down WASD or arrows to move around an overhead arena
    2D Side Scroller A/D or left/right arrows to move, J to jump onto platforms

    The 2D starters use fixed-angle perspective cameras and constrain movement to a plane.

  • Open folder... (Ctrl+O) opens any game folder (one with game.toml).

  • Attach to a running game... lists games connected to the dev server and attaches to one, as in the Game instances section below.

  • Recent projects shows when each was last opened. Click to open; right-click to show it in the file manager or remove it from the list. The search box filters by name or path.

  • The strip under the list shows games already running with the dev link on, with Attach.

File > Close project returns to the welcome screen (it stops Play first). File > New project... works from the editor too.

Opening a project

dev-run path/to/mygame                        # build the tools and open the folder
molten-devtools --game path/to/mygame --level yard

Or use File > Open folder (Ctrl+O) or File > Open recent. Devtools opens the level the game starts in (the first screen's level), unless you pass --level. Level lists the project's levels; pick one to edit it.

To know your components, devtools runs molten-game --game DIR --dump-schemas FILE in the background when the folder opens and whenever Cast or native/ sources change.

The layout

Area What it does
Title bar The menus, the project (click for the Game instances menu) and the window buttons. Drag its empty parts to move the window; double-click to maximize; Windows snapping works
Toolbar Tool (Move / Rotate / Scale), World or Local axes, grid snapping, the snap settings (click the step: move, rotate and scale steps, typed or picked; remembered), surface snapping, Play / Pause / Step, time scale
Hierarchy (left) Search and + (place an object, or a new level, object type or UI). The screen stack, then the open level with the objects it owns; parts nest under their owner. Runtime-spawned objects are in italics; objects spawned with no level loaded are under "Not in a level"
Viewport (center) The level, drawn by the Molten renderer, with gizmos. Cameras, lights, the sun, sounds and other objects with nothing to see get editor-only icons (click one to select it; View > Editor icons hides them). The ? in the corner lists the controls
Inspector (right) The selected object's components, editable. Shows where the object comes from (Crate · objects/crate.object). Fields set by the level rather than the type are blue; changed-but-unsaved fields get a dot. With the level row selected: the level's settings
Bottom dock Tabs: Console, Assets (with a texture preview), Objects, Timeline (and Tracks, later). View > Dock tabs chooses which are shown
Status bar The project and git branch (click to open its folder), the open level, Edit or Live, unsaved live edits (click to save), the dev server, and message / warning / error counts (click to open the Console)

Level settings: sky, sun and ambient light

Click the level's row at the top of the Hierarchy (main.level). The Inspector shows the level file's settings:

  • Skybox: an equirectangular .hdr under assets/ (put one there first), or none.
  • Sun: on or off, its direction, color and intensity. The sun is a directional light with shadows that the level owns.
  • Ambient light: the color that lights surfaces nothing else lights.
  • Chunk size and the number of spawn points.

Edits write levels/<level>/<level>.level (Ctrl+Z undoes them) and the viewport updates at once. Stop the game to change them. Richer sky, fog and post effects are components (environment, postProcess) on an object, edited in the Inspector like any other.

New levels, object types and UI

File > New level... (Ctrl+N) creates levels/<name>/<name>.level with a sun and ambient light plus an empty chunk, and opens it. File > New object type... creates objects/<name>.object, empty or starting with a mesh, a point or spot light, a camera or a sound; it appears in the Objects tab right away. File > New UI... creates ui/<name>.ui and ui/<name>.style; add it to a screen's ui list to show it. Each is one Ctrl+Z step. The Hierarchy's + offers the same.

Project settings

File > Project settings... (Ctrl+,) edits game.toml: the game's name, window title, first screen and highest graphics tier (Apply writes the file and keeps its comments). It also has the viewport's graphics quality preview (Low is the M16 look; saved for you only), the project folder with an Open button, and the git branch.

Graphics preview (M20). The viewport renders at the game's graphics tier: a game with graphics = "cinematic" shows ray-traced global illumination from its giVolume when this GPU traces rays. The Lit button's menu has a Graphics section to preview Cinematic, Standard or Low, and View > GI probes draws the volume's probes (lit by what each one sees; red ones are inside geometry and turned off). The stats overlay shows the GPU frame time and the probe count.

Textures

In the Assets tab, click a texture to preview it at the right with its size and format (HDR images are tone mapped for display). Click the preview to see it large; double-click the row to open the file.

The Inspector uses the component decorators: @range gives a slider, @color a color picker, @group a heading, @tooltip help text, @readonly shows without editing, and @hidden fields are not shown.

Viewport camera

Hold the right mouse button to fly (right-click without moving opens the viewport menu). F frames the selection, Home frames everything.

Editing a level (Edit mode)

Placing objects

Open the Objects tab in the dock. Drag an object type into the viewport: it lands on the surface under the pointer and is written to the chunk for its position, with a new id (GridNode gets grid-node-1). Double-click a tile to place it at the center of the view. Right-click in the viewport for Create here > Object from type..., or use + in the Hierarchy.

Gizmos

Key Tool
W Move: axis arrows, plane squares, and a center handle that moves in the view plane
E Rotate: three rings (the far half of each is dimmed and can't be grabbed)
R Scale: axis handles and a uniform center handle, always along the object's own axes
X Toggle World / Local axes
Esc Cancel the drag in progress (else clear the selection)

A readout next to the pointer shows the change while you drag. Type exact values in the Inspector.

Snapping

  • Grid snapping (the magnet) is on by default: move 0.25 m, rotate 15 degrees, scale 0.1. The step menu next to it offers other steps. Hold Ctrl while dragging to invert it.
  • Surface snapping (the mountain button) makes the move gizmo's center follow the surface under the pointer; "Align to the surface normal" also turns the object's up axis.
  • End drops the selection to the ground. Snap to grid (Edit menu or right-click) snaps X and Z.

Selecting

Action Effect
Click Select
Ctrl or Shift + click (viewport) Add or remove
Drag on empty space Box-select objects entirely inside (Ctrl or Shift adds)
Ctrl + click / Shift + click (Hierarchy) Toggle / select a range
Ctrl+A Select all placed objects

Several selected objects move, rotate and scale about their pivot (the mean of their origins). The last one added is the one the Inspector shows ("+N selected").

Duplicate and delete

Key Action
Ctrl+D Duplicate where Edit > Preferences says: on top of the original (default) or 1 m along X
Ctrl+Shift+D Duplicate the other way
Del Delete

Edit > Preferences > Duplicate places copy chooses what Ctrl+D does: On top of the original (the default) or Offset 1 m on X (the move step if that is larger). Ctrl+Shift+D always does the other, so both stay one shortcut away. The Edit menu names what Ctrl+Shift+D does now. Preferences are saved for your user in devtools' work folder (devtools-work/preferences.ini, next to the recent-projects list).

Duplicates keep the original's overrides and get a new id (house-3 becomes house-14 when the level's highest house is house-13). Ids are never reused: deleting an object, even the highest-numbered one, undoing a placement, or restarting devtools never frees its number, and an id you wrote by hand is respected. Devtools keeps a counter per id stem in the level file (nextIds, see level files). Undoing a delete brings the object back with its own id.

Undo

Every edit is one step: Ctrl+Z undo, Ctrl+Y redo, Edit > Undo history jumps several steps. A group move or a duplicate across several chunks is still one step. Undo is refused if the file was changed outside the editor since (your text edits win). Up to 200 steps.

Edits keep the file's comments and formatting; only the fields that changed are written.

Play mode

Key Action
F5 Play: start the game in the level open in the editor (on the screen that loads it)
Ctrl+F5 Play from start: start on game.toml's first screen
Shift+F5 Stop: close the game and return to the files

Play starts the dev server (molten-dev) if it isn't running. While playing:

  • The viewport mirrors the live game; you keep your free camera.
  • Pause stops the simulation (behaviors and physics); rendering, UI, picking and live reload keep working. Step advances one fixed tick. Time scale speeds up or slows down the simulation.
  • An Inspector change is a live edit: the game applies it at once and remembers it. Live edits survive code, asset and .object reloads, and are lost when the game exits.
  • Save to file (Ctrl+S, or per field) writes live edits into the files, which then reload like any edit. A placed object saves into its chunk (placement fields or overrides); a spawned object or a part saves into its object type file. Saves during Play are not undoable.
  • Discard live edits (Edit menu) returns fields to their file values.
  • Gizmos, Drop to ground and Snap to grid make live edits. Placing, duplicating and deleting change the level's structure, so they need Edit mode.

Stop sends the game a quit request and closes it after 2 seconds if needed.

Game instances

Any dev-build game connects to the dev server on 127.0.0.1:7420 by itself (--dev-server HOST:PORT to change, --no-dev-link to opt out). Devtools lists every connected game under File > Connect to game instance...; pick one to attach. Stop on a game you didn't launch from devtools only detaches. molten-devtools --attach skips the welcome screen and starts in this attach-only mode.

The release build has no dev link, so Edit works there but Play does not.

The dock tabs

Tab Shows
Console (Ctrl+`) Game and editor logs, compile errors with file and line
Assets Asset list and import status
Timeline Frame timing
Tracks Reserved
Objects The object-type palette

All shortcuts

Shortcut Action
Ctrl+O Open folder
Ctrl+Shift+N New project
Ctrl+N New level
Ctrl+, Project settings
F1 Viewport controls
Ctrl+S, Ctrl+Shift+S Save live edits (Play)
Ctrl+Z, Ctrl+Y Undo, redo (Edit)
Ctrl+D, Ctrl+Shift+D, Del Duplicate (as Preferences say), duplicate the other way, delete
End Drop to ground
Ctrl+A, Esc Select all, select none
Ctrl+C Copy the selected object's name
W, E, R, X, Q Move, rotate, scale, world/local, object tool
F, Home Frame selection, frame all
G Toggle the grid
Ctrl+1, Ctrl+2, Ctrl+3 Toggle Hierarchy, Inspector, dock
F5, Ctrl+F5, Shift+F5 Play, play from start, stop

Menu items shown greyed out (Restart game, Connect to address, the navmesh tool, shading modes other than Lit) are placeholders for later.

View this page's source on GitHub