Timing & scheduling

Both realtime and turn-based games need to maintain the notion of a time: to manage events, schedule turns, perform correct timing and related measurements. rot.js offers several helper tools at varying levels of abstraction to help with these tasks. Click on individual sub-chapters to read more detailed information.

  1. Event queue is the most low-level approach: a simple priority queue that maintains a correct order of time-based data.
  2. Scheduler maintains a list of entities and picks them repeatedly based on a scheduling strategy. There are three built-in scheduling strategies available.
  3. Engine takes an existing scheduler and automatically executes scheduled actions. Asynchronous actions are supported via recursive engine locking.