The Molten Guide
Molten is a 3D game engine for Windows and Linux. You describe your game in small, readable text files, write gameplay in Cast (a language that reads like TypeScript and compiles to C), and watch the running game update within about a second every time you save a file.
This guide teaches Molten from scratch. If you have never used it, read Getting started, then work through the tutorial. The rest is reference you can come back to.
The design spec, docs/DESIGN.md, is the source of truth. This guide explains what the spec and the code do today. Where they differ, the guide says so in a short Note.
Contents
Start here
- Getting started: install, build, open a sample, make your first live change.
- Tutorial: Coin Yard: build a small game step by step.
Concepts
- Overview: how a Molten game is put together
- Assets
- Components
- Object types and parts
- Objects and handles
- Levels and chunks
- Screens and the screen stack
- UI
- Behaviors
The Cast language
- Cast at a glance
- Basics: variables, functions, control flow
- Numbers and conversions
- Vectors, quaternions and matrices
- Structs and classes
- Interfaces, operators and equality
- Null safety
- Unions and switch
- Generics
- Strings
- Arrays, slices and maps
- Function values and arrow functions
- defer and calling C
- Components, decorators and behaviors
- Modules: import and export
- Memory and arenas
- What was removed from TypeScript
Reference
game.toml.objectfiles.leveland.chunkfiles.screenfiles.uifiles.stylefiles- Engine API (
import ... from "molten") - Built-in components
- Shaders: custom materials, post effects, the shader ABI
- Command-line tools
Working with Molten
- Live reload
- Devtools (the editor)
- Editor tooling: VS Code
- Shipping your game
- Troubleshooting and FAQ
- Glossary
How the examples were checked
- Every complete Cast program in the language chapters (the ones with
export function main()) was compiled and run withcastc run, and the output shown under it is the real output. You can re-check them withpython docs/agents/check_examples.py --bin build/debug/bin/Debug. - Every tutorial step was built as a real game folder, checked with
castc check, and run in a hidden window to confirm it starts and does what the step says. - Concept-file examples come from the samples in
samples/or were checked withcastc check.