summaryrefslogtreecommitdiff
path: root/src/game/g_local.h
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2017-08-14 13:07:27 +0200
committerPaweł Redman <pawel.redman@gmail.com>2017-08-14 13:31:00 +0200
commita3ff3075710c7657dad4579c90fb451736421140 (patch)
tree85e59eaf3f240b4c7653ad0cfeec4c9dedd623af /src/game/g_local.h
parent8bc5b6fdd9424823a0c46b961f4a4d12b2a8692c (diff)
Implement player extrapolation.
If a player doesn't send client frames fast enough then there will be some server frames where they don't move. This is visible as 'warping' and is generally very undesirable. Extrapolation tries to fix the problem by filling in the missing data by continuing player's trajectory.
Diffstat (limited to 'src/game/g_local.h')
-rw-r--r--src/game/g_local.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/game/g_local.h b/src/game/g_local.h
index a3c02c8..28bd059 100644
--- a/src/game/g_local.h
+++ b/src/game/g_local.h
@@ -450,6 +450,13 @@ typedef struct unlagged_s {
qboolean used;
} unlagged_t;
+#define MAX_SAVED_POSITIONS 3
+typedef struct {
+ vec3_t origin;
+ int time;
+ int client_time;
+} savedPosition_t;
+
// this structure is cleared on each ClientSpawn(),
// except for 'client->pers' and 'client->sess'
struct gclient_s
@@ -550,6 +557,10 @@ struct gclient_s
int tkcredits[ MAX_CLIENTS ];
int revertCookie;
+
+ qboolean extrapolate;
+ savedPosition_t savedPositions[MAX_SAVED_POSITIONS];
+ int savedPositionsCount;
};
@@ -1391,6 +1402,7 @@ extern vmCvar_t g_popularMapsVotePercent;
extern vmCvar_t g_banIPs;
extern vmCvar_t g_filterBan;
extern vmCvar_t g_smoothClients;
+extern vmCvar_t g_debugExtrapolation;
extern vmCvar_t g_outdatedClientMessage;
extern vmCvar_t pmove_fixed;
extern vmCvar_t pmove_msec;