StupidRPG: Game Ticks

A game tick is a unit of time for something happening in the world. Generally, when the player takes an action, a tick occurs. Entities within the ECS can watch for ticks and take actions. NPCs, for example, have the opportunity to take an action on each tick. You can think of a tick as a round of combat in D&D, where each combatant has their own turn within the round (in a particular order).

Ticks are controlled very flexibly, allowing for layers of precedence and handlers:

  1. Global: defaults to on, run after any user input
  2. NLP: disables current tick if the player’s input wasn’t understood
  3. Verb: enables/disables current tick for an entire verb (e.g. INVENTORY)
  4. Callback: can enable/disable current tick on the fly during verb callback

Some fun things I might look into:

  • Time scaling as a result of plot or a character power (ticks happen more/less frequently than normal).
  • Exempting a creature from the normal tick rules, allowing them to act after bad input or non-tick verbs.