5#include "net/prediction/command.h"
14constexpr uint32_t NET_QUEUE_DEPTH_BITS = 4;
17constexpr uint32_t NET_QUEUE_DEPTH_MAX = (1u << NET_QUEUE_DEPTH_BITS) - 1u;
21 "a queue deep enough to be trimmed has to be able to say so"
50 NetPacing() =
default;
51 ~NetPacing() =
default;
53 NetPacing(
const NetPacing& other) =
default;
54 NetPacing& operator=(
const NetPacing& other) =
default;
56 NetPacing(NetPacing && other) =
default;
57 NetPacing& operator=(NetPacing && other) =
default;
68 void report(uint32_t lowWater,
float roundTrip,
float tickRate);
76 float scale()
const {
return m_scale; }
79 float depth()
const {
return m_depth; }
84 void clear() { *
this = NetPacing{}; }
88 float m_spread = 0.0f;
91 bool m_started =
false;
static constexpr size_t MAX_DEPTH
Commands the queue may hold before the oldest are skipped, all at once.
Definition command.h:122
float depth() const
The low water as smoothed over the last few snapshots, in commands.
Definition pacing.h:79
static constexpr float MAX_DILATION
The most the pacing bends either way.
Definition pacing.h:47
float scale() const
How much faster than wall time to run ticks.
Definition pacing.h:76
float target() const
The low water this is steering toward, in commands.
void report(uint32_t lowWater, float roundTrip, float tickRate)
Take one snapshot's reading of the queue.