Play and Debug
This page is about Kalem. Play, Debug and Profile are documented in full at editor.playcaria.com.
Play
Play is a run configuration, Sakin Play: the world, what the view shows it on (its scene, or one package on its own), when it starts (the world's own start or a chosen date and time), the weather and the speed (game minutes every 0.16 s, 1×–60×). Right-click the world, a scene or a package → Run, or press Run with the file open, and the configuration is made.
- A world plays in its scene. Every placement in the scene is an object of its own, named by its
placement id (
uhren-disko); its parts and the objects it places go under it (uhren-disko/sofa-2). - Before Play starts, Check Kalem scripts looks at every script the world will run: a script that is missing or has errors, a field a script needs that its object lacks or has with another type, or a field with two writers stops it, with a notification saying why.
- A session runs with the definitions it opened with; a change of code reaches it with Rerun, which starts a new session.
The Run tool window shows the session in panels of the IDE, each movable to a tab or a window of its own:
| Panel | Shows |
|---|---|
| View | the town (or the package) in the world's light at the session's time; client scripts run here |
| Node Tree | the world, the scene's placements, their parts and what they place; a row narrows Objects and is marked in the view, a double click flies the camera to it |
| Objects | every object's fields as they are now, and its components: properties, state, memory, timers, the signal an input reads |
| Events | the catalog's test events with a form for their payload; a self event goes to the object chosen in the Node Tree |
| Log | every transaction: what fired it and what it changed; an error with a link to its line |
| Profile | what every transaction cost, on a timeline and in a table |
The clock's buttons (pause, a step of ten minutes, the speed) are in the toolbar; Go to beside the clock moves the world on to a later day and time, running every timer on the way.
Debug
Debug runs the same session under the IDE's debugger:
- set a breakpoint on a
.kalemline; the world stops when a transaction enters that line,on readyincluded; - step over, into and out; a step ends with the call;
- the frames, the locals, the instance's state, memory, the fields it reads and writes with their pending writes (not applied yet), and the properties show;
- while it stands at a line, the world's clock stands still, and nothing is saved;
- breakpoints can change while it stands, and apply at once.
Client scripts run in the view and are not stopped by the debugger. Conditional breakpoints, log breakpoints and watch expressions are coming.
Profile
Every transaction's line in the profile has its moment, what fired it (a timer, an event, the start, a migration), its cost, the bytes of strings it made, the fields it wrote and how long it took. The time is measured by the machine's clock and only observed; it changes no behaviour.