From 1f90a04623db5ccdefab5243d6909bed830fcb70 Mon Sep 17 00:00:00 2001 From: Sally Cochenour Date: Sun, 27 Jan 2019 17:52:53 -0500 Subject: [PATCH 1/9] Thin names for 9+ player intermission --- src/y_inter.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/y_inter.c b/src/y_inter.c index 021519e3..a8b1f740 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -474,16 +474,12 @@ void Y_IntermissionDrawer(void) V_DrawScaledPatch(x+16, y-4, 0, W_CachePatchName(va("K_CHILI%d", cursorframe+1), PU_CACHE)); } - if (!gutter) - strlcpy(strtime, data.match.name[i], 6); - else - STRBUFCPY(strtime, data.match.name[i]); + STRBUFCPY(strtime, data.match.name[i]); - V_DrawString(x+36, y, - ((data.match.num[i] == whiteplayer) - ? hilicol|V_ALLOWLOWERCASE - : V_ALLOWLOWERCASE), - strtime); + if (!gutter) + V_DrawThinString(x+36, y, ((data.match.num[i] == whiteplayer) ? hilicol : 0)|V_ALLOWLOWERCASE|V_6WIDTHSPACE, strtime); + else + V_DrawString(x+36, y, ((data.match.num[i] == whiteplayer) ? hilicol : 0)|V_ALLOWLOWERCASE, strtime); if (data.match.rankingsmode) { From e9887b267503f3a90e46583ae32b5c17d99fd7fb Mon Sep 17 00:00:00 2001 From: Sally Cochenour Date: Sun, 27 Jan 2019 21:11:49 -0500 Subject: [PATCH 2/9] Apply to TAB rankings too --- src/k_kart.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index ee50cfdd..0410a931 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -7097,19 +7097,15 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I continue; //ignore them. if (netgame // don't draw it offline - && tab[i].num != serverplayer) + && tab[i].num != serverplayer) HU_drawPing(x + ((i < 8) ? -19 : rightoffset + 13), y+2, playerpingtable[tab[i].num], false); - if (scorelines > 8) - strlcpy(strtime, tab[i].name, 6); - else - STRBUFCPY(strtime, tab[i].name); + STRBUFCPY(strtime, tab[i].name); - V_DrawString(x + 20, y, - ((tab[i].num == whiteplayer) - ? hilicol|V_ALLOWLOWERCASE - : V_ALLOWLOWERCASE), - strtime); + if (scorelines > 8) + V_DrawThinString(x + 20, y, ((tab[i].num == whiteplayer) ? hilicol : 0)|V_ALLOWLOWERCASE|V_6WIDTHSPACE, strtime); + else + V_DrawString(x + 20, y, ((tab[i].num == whiteplayer) ? hilicol : 0)|V_ALLOWLOWERCASE, strtime); if (players[tab[i].num].mo->color) { From dd2b895e800951436f881e345ba76aa9e5b578fc Mon Sep 17 00:00:00 2001 From: Sally Cochenour Date: Sun, 27 Jan 2019 21:57:18 -0500 Subject: [PATCH 3/9] Remove offroad leniency bias Everyone now has flat, equal 1-second leniency --- src/k_kart.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index f01f0d0b..5de534bb 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -1264,7 +1264,6 @@ static UINT8 K_CheckOffroadCollide(mobj_t *mo, sector_t *sec) */ static void K_UpdateOffroad(player_t *player) { - fixed_t kartweight = player->kartweight; fixed_t offroad; sector_t *nextsector = R_PointInSubsector( player->mo->x + player->mo->momx*2, player->mo->y + player->mo->momy*2)->sector; @@ -1284,13 +1283,11 @@ static void K_UpdateOffroad(player_t *player) if (offroadstrength) { if (K_CheckOffroadCollide(player->mo, player->mo->subsector->sector) && player->kartstuff[k_offroad] == 0) - player->kartstuff[k_offroad] = 16; + player->kartstuff[k_offroad] = (TICRATE/2); if (player->kartstuff[k_offroad] > 0) { - // 1872 is the magic number - 35 frames adds up to approximately 65536. 1872/4 = 468/3 = 156 - // A higher kart weight means you can stay offroad for longer without losing speed - offroad = (1872 + 5*156 - kartweight*156)*offroadstrength; + offroad = (FRACUNIT * offroadstrength) / TICRATE; //if (player->kartstuff[k_growshrinktimer] > 1) // grow slows down half as fast // offroad /= 2; From 8a97b28936d3d8ace0b7bd03b367ad736f8589bb Mon Sep 17 00:00:00 2001 From: Sally Cochenour Date: Sun, 27 Jan 2019 21:58:17 -0500 Subject: [PATCH 4/9] Wipeout slowdown timer is set to 20 tics if below, instead of adding up per bump. --- src/k_kart.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 5de534bb..b7029452 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -1211,8 +1211,8 @@ void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce, boolean solid) mobj1->player->kartstuff[k_justbumped] = bumptime; if (mobj1->player->kartstuff[k_spinouttimer]) { - mobj1->player->kartstuff[k_wipeoutslow] += wipeoutslowtime+1; - mobj1->player->kartstuff[k_spinouttimer] += wipeoutslowtime+1; + mobj1->player->kartstuff[k_wipeoutslow] = wipeoutslowtime+1; + mobj1->player->kartstuff[k_spinouttimer] = max(wipeoutslowtime+1, mobj1->player->kartstuff[k_spinouttimer]); } } @@ -1223,8 +1223,8 @@ void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce, boolean solid) mobj2->player->kartstuff[k_justbumped] = bumptime; if (mobj2->player->kartstuff[k_spinouttimer]) { - mobj2->player->kartstuff[k_wipeoutslow] += wipeoutslowtime+1; - mobj2->player->kartstuff[k_spinouttimer] += wipeoutslowtime+1; + mobj2->player->kartstuff[k_wipeoutslow] = wipeoutslowtime+1; + mobj2->player->kartstuff[k_spinouttimer] = max(wipeoutslowtime+1, mobj2->player->kartstuff[k_spinouttimer]); } } } From c53144ecd67d296534a42930dbff003644285ee6 Mon Sep 17 00:00:00 2001 From: Sally Cochenour Date: Sun, 27 Jan 2019 21:58:44 -0500 Subject: [PATCH 5/9] Wipeout slowdown is x2 strength --- src/k_kart.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index b7029452..12da394a 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -5429,6 +5429,8 @@ void K_MoveKartPlayer(player_t *player, boolean onground) player->mo->friction += 4608; if (player->speed > 0 && cmd->forwardmove < 0 && player->mo->friction == 59392) player->mo->friction += 1608; + + // Karma ice physics if (G_BattleGametype() && player->kartstuff[k_bumper] <= 0) { player->mo->friction += 1228; @@ -5448,11 +5450,13 @@ void K_MoveKartPlayer(player_t *player, boolean onground) if (player->mo->movefactor < 32) player->mo->movefactor = 32; } + + // Wipeout slowdown if (player->kartstuff[k_spinouttimer] && player->kartstuff[k_wipeoutslow]) { - player->mo->friction -= FixedMul(1228, player->kartstuff[k_offroad]); + player->mo->friction -= FixedMul(2456, player->kartstuff[k_offroad]); if (player->kartstuff[k_wipeoutslow] == 1) - player->mo->friction -= 4912; + player->mo->friction -= 9824; } K_KartDrift(player, onground); From 5518a19945f39533c5873219c224dfd06c62c024 Mon Sep 17 00:00:00 2001 From: Sally Cochenour Date: Sun, 27 Jan 2019 22:28:44 -0500 Subject: [PATCH 6/9] Wipeout slowdown in offroad is static --- src/k_kart.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/k_kart.c b/src/k_kart.c index 12da394a..d3685638 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -5454,7 +5454,8 @@ void K_MoveKartPlayer(player_t *player, boolean onground) // Wipeout slowdown if (player->kartstuff[k_spinouttimer] && player->kartstuff[k_wipeoutslow]) { - player->mo->friction -= FixedMul(2456, player->kartstuff[k_offroad]); + if (player->kartstuff[k_offroad]) + player->mo->friction -= 4912; if (player->kartstuff[k_wipeoutslow] == 1) player->mo->friction -= 9824; } From 0ef442c004d81496ee480522c0c1106a40adfc02 Mon Sep 17 00:00:00 2001 From: Sally Cochenour Date: Sun, 27 Jan 2019 23:18:40 -0500 Subject: [PATCH 7/9] Change offroad leniency from 1 second to 0.5 seconds, don't make friction more forgiving in offroad --- src/k_kart.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index d3685638..a54f8ef5 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -1287,7 +1287,7 @@ static void K_UpdateOffroad(player_t *player) if (player->kartstuff[k_offroad] > 0) { - offroad = (FRACUNIT * offroadstrength) / TICRATE; + offroad = (FRACUNIT * offroadstrength) / (TICRATE/2); //if (player->kartstuff[k_growshrinktimer] > 1) // grow slows down half as fast // offroad /= 2; @@ -5425,10 +5425,13 @@ void K_MoveKartPlayer(player_t *player, boolean onground) } // Friction - if (player->speed > 0 && cmd->forwardmove == 0 && player->mo->friction == 59392) - player->mo->friction += 4608; - if (player->speed > 0 && cmd->forwardmove < 0 && player->mo->friction == 59392) - player->mo->friction += 1608; + if (!player->kartstuff[k_offroad]) + { + if (player->speed > 0 && cmd->forwardmove == 0 && player->mo->friction == 59392) + player->mo->friction += 4608; + if (player->speed > 0 && cmd->forwardmove < 0 && player->mo->friction == 59392) + player->mo->friction += 1608; + } // Karma ice physics if (G_BattleGametype() && player->kartstuff[k_bumper] <= 0) From 38ca2ab98a1e595ff97a312e486b5c61e5097ca9 Mon Sep 17 00:00:00 2001 From: Sally Cochenour Date: Sun, 27 Jan 2019 23:25:03 -0500 Subject: [PATCH 8/9] Sparks can't be started in offroad --- src/k_kart.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index a54f8ef5..118da2c5 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -4667,8 +4667,6 @@ static void K_KartDrift(player_t *player, boolean onground) player->kartstuff[k_driftend] = 0; } - - // Incease/decrease the drift value to continue drifting in that direction if (player->kartstuff[k_spinouttimer] == 0 && player->kartstuff[k_jmp] == 1 && onground && player->kartstuff[k_drift] != 0) { @@ -4700,7 +4698,7 @@ static void K_KartDrift(player_t *player, boolean onground) // Disable drift-sparks until you're going fast enough if (player->kartstuff[k_getsparks] == 0) driftadditive = 0; - if (player->speed > minspeed*2) + if (player->speed > minspeed*2 && !player->kartstuff[k_offroad]) player->kartstuff[k_getsparks] = 1; // This spawns the drift sparks From 1e61cc6152061643833ada1c720d0b07ebcdb259 Mon Sep 17 00:00:00 2001 From: Sally Cochenour Date: Mon, 28 Jan 2019 14:12:08 -0500 Subject: [PATCH 9/9] Better cpusleep - Default to 1, which means potential for a 1-frame loss every once in a while but no longer a complete cpu hog - New minimum is 0, since -1 just did the exact same thing as 0. --- src/d_netcmd.c | 4 ++-- src/sdl/i_system.c | 2 +- src/sdl12/i_system.c | 2 +- src/win32/win_sys.c | 2 +- src/win32ce/win_sys.c | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 41f88ab9..775f2225 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -214,7 +214,7 @@ static CV_PossibleValue_t autobalance_cons_t[] = {{0, "MIN"}, {4, "MAX"}, {0, NU static CV_PossibleValue_t teamscramble_cons_t[] = {{0, "Off"}, {1, "Random"}, {2, "Points"}, {0, NULL}}; static CV_PossibleValue_t startingliveslimit_cons_t[] = {{1, "MIN"}, {99, "MAX"}, {0, NULL}}; -static CV_PossibleValue_t sleeping_cons_t[] = {{-1, "MIN"}, {1000/TICRATE, "MAX"}, {0, NULL}}; +static CV_PossibleValue_t sleeping_cons_t[] = {{0, "MIN"}, {1000/TICRATE, "MAX"}, {0, NULL}}; static CV_PossibleValue_t competitionboxes_cons_t[] = {{0, "Normal"}, {1, "Random"}, {2, "Teleports"}, {3, "None"}, {0, NULL}}; @@ -447,7 +447,7 @@ consvar_t cv_runscripts = {"runscripts", "Yes", 0, CV_YesNo, NULL, 0, NULL, NULL consvar_t cv_pause = {"pausepermission", "Server", CV_NETVAR, pause_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_mute = {"mute", "Off", CV_NETVAR|CV_CALL, CV_OnOff, Mute_OnChange, 0, NULL, NULL, 0, 0, NULL}; -consvar_t cv_sleep = {"cpusleep", "-1", CV_SAVE, sleeping_cons_t, NULL, -1, NULL, NULL, 0, 0, NULL}; +consvar_t cv_sleep = {"cpusleep", "1", CV_SAVE, sleeping_cons_t, NULL, -1, NULL, NULL, 0, 0, NULL}; INT16 gametype = GT_RACE; // SRB2kart boolean forceresetplayers = false; diff --git a/src/sdl/i_system.c b/src/sdl/i_system.c index 2154a070..f360072a 100644 --- a/src/sdl/i_system.c +++ b/src/sdl/i_system.c @@ -3018,7 +3018,7 @@ void I_StartupTimer(void) void I_Sleep(void) { - if (cv_sleep.value != -1) + if (cv_sleep.value > 0) SDL_Delay(cv_sleep.value); } diff --git a/src/sdl12/i_system.c b/src/sdl12/i_system.c index 0e5adbb4..d055a4ca 100644 --- a/src/sdl12/i_system.c +++ b/src/sdl12/i_system.c @@ -2914,7 +2914,7 @@ void I_StartupTimer(void) void I_Sleep(void) { #if !(defined (_arch_dreamcast) || defined (_XBOX)) - if (cv_sleep.value != -1) + if (cv_sleep.value > 0) SDL_Delay(cv_sleep.value); #endif } diff --git a/src/win32/win_sys.c b/src/win32/win_sys.c index 75aca68d..fa9d6d64 100644 --- a/src/win32/win_sys.c +++ b/src/win32/win_sys.c @@ -261,7 +261,7 @@ tic_t I_GetTime(void) void I_Sleep(void) { - if (cv_sleep.value != -1) + if (cv_sleep.value > 0) Sleep(cv_sleep.value); } diff --git a/src/win32ce/win_sys.c b/src/win32ce/win_sys.c index 3b6a4725..091171b5 100644 --- a/src/win32ce/win_sys.c +++ b/src/win32ce/win_sys.c @@ -265,7 +265,7 @@ tic_t I_GetTime(void) void I_Sleep(void) { - if (cv_sleep.value != -1) + if (cv_sleep.value > 0) Sleep(cv_sleep.value); }