Skip to content

GameSpeed

The game’s speed, with no code: a sim’s speed buttons (pause, 1x, 2x, 4x, 16x) set it with their Do action (“Set Speed” with 4, or Faster and Slower), and so can a Trigger on a key’s message or a script. While it’s Exact (the default) the game goes faster by taking more steps of the usual length, so it plays out the same at any speed: a worker walking a grid crosses as many cells in a game second at 16x as at 1x. One is enough, on any entity of the scene.

It sets the game’s Time.FastForward and Time.Scale as the scene starts and whenever its Speed or Exact changes, so a script setting those itself isn’t undone. Fast-forward does nothing in a network game, whose steps are kept in step between the players.

Works with: Button (speed buttons: Action Do, Do Set Speed, With 4)

Each is listed as its key in the scene file and the MCP tools, then its kind of value, its default and what it does.

  • speed: a number = 1. How fast the game runs: 1 normal speed, 4 four times as fast, 0.5 half speed, 0 paused (up to 64). The Set Speed, Faster and Slower actions change it, and so can scripts. (Field: a number.)
  • exact: true or false = true. Faster speeds take more steps of the usual length each frame (Time.FastForward), so everything goes as it does at normal speed, only sooner. Untick it to make each step longer instead (Time.Scale): it costs the machine less, but what goes a step at a time is coarser at high speeds. Speeds below 1 always make steps shorter. (Field: on or off.)
  • speeds: lines of text: an array of strings, or one string with line breaks = [“1”,“2”,“4”]. The speeds Faster and Slower go through, one a row, e.g. 1, 2, 4 and 16. (Numbers in order, one per line. The Inspector lists them a row each, to drag, add, remove and reorder.) (Field: its own editor: List Rows.)

What anything can make it do with no code: a Trigger’s do when its message arrives, a Contraptions Wire’s input as its signal comes on, a script’s Game.Do(entity, “Name”).

  • SetSpeed (done with a number, its speed: a trigger’s with, 1 without one). Runs the game at speed: 1 normal, 4 four times as fast, 0 paused.
  • Faster. Goes to the next of its Speeds above the speed now (from paused, the slowest).
  • Slower. Goes to the next of its Speeds below the speed now; at the slowest, it stays.

What anything can read with no code: a Counter’s, Bar’s or Text’s output, a Contraptions Wire’s output as its signal; Text shows names too, the rest read numbers, true as 1.

  • Speed (a number). How fast the game runs: 1 normal speed, 4 four times as fast, 0.5 half speed, 0 paused (up to 64). The Set Speed, Faster and Slower actions change it, and so can scripts.

Scripts use it as GameSpeed: its methods, events and values that aren’t saved with the scene.