Skip to content

Class

TimeHost

Generated GDScript class reference for CalendarTime.TimeHost.

Status
Current
Version
v2.1.1
Source updated
2026-08-09
Generated on
2026-09-26

TimeHost: Node and engine→game bridge. Drives every clock in clocks each frame via drive_mode, and composes the save/load facade (ClockGroupSerializer) plus one DayNightCycleService per clock in _ready. No clock ownership, no primary-clock concept. Drive modes (see DriveMode and addons/calendar_time/guides/timescale-and-drive-modes.md):

  • PROCESS (default): _process(delta) advances every clock from engine delta × time_scale.delta_multiplier with fractional-µs carry.
  • PHYSICS_PROCESS: the same on the physics tick, for game-time calibration locked to the physics frame rate (e.g. 60 Hz).
  • MANUAL: no auto-advance; the game calls drive_microseconds() / drive_seconds() itself (tests, replays, fixed-step simulations).

Source: addons/calendar_time/game_time/state/time_host.gd

Syntax

class TimeHost extends Node

Members

NameKindSummary
clocksPropertyDrive mode for automatic clock advancement; `PROCESS` is the default and matches prior behaviour. `MANUAL` is the documented manual path (see `addons/calendar_time/guides/timescale-and-drive-modes.md`). The clocks this host advances. Drag `GameClock` `.tres` resources here; this list drives advancement, save/load, and day/night services. Replacing it at runtime rebuilds the clock group. Ships preassigned to the bundled Four Seasons clock in `default_time_host.tscn`.
time_scalePropertyGame time per real time: `delta_multiplier` multiplies each engine frame's delta in PROCESS and PHYSICS_PROCESS modes (1000.0 = 1000 game seconds per real second). This is the host-wide rate; it does not change the calendar's unit schema. Distinct from `GameCalendar.time_scale`.
drive_modePropertyHow the clocks advance. PROCESS (default) advances from engine delta each frame; PHYSICS_PROCESS on the physics tick; MANUAL never auto-advances and expects `drive_microseconds()` / `drive_seconds()` calls.
auto_increment_timePropertyBackward-compatible boolean alias for `drive_mode`: true ≡ PROCESS, false ≡ MANUAL. Kept for pre-rename scenes and tests.
group_serializerPropertySave/load facade composing time + age per clock, namespaced under the group's `save_key`. See `ClockGroupSerializer`.
day_night_cycle_servicesPropertyOne DayNightCycleService per clock, composed by the host in `_ready`. Each reads `times_of_day` from its own clock's calendar.
get_clock_groupMethod
get_group_serializerMethod
load_stateMethod
drive_microsecondsMethod
drive_secondsMethod