Skip to main content

Cauldron kits

Every new Cauldron deck starts from a kit. A kit is the framework your deck is built on. It can bring an engine, file formats for scenes and art, ready-made behaviors, visual editors, and a guide that Operator reads before it changes your deck.

Your deck imports its kit rather than copying it. The kit's files appear read-only under imports/, while your own scenes, art and code stay editable in your deck. Castle's kits update automatically: when a new version comes out, your deck picks it up the next time its editor starts.

When you create a deck, Castle asks which kit to start from:

In the kit pickerKitWhat the picker says
Scene Editor (Recommended)physics-2dWorks like classic Castle: actors, blueprints, behaviors and drawing tools, with physics built in.
Scene Editor 3D (Experimental)physics-3dThe Scene Editor in 3D, with physics built in.
Multiplayermultiplayer-2dThe Scene Editor, with multiple players in the same session.
Multiplayer with 3D (Experimental)multiplayer-3dThe Scene Editor 3D, with multiple players in the same session.
Turn-basedturn-basedThe Scene Editor, with players taking turns and each seeing state only they can see.
Code OnlynoneAn empty web page (index.html and game.js). No scenes, drawing tools or blueprints: everything is code. For importing an HTML/JS project or building from scratch in code.

The Castle team is focusing on the 2D Scene Editor first. The 3D and multiplayer kits work, but for now you'll need to be more comfortable with code to use them.

Scene Editor (physics-2d)​

The recommended kit, and the closest to classic Castle. It gives a deck:

  • Scenes in scenes/*.scene files, edited in the scene editor. Each screen of a game is its own scene.
  • Blueprints in blueprints/. Every actor in a scene is an instance of a blueprint.
  • Behaviors in behaviors/*.jsx. A behavior is a JavaScript class that gives an actor its logic. Built-in behaviors cover layout, sprites, text, colliders, the camera, sound and video, and touch-first controls like Draggable, Slingshot and AnalogStick.
  • Pixel art in .sprite files, drawn in the sprite editor with a palette and animation frames. Uploaded images and video work too.
  • 2D physics built on matter-js: rigid bodies, gravity, collisions, and joints like springs, rods, pins and ropes.
  • Sound: short effects played by name from assets/sounds/, and streamed music.

Scenes are laid out on a 500×700 canvas, which Castle scales to fit the player's card.

Scene Editor 3D (physics-3d)​

The same actors, behaviors, scenes and blueprints in 3D, rendered with three.js and simulated with Rapier physics. One unit is one meter, and y is up. 3D models are .pxmodel files built from simple parts, and Operator can make them for you. The kit builds on the 2D one, so the sprite editor and its pixel art are available here too.

Multiplayer (multiplayer-2d and multiplayer-3d)​

These kits add real-time multiplayer to the Scene Editor: everyone in a session plays in the same physics world. The kit comes with its server already written. It keeps players connected and in sync, and saves where objects and players are, so a returning player starts where they left off.

You add your game's rules on top, in code/server/game.js for the server and code/client/game.js for each player's device. Both are optional. See Multiplayer for how multiplayer decks work in general.

Turn-based (turn-based)​

Multiplayer where players take turns. The kit handles the table your game is played at: seats, spectators, and players who drop out and come back. It knows nothing about any particular game, so the rules are yours. It starts with a small example where two players claim squares on a 4×4 board; replace that with your own game.

If some state should be seen by only one player, like a hand of cards or a secret role, your server code sends it to that player alone. Like the other kits, this one builds on the 2D Scene Editor.

Code Only​

A blank deck with an index.html and a game.js, and no engine, scenes or blueprints. Use it to bring in an existing HTML or JavaScript project, or to build everything yourself in code. The Files panel still opens images, audio and video in Castle's built-in viewers, and the SDK and the rules for how decks run still apply.

Changing a kit​

You can't edit files under imports/ directly. To change one file of an imported kit, fork it: your deck gets its own copy of that file and uses it in place of the kit's. A forked file stops getting the kit's updates, so fork as little as you can. Often you don't need to: a deck can add its own behaviors alongside the kit's. Ask Operator for the change you want, and it will pick the right approach.

Next: How decks run · Back to Getting started