Skip to main content

Play

Sakin Play is a run configuration, as an app's configuration is in Android Studio: Run, Stop, Rerun; with "Store as project file" it is shared in .run/.

Option
Worldthe world to play
Seen onits scene, or one package on its own (to try a building before the town)
Startthe world's own start, or a chosen date and time
Weatherone of the environment's weathers
Speedgame minutes every 0.16 s, 1×–60×
Start the clock at onceor start paused

Right-click a world, a scene or a package → Run, or press Run with its file open (Current File), and the configuration is made: a world plays in its scene (without one, on its first package with a model, buildings first); a scene plays in the world that lives in it (else the project's first world); a package plays in the project's first world. A world starts at the latest in its first 365 days.

Before it starts​

Check Kalem scripts, a before-launch task that is on by default, looks at every script the session will run. Play does not start when a script is missing or has errors, or when a field a script needs is missing, has another type, or has two writers. The notification says why; when fields are missing, Add the fields they use and play adds them in one command, with the types the scripts use (the world's to the world, the rest to their own packages), and starts Play again (when there is another problem too, it only adds them).

The session​

A session is a run of Caria's server on your machine, carried in the plugin: the clock is the server's, commands go to it and updates come back in order. It keeps everything in memory and saves nothing, to disk or to a database. The definitions are taken when it starts; later changes reach it with Rerun, which starts a new session.

What runs:

  • In a scene, every placement is an object of its own, named by its placement id (uhren-disko); its parts with fields or scripts and the objects it places go under it (uhren-disko/sofa-2). The scene itself is not an object.
  • On a package, the package (named by its folder), its parts with fields or scripts, and every object it places, each on its own.
  • The world is world, with its fields and scripts.

Server scripts run in the session through Kalem; the calendar's functions are answered by the server. Client scripts run in the view.

The panels​

The Run tool window shows the session in the IDE's own panels. View is in the middle, Node Tree on its left, Objects and Events as two tabs on the right, Log below; Profile has a tab of its own.

Panel
Viewthe clock (Year 1 · 1 March, Monday · 08:00), the season and the state above; the town (or the package) in the world's environment at the session's time
Node Treethe world and the objects the session runs, their parts and what they place; rows with fields or scripts are bold, with their scripts' names
Objectsevery object with its fields' current values; below, its components as groups: the script's properties as set, its current state ("Stopped by an error" when an error closed it), its memory, when its timers fire next, and a client component's signal and value
Eventsthe catalog's test events, each with a form for its payload, and Send
Logevery transaction, with the world's time it happened at
Profilewhat every transaction spent (Profile)
  • Choosing a row in the Node Tree narrows Objects to it and what is under it (Show All or Esc goes back), and the view marks it with its bounds; a double click (or Enter) flies the camera to it; a click in the view selects its row.
  • Every panel can be dragged by its label to another place, a tab or a window of its own, hidden and brought back; the IDE keeps the layout. The label of a panel standing alone shows with the window's Show Tab Labels (Restore Layout goes back to the default). The Run tool window itself docks, floats or moves to a window of its own.

The clock​

Beside Rerun and Stop in the toolbar: Pause / Resume, Step Ten Minutes (while paused) and the speed (1×–60×). Go to beside the clock (a month, a day and a time; the time can be typed) moves the world on to a later moment of the year, and every timer on the way runs. The world never goes back (play again from an earlier start), goes at most a year ahead, and a world standing at a breakpoint must go on first.

The log​

Every line starts with the world's time: the year, the day, the month, the day of the week and the time ([Y1 2 Mar Tue 00:18]). A transaction is written as Kalem writes it (in Turkish today), after the object's name: what fired it, the state it moved to, and every field it changed (business.open: false → true). An error that closes a binding is written with a link to the script's line, and the clock stops at that minute.

Test events​

The Events panel offers only events whose producer is test, with a form made from the catalog. A self event goes to the package the view shows, and in a scene, to the object chosen in the Node Tree (a part stands for its object). Sending an event pauses the clock, so its effect can be read before time moves on.