55 bool load_map_pending,
59 if (load_map_pending && has_episode) {
62 if (!frame_prepared || !has_episode || !episode_world) {
69 inline bool IsConsecutive(std::optional<uint64_t> last_played, uint64_t frame) {
70 return last_played.has_value() && (frame == *last_played + 1u);
75 inline bool NeedsResync(std::optional<uint64_t> last_played, uint64_t frame,
bool full_resync) {
76 return !full_resync && last_played.has_value() && !
IsConsecutive(last_played, frame);
81 return std::isfinite(delta_seconds) && (delta_seconds >= 0.0f);
bool IsConsecutive(std::optional< uint64_t > last_played, uint64_t frame)
Whether frame directly follows the last frame this secondary played.
bool IsUsableDelta(float delta_seconds)
Whether a primary's delta can be this engine frame's time step.
BeginFrameAction DecideBeginFrame(const BeginFrameState &state)
PreTickAction DecidePreTick(bool load_map_pending, bool has_episode, bool frame_prepared, bool episode_world)
BeginFrameAction
What a secondary does at the start of an engine frame, before the engine computes the frame's time st...
@ OwnClock
Not connected to a primary: run on this server's own clock.
@ Wait
Wait for the primary's next frame and take its time step.
@ DontWait
Connected, but this frame must not block (no episode yet, or a map load or travel is under way,...
bool NeedsResync(std::optional< uint64_t > last_played, uint64_t frame, bool full_resync)
Whether playing frame shows that this secondary missed primary state (a frame went missing) that only...
PreTickAction
What a secondary does when its world starts ticking.
@ Skip
No primary frame: let the frame pass without simulation time.
@ OpenLevel
Open the map the primary loaded; nothing else this frame.
@ Play
Play the primary frame prepared for this engine frame.
This file contains definitions of common data structures used in traffic manager.