This document details PIGGE's new time architecture, which was first implemented in PIGGE 0.1.3.

Types

The idea is that there are not just one or two time bases, but many. To start with, the time driver provides the following:

frame
Frame number (for fixed-rate time bases)
system
Raw wall time, may have any epoch

All remaining times are based on some previously defined time base, and are processed in a pipeline. At least the following will exist by default:

realspace
system time with epoch matched to realspace
simulation
Core simulation time, based on one of the time driver outputs but pausable, etc. Epoch is start of simulation.

Others worth adding might be:

nature
Base time for natural phenomena, probably based on simulation or realspace time
seasons
Progression of seasons, based on nature
diurnal
Progression of day/night cycle, based on nature
players
Time as seen by players (human or bot), based on simulation time

Parameters

Every time base provides the following:

time
Current time in this time base
delta
Change in time since last frame

For each time base other than those provided by the time driver, the following are also defined:

base
Base time from which this time is defined
rate
Multiplier of base time rate
offset
Offset from base time (applied only at init)
paused
Boolean: this time is paused relative to its base