mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Extended staffsync RNG/resync reporting
This commit is contained in:
parent
ab39175430
commit
ae0100ba05
7 changed files with 80 additions and 4 deletions
|
|
@ -6924,6 +6924,28 @@ static void Command_Staffsync(void)
|
||||||
|
|
||||||
CONS_Printf("\n");
|
CONS_Printf("\n");
|
||||||
|
|
||||||
|
CONS_Printf(" %d syncs (%d error)\n", result->numerror, result->totalerror/FRACUNIT);
|
||||||
|
|
||||||
|
CONS_Printf(" presync: ");
|
||||||
|
|
||||||
|
for (UINT32 j = 0; j < PRNUMSYNCED; j++)
|
||||||
|
{
|
||||||
|
if (result->rngerror_presync[j] > 0)
|
||||||
|
CONS_Printf("%s %d ", rng_class_names[j], result->rngerror_presync[j]);
|
||||||
|
}
|
||||||
|
|
||||||
|
CONS_Printf("\n");
|
||||||
|
|
||||||
|
CONS_Printf(" postsync: ");
|
||||||
|
|
||||||
|
for (UINT32 j = 0; j < PRNUMSYNCED; j++)
|
||||||
|
{
|
||||||
|
if (result->rngerror_postsync[j] > 0)
|
||||||
|
CONS_Printf("%s %d ", rng_class_names[j], result->rngerror_postsync[j]);
|
||||||
|
}
|
||||||
|
|
||||||
|
CONS_Printf("\n");
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -245,6 +245,10 @@ struct staffsync_t
|
||||||
char name[MAXPLAYERNAME+1];
|
char name[MAXPLAYERNAME+1];
|
||||||
UINT32 reason;
|
UINT32 reason;
|
||||||
UINT32 extra;
|
UINT32 extra;
|
||||||
|
fixed_t totalerror;
|
||||||
|
UINT32 numerror;
|
||||||
|
UINT32 rngerror_presync[32];
|
||||||
|
UINT32 rngerror_postsync[32];
|
||||||
};
|
};
|
||||||
extern staffsync_t staffsync_results[1024];
|
extern staffsync_t staffsync_results[1024];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -505,11 +505,19 @@ void G_ReadDemoExtraData(void)
|
||||||
{
|
{
|
||||||
P_SetRandSeed(static_cast<pr_class_t>(i), rng);
|
P_SetRandSeed(static_cast<pr_class_t>(i), rng);
|
||||||
|
|
||||||
|
if (staffsync)
|
||||||
|
{
|
||||||
|
if (demosynced)
|
||||||
|
staffsync_results[staffsync_failed].rngerror_presync[i]++;
|
||||||
|
else
|
||||||
|
staffsync_results[staffsync_failed].rngerror_postsync[i]++;
|
||||||
|
}
|
||||||
|
|
||||||
if (demosynced)
|
if (demosynced)
|
||||||
{
|
{
|
||||||
if (G_FailStaffSync(SYNC_RNG, i))
|
if (G_FailStaffSync(SYNC_RNG, i))
|
||||||
{
|
{
|
||||||
CONS_Alert(CONS_WARNING, "Demo playback has desynced (RNG class %d)!\n", i);
|
CONS_Alert(CONS_WARNING, "Demo playback has desynced (RNG class %d - %s)!\n", i, rng_class_names[i]);
|
||||||
storesynced = false;
|
storesynced = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1268,6 +1276,12 @@ void G_ConsGhostTic(INT32 playernum)
|
||||||
}
|
}
|
||||||
demosynced = false;
|
demosynced = false;
|
||||||
|
|
||||||
|
if (staffsync)
|
||||||
|
{
|
||||||
|
staffsync_results[staffsync_failed].numerror++;
|
||||||
|
staffsync_results[staffsync_failed].totalerror += abs(testmo->x - oldghost[playernum].x) + abs(testmo->y - oldghost[playernum].y) + abs(testmo->z - oldghost[playernum].z);
|
||||||
|
}
|
||||||
|
|
||||||
P_UnsetThingPosition(testmo);
|
P_UnsetThingPosition(testmo);
|
||||||
testmo->x = oldghost[playernum].x;
|
testmo->x = oldghost[playernum].x;
|
||||||
testmo->y = oldghost[playernum].y;
|
testmo->y = oldghost[playernum].y;
|
||||||
|
|
|
||||||
|
|
@ -1885,7 +1885,7 @@ void G_Ticker(boolean run)
|
||||||
|
|
||||||
P_MapStart();
|
P_MapStart();
|
||||||
|
|
||||||
if (demo.playback && staffsync && !demosynced)
|
if (demo.playback && staffsync && !demosynced && false) // We want to assess the magnitude of position desync, don't bail early!
|
||||||
{
|
{
|
||||||
G_ClearRetryFlag();
|
G_ClearRetryFlag();
|
||||||
G_StopDemo();
|
G_StopDemo();
|
||||||
|
|
|
||||||
|
|
@ -7768,7 +7768,7 @@ void K_drawKartHUD(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (staffsync)
|
if (staffsync && staffsync_total)
|
||||||
{
|
{
|
||||||
V_DrawFadeScreen(31, 8);
|
V_DrawFadeScreen(31, 8);
|
||||||
V_DrawCenteredGamemodeString(BASEVIDWIDTH/2, BASEVIDHEIGHT/2 - 30, 0, 0, "Staff Ghost Sync Test");
|
V_DrawCenteredGamemodeString(BASEVIDWIDTH/2, BASEVIDHEIGHT/2 - 30, 0, 0, "Staff Ghost Sync Test");
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,42 @@
|
||||||
#include "m_random.h"
|
#include "m_random.h"
|
||||||
#include "m_fixed.h"
|
#include "m_fixed.h"
|
||||||
|
|
||||||
|
char rng_class_names[34][30] = {
|
||||||
|
"UNDEFINED",
|
||||||
|
"EXECUTOR",
|
||||||
|
"ACS",
|
||||||
|
"DECORATION",
|
||||||
|
"TERRAIN",
|
||||||
|
"BUBBLE",
|
||||||
|
"RANDOMANIM",
|
||||||
|
"PLAYERSTARTS",
|
||||||
|
"VOICES",
|
||||||
|
"RANDOMSKIN",
|
||||||
|
"RANDOMAUDIENCE",
|
||||||
|
"RULESCRAMBLE",
|
||||||
|
"MUSICSELECT",
|
||||||
|
"ITEM_ROULETTE",
|
||||||
|
"ITEM_RINGS",
|
||||||
|
"ITEM_SHRINK",
|
||||||
|
"ITEM_BUBBLE",
|
||||||
|
"ITEM_DEBRIS",
|
||||||
|
"ITEM_BOOST",
|
||||||
|
"EXPLOSION",
|
||||||
|
"SMOLDERING",
|
||||||
|
"SPARKLE",
|
||||||
|
"MOVINGTARGET",
|
||||||
|
"TRACKHAZARDD",
|
||||||
|
"BATTLEUFO",
|
||||||
|
"BOTS",
|
||||||
|
"AUTOROULETTE",
|
||||||
|
"FUZZ",
|
||||||
|
"FROSTTHROWERS",
|
||||||
|
"ITEM_SPAWNER",
|
||||||
|
"TEAMS",
|
||||||
|
"DUMMY",
|
||||||
|
"INTERPHUDRANDOM",
|
||||||
|
"NUISANCE"
|
||||||
|
};
|
||||||
|
|
||||||
// ---------------------------
|
// ---------------------------
|
||||||
// RNG functions (not synched)
|
// RNG functions (not synched)
|
||||||
|
|
|
||||||
|
|
@ -103,6 +103,7 @@ typedef enum
|
||||||
PRNUMCLASS
|
PRNUMCLASS
|
||||||
} pr_class_t;
|
} pr_class_t;
|
||||||
|
|
||||||
|
extern char rng_class_names[34][30];
|
||||||
// M_Random functions pull random numbers of various types that aren't network synced.
|
// M_Random functions pull random numbers of various types that aren't network synced.
|
||||||
// P_Random functions pulls random bytes from a PRNG that is network synced.
|
// P_Random functions pulls random bytes from a PRNG that is network synced.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue