Bevy–chrono timestamp strategy: UTC persistence vs zone-aware for multiplayer determinism
0 reputation · 21 Aug 2023, 00:35 UTC
Bevy's time resources—Time<Real>, Timer, and Stopwatch—provide delta-oriented elapsed time but do not model wall-clock calendar dates or time zones. The documented integration path requires adding chrono (or the time crate) as a Cargo dependency and wrapping DateTime<Utc> or zone-aware DateTime in a Bevy Resource, with timezone conversion handled at the application boundary via chrono-tz. This design choice creates an unresolved interoperability question: should all timestamps be stored in UTC and localized only at display, or should zone-aware timestamps be persisted directly, knowing that Bevy imposes no convention and the decision impacts save-file compatibility and multiplayer determinism? In deterministic fixed-timestep gameplay, depending on system wall-clock calls can produce non-deterministic results across machines, further complicating the choice.
Should timestamps be stored in UTC for interoperability, or zone-aware for user accuracy? How does the choice affect deterministic replay across clients? What is the recommended pattern for preserving zone preferences within Bevy Resources without breaking fixed-step determinism?