-
Notifications
You must be signed in to change notification settings - Fork 7
/
const.h
73 lines (54 loc) · 2.74 KB
/
const.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
// Copyright © 2015, The Network Protocol Company, Inc. All Rights Reserved.
#ifndef CONST_H
#define CONST_H
static const int SnapshotsPerSecond = 10;
static const int MaxInputsPerPacket = 63;
static const int InputSlidingWindowSize = 256;
static const int InputSafety = 16; // todo: it would be nice if this was a minimum and it could grow as required
static const int MaxSyncSamples = 30;
static const int MaxBracketSamples = 30;
static const int MaxAdjustmentSamples = 60;
static const int AdjustmentOffsetBits = 6;
static const int AdjustmentOffsetMinimum = - ( 1 << ( AdjustmentOffsetBits - 1 ) ); // -32
static const int AdjustmentOffsetMaximum = - AdjustmentOffsetMinimum - 1; // +31
static const int ReconnectDroppedInputs = 60;
static const double DroppedInputForgetTime = 5.0f;
static const int ServerPort = 20000;
static const float Timeout = 5.0f;
static const int ServerFramesPerSecond = 60;
static const int ClientFramesPerSecond = 60;
static const int TicksPerSecond = 240;
static const float TickDeltaTime = 1.0 / TicksPerSecond;
static const int TicksPerClientFrame = TicksPerSecond / ClientFramesPerSecond;
static const int TicksPerServerFrame = TicksPerSecond / ServerFramesPerSecond;
static const double ServerFrameDeltaTime = 1.0 / ServerFramesPerSecond;
static const double ClientFrameDeltaTime = 1.0 / ClientFramesPerSecond;
static const double ServerFrameSafety = 0.5;
static const double ClientFrameSafety = 0.5;
static const double AverageSleepJitter = 2.25 * 0.001;
static const int MaxClients = 1;
static const int MaxEntities = 1024;
static const int MaxPlayers = MaxClients;
static const int MaxCubes = MaxEntities;
static const int MaxPhysicsObjects = MaxEntities;
static const int MaxPhysicsPlanes = MaxEntities;
static const int MaxViewObjects = MaxEntities;
static const int MaxCubeShadowVertices = 1024 * 32;
static const float ShadowAlphaThreshold = 0.15f;
static const float AuthorityThreshold = 0.5f;
static const int MaxContexts = 8;
static const int MaxPacketSize = 4 * 1024;
static const int UnitsPerMeter = 512;
static const int OrientationBits = 9;
static const int PositionBoundXY = 255;
static const int PositionBoundZ = 31;
static const float MaxLinearSpeed = 31; // note: this can be set directly on the ODE bodies avoiding me manually hacking this
static const float MaxAngularSpeed = 15;
static const int QuantizedPositionBoundXY = UnitsPerMeter * PositionBoundXY - 1;
static const int QuantizedPositionBoundZ = UnitsPerMeter * PositionBoundZ - 1;
static const int ENTITY_NULL = -1;
static const int ENTITY_WORLD = 0;
static const int ENTITY_PLAYER_BEGIN = 1;
static const int ENTITY_PLAYER_END = ENTITY_PLAYER_BEGIN + MaxPlayers;
static const int PHYSICS_NULL = -1;
#endif // #ifndef CONST_H