The runtime clock consumers reference: a Resource holding the canonical microsecond count, calendar, signal bus, serializer, and age service. date_time() is derived from the count via the calendar, never stored.
Source: addons/calendar_time/game_time/state/game_clock.gd
Syntax
class GameClock extends ResourceMembers
| Name | Kind | Summary |
|---|---|---|
ProjectionRange | Field | |
current_microseconds | Property | Canonical elapsed game-microseconds, source of truth for all derived time. Not @export; runtime state saved via TimeSnapshot. |
speed_multiplier | Property | Per-clock rate: final advance is engine delta × host time scale × this multiplier. Values <= 0 pause this clock and stop boundary events (direct `date_time()` reads are unaffected); it never touches `Engine.time_scale`. Watch `clock_speed_changed` to pause tweens/animations. |
calendar | Property | Gives this clock its shape of time: months, days, event days, and the unit schema. Duplicate the bundled Four Seasons calendar to customize. |
time_scale | Property | Advanced: pacing read by animation consumers (flipper, emote bob, etc.), not by advancement. The host propagates its own time scale; leave unset. |
epoch | Property | Optional start date; `date_time()` counts forward from here, making it the in-game "day one". Defaults to the calendar's epoch. |
persistent_id | Property | Stable UUID identifying this clock in save files; empty derives one automatically. Keep it stable: changing it breaks existing saves. Duplicating a `.tres` copies the UUID, so use "Regenerate Persistent ID" on the duplicate; "Assign Persistent ID" sets one only when missing. |
clock_id_override | Property | Advanced: fixed, readable id for save files, e.g. cross-project references. Empty derives automatically; prefer the editor's persistent-ID actions. |
signal_bus | Property | Clock event bus, created eagerly so consumers can subscribe before the host's `_ready`. All boundary events emit here from `advance_microseconds`. |
age_service | Property | Age service bound to this clock's time. Optional. Not @export: Godot cannot resolve a custom Resource @export here. Assign from the `.tres` or at runtime; the setter wires `age_service.clock = self`. |
time_snapshot_serializer | Property | Time serializer constructed in `_init` and wired to self. |
age_registry | Property | Per-clock `AgeStateRegistry`: age state is hermetic to this clock, with no process singleton, so two clocks never see each other's states. Constructed in `_init`; lifetime matches the clock resource. |
clock_id | Property | Stable id used by ClockGroupSerializer for save/load identity. Cached after first resolution; reassigning `persistent_id` or `clock_id_override` clears the cache. Priority (issue #424): `clock_id_override` (durable across sessions) → `persistent_id` (durable across renames, restarts, machines) → `resource_path` hash (same `.tres` shipped) → runtime counter (session-local). |
assign_persistent_id | Method | |
regenerate_persistent_id | Method | |
advance_microseconds | Method | |
advance_through_microseconds | Method | |
advance_scaled_microseconds | Method | |
progress_time | Method | |
advance_to_next_day | Method | |
publish_current_state | Method | |
publish_state_loaded | Method | |
get_time_snapshot_serializer | Method | |
to_dict | Method | |
from_dict | Method | |
date_time | Method | |
game_seconds | Method |