From 6ae28c4cdbb424beaeb1dface9060b9d67ac3d97 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Sat, 4 Mar 2023 16:16:37 -0500 Subject: [PATCH 01/16] Add final position as a ranking requirement 1st is a large bonus, 2nd is a medium bonus, 3rd place is no bonus, and everything below is a penalty. This will help make Loser Valley grades never be above a C at most. --- src/k_hud.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/k_hud.c b/src/k_hud.c index 2ee8fa7e0..94b401618 100644 --- a/src/k_hud.c +++ b/src/k_hud.c @@ -4846,7 +4846,7 @@ static void K_DrawGPRankDebugger(void) default: { break; } } - V_DrawThinString(0, 80, V_SNAPTOTOP|V_SNAPTOLEFT|V_6WIDTHSPACE|V_ALLOWLOWERCASE|V_YELLOWMAP, + V_DrawThinString(0, 90, V_SNAPTOTOP|V_SNAPTOLEFT|V_6WIDTHSPACE|V_ALLOWLOWERCASE|V_YELLOWMAP, va(" ** FINAL GRADE: %c", gradeChar)); } From 63d156b9427205392ec093af74710466d33cd7a1 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Mon, 6 Mar 2023 00:46:43 -0500 Subject: [PATCH 02/16] Reduce waypoint radius for bots on turns --- src/k_bot.c | 65 +++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 61 insertions(+), 4 deletions(-) diff --git a/src/k_bot.c b/src/k_bot.c index cb0b57eb0..b76423438 100644 --- a/src/k_bot.c +++ b/src/k_bot.c @@ -634,6 +634,60 @@ fixed_t K_DistanceOfLineFromPoint(fixed_t v1x, fixed_t v1y, fixed_t v2x, fixed_t return R_PointToDist2(px, py, startx + vx, starty + vy); } +/*-------------------------------------------------- + static fixed_t K_GetBotWaypointRadius(waypoint_t *waypoint) + + Calculates a new waypoint radius size to use, making it + thinner depending on how harsh the turn is. + + Input Arguments:- + waypoint - Waypoint to retrieve the radius of. + + Return:- + New radius value. +--------------------------------------------------*/ +static fixed_t K_GetBotWaypointRadius(waypoint_t *const waypoint) +{ + static const fixed_t maxReduce = FRACUNIT/32; + static const angle_t maxDelta = ANGLE_45; + + fixed_t radius = waypoint->mobj->radius; + fixed_t reduce = FRACUNIT; + angle_t delta = 0; + + size_t i, j; + + for (i = 0; i < waypoint->numnextwaypoints; i++) + { + const waypoint_t *next = waypoint->nextwaypoints[i]; + const angle_t nextAngle = R_PointToAngle2( + waypoint->mobj->x, waypoint->mobj->y, + next->mobj->x, next->mobj->y + ); + + for (j = 0; j < waypoint->numprevwaypoints; j++) + { + const waypoint_t *prev = waypoint->prevwaypoints[j]; + const angle_t prevAngle = R_PointToAngle2( + prev->mobj->x, prev->mobj->y, + waypoint->mobj->x, waypoint->mobj->y + ); + + delta = max(delta, AngleDelta(nextAngle, prevAngle)); + } + } + + if (delta > maxDelta) + { + delta = maxDelta; + } + + reduce = FixedDiv(delta, maxDelta); + reduce = FRACUNIT + FixedMul(reduce, maxReduce - FRACUNIT); + + return FixedMul(radius, reduce); +} + /*-------------------------------------------------- static botprediction_t *K_CreateBotPrediction(player_t *player) @@ -695,6 +749,8 @@ static botprediction_t *K_CreateBotPrediction(player_t *player) { for (i = 0; i < pathtofinish.numnodes; i++) { + fixed_t radius = 0; + wp = (waypoint_t *)pathtofinish.array[i].nodedata; if (i == 0) @@ -716,9 +772,10 @@ static botprediction_t *K_CreateBotPrediction(player_t *player) radreduce = FRACUNIT >> 1; } - if (wp->mobj->radius < smallestradius) + radius = K_GetBotWaypointRadius(wp); + if (radius < smallestradius) { - smallestradius = wp->mobj->radius; + smallestradius = radius; } distanceleft -= disttonext; @@ -1386,7 +1443,7 @@ void K_BuildBotTiccmd(player_t *player, ticcmd_t *cmd) return; } - if (botController != NULL && (botController->args[1] & TMBOT_NOCONTROL)) // FIXME: UDMF-ify + if (botController != NULL && (botController->args[1] & TMBOT_NOCONTROL)) { // Disable bot controls entirely. return; @@ -1394,7 +1451,7 @@ void K_BuildBotTiccmd(player_t *player, ticcmd_t *cmd) destangle = player->mo->angle; - if (botController != NULL && (botController->args[1] & TMBOT_FORCEDIR)) // FIXME: UDMF-ify + if (botController != NULL && (botController->args[1] & TMBOT_FORCEDIR)) { const fixed_t dist = DEFAULT_WAYPOINT_RADIUS * player->mo->scale; From 9561ec69bfa3609cec6007bbd3b9a5c9bb5b48a2 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Mon, 6 Mar 2023 03:15:28 -0500 Subject: [PATCH 03/16] Give bots friction rubberband again --- src/k_kart.c | 20 +++++++++++++++++--- src/k_kart.h | 2 +- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 3231f47cd..44e57bb25 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -3453,7 +3453,7 @@ fixed_t K_GetNewSpeed(player_t *player) // Don't calculate the acceleration as ever being above top speed if (oldspeed > p_speed) oldspeed = p_speed; - newspeed = FixedDiv(FixedDiv(FixedMul(oldspeed, accelmax - p_accel) + FixedMul(p_speed, p_accel), accelmax), K_PlayerBaseFriction(ORIG_FRICTION)); + newspeed = FixedDiv(FixedDiv(FixedMul(oldspeed, accelmax - p_accel) + FixedMul(p_speed, p_accel), accelmax), K_PlayerBaseFriction(player, ORIG_FRICTION)); finalspeed = newspeed - oldspeed; @@ -10014,7 +10014,7 @@ static void K_AirFailsafe(player_t *player) // // K_PlayerBaseFriction // -fixed_t K_PlayerBaseFriction(fixed_t original) +fixed_t K_PlayerBaseFriction(player_t *player, fixed_t original) { fixed_t frict = original; @@ -10022,6 +10022,20 @@ fixed_t K_PlayerBaseFriction(fixed_t original) { frict -= FRACUNIT >> 4; } + else if (K_PlayerUsesBotMovement(player) == true) + { + // A bit extra friction to help them without drifting. + // Remove this line once they can drift. + frict -= FRACUNIT >> 5; + + // Bots gain more traction as they rubberband. + if (player->botvars.rubberband > FRACUNIT) + { + static const fixed_t extraFriction = FRACUNIT >> 5; + const fixed_t mul = player->botvars.rubberband - FRACUNIT; + frict -= FixedMul(extraFriction, mul); + } + } if (frict > FRACUNIT) { frict = FRACUNIT; } if (frict < 0) { frict = 0; } @@ -10034,7 +10048,7 @@ fixed_t K_PlayerBaseFriction(fixed_t original) // void K_AdjustPlayerFriction(player_t *player) { - const fixed_t prevfriction = K_PlayerBaseFriction(player->mo->friction); + const fixed_t prevfriction = K_PlayerBaseFriction(player, player->mo->friction); if (P_IsObjectOnGround(player->mo) == false) { diff --git a/src/k_kart.h b/src/k_kart.h index fc364624a..70ab93998 100644 --- a/src/k_kart.h +++ b/src/k_kart.h @@ -177,7 +177,7 @@ fixed_t K_3dKartMovement(player_t *player); boolean K_PlayerEBrake(player_t *player); SINT8 K_Sliptiding(player_t *player); boolean K_FastFallBounce(player_t *player); -fixed_t K_PlayerBaseFriction(fixed_t original); +fixed_t K_PlayerBaseFriction(player_t *player, fixed_t original); void K_AdjustPlayerFriction(player_t *player); void K_MoveKartPlayer(player_t *player, boolean onground); void K_CheckSpectateStatus(void); From 65b62e07c8cc6b8adc403ad9ce47c34bea99cfe1 Mon Sep 17 00:00:00 2001 From: AJ Martinez Date: Tue, 7 Mar 2023 03:20:41 -0700 Subject: [PATCH 04/16] Add sounds to slipide zip / wavedashing --- src/k_kart.c | 15 ++++++++++++++- src/sounds.c | 4 ++++ src/sounds.h | 5 +++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/src/k_kart.c b/src/k_kart.c index 6f89cf067..1b2696cb7 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -9411,6 +9411,9 @@ static void K_KartDrift(player_t *player, boolean onground) { if (K_IsLosingSliptideZip(player) && player->sliptideZip > 0) { + if (!S_SoundPlaying(player->mo, sfx_waved2)) + S_StartSound(player->mo, sfx_waved2); + S_StopSoundByID(player->mo, sfx_waved1); player->sliptideZipDelay++; if (player->sliptideZipDelay > TICRATE) { @@ -9439,9 +9442,16 @@ static void K_KartDrift(player_t *player, boolean onground) K_SpawnDriftBoostExplosion(player, 0); player->sliptideZip = 0; player->sliptideZipDelay = 0; - S_StartSound(player->mo, sfx_s3kb6); + S_StopSoundByID(player->mo, sfx_waved1); + S_StopSoundByID(player->mo, sfx_waved2); + S_StartSound(player->mo, sfx_waved3); } } + else + { + S_StopSoundByID(player->mo, sfx_waved1); + S_StopSoundByID(player->mo, sfx_waved2); + } player->aizdrifttilt -= player->aizdrifttilt / 4; player->aizdriftturn -= player->aizdriftturn / 4; @@ -9454,6 +9464,9 @@ static void K_KartDrift(player_t *player, boolean onground) else { player->sliptideZipDelay = 0; + S_StopSoundByID(player->mo, sfx_waved2); + if (!S_SoundPlaying(player->mo, sfx_waved1)) + S_StartSound(player->mo, sfx_waved1); } if (player->drift diff --git a/src/sounds.c b/src/sounds.c index 0fc59206a..33bd5bdbc 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -1131,6 +1131,10 @@ sfxinfo_t S_sfx[NUMSFX] = {"gate04", false, 32, 64, -1, NULL, 0, -1, -1, LUMPERROR, ""}, {"gate05", false, 32, 64, -1, NULL, 0, -1, -1, LUMPERROR, ""}, + {"waved1", false, 32, 64, -1, NULL, 0, -1, -1, LUMPERROR, ""}, + {"waved2", false, 32, 64, -1, NULL, 0, -1, -1, LUMPERROR, ""}, + {"waved3", false, 32, 64, -1, NULL, 0, -1, -1, LUMPERROR, ""}, + // Passing sounds {"pass01", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, {"pass02", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, diff --git a/src/sounds.h b/src/sounds.h index 46f1eedf8..a1d1e1707 100644 --- a/src/sounds.h +++ b/src/sounds.h @@ -1199,6 +1199,11 @@ typedef enum sfx_gate04, sfx_gate05, + // Wavedashing + sfx_waved1, + sfx_waved2, + sfx_waved3, + // Passing sounds sfx_pass01, sfx_pass02, From 3463456976b02896a19e69a8e96a0a6d2e7608fe Mon Sep 17 00:00:00 2001 From: AJ Martinez Date: Tue, 7 Mar 2023 04:58:17 -0700 Subject: [PATCH 05/16] Oni fixup gaiden Passive sound when holding wavedash (waved4), wavedash delay TICRATE -> TICRATE/2, wavedash delay pauses while driftboosting --- src/k_kart.c | 15 +++++++++++---- src/sounds.c | 1 + src/sounds.h | 3 ++- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 1b2696cb7..bd83df9cb 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -3110,7 +3110,7 @@ static void K_GetKartBoostPower(player_t *player) if (player->sliptideZipBoost) { // NB: This is intentionally under the 25% threshold required to initiate a sliptide - ADDBOOST(13*FRACUNIT/20, 4*FRACUNIT, 2*SLIPTIDEHANDLING/5); // + 65% top speed, + 400% acceleration, +20% handling + ADDBOOST(9*FRACUNIT/10, 4*FRACUNIT, 2*SLIPTIDEHANDLING/5); // + 90% top speed, + 400% acceleration, +20% handling } if (player->spindashboost) // Spindash boost @@ -4068,7 +4068,9 @@ static boolean K_IsLosingSliptideZip(player_t *player) { if (player->mo == NULL || P_MobjWasRemoved(player->mo) == true) return true; - if (!K_Sliptiding(player) && player->drift == 0 && P_IsObjectOnGround(player->mo) && player->sneakertimer == 0) + if (!K_Sliptiding(player) && player->drift == 0 + && P_IsObjectOnGround(player->mo) && player->sneakertimer == 0 + && player->driftboost == 0) return true; return false; } @@ -4113,7 +4115,7 @@ void K_UpdateSliptideZipIndicator(player_t *player) mobj->renderflags &= ~RF_DONTDRAW; UINT32 chargeFrame = 7 - min(7, player->sliptideZip / 10); - UINT32 decayFrame = min(7, player->sliptideZipDelay / 5); + UINT32 decayFrame = min(7, player->sliptideZipDelay / 2); if (max(chargeFrame, decayFrame) > mobj->frame) mobj->frame++; else if (max(chargeFrame, decayFrame) < mobj->frame) @@ -9414,8 +9416,9 @@ static void K_KartDrift(player_t *player, boolean onground) if (!S_SoundPlaying(player->mo, sfx_waved2)) S_StartSound(player->mo, sfx_waved2); S_StopSoundByID(player->mo, sfx_waved1); + S_StopSoundByID(player->mo, sfx_waved4); player->sliptideZipDelay++; - if (player->sliptideZipDelay > TICRATE) + if (player->sliptideZipDelay > TICRATE/2) { fixed_t maxZipPower = 2*FRACUNIT; fixed_t minZipPower = 1*FRACUNIT; @@ -9444,6 +9447,7 @@ static void K_KartDrift(player_t *player, boolean onground) player->sliptideZipDelay = 0; S_StopSoundByID(player->mo, sfx_waved1); S_StopSoundByID(player->mo, sfx_waved2); + S_StopSoundByID(player->mo, sfx_waved4); S_StartSound(player->mo, sfx_waved3); } } @@ -9451,6 +9455,8 @@ static void K_KartDrift(player_t *player, boolean onground) { S_StopSoundByID(player->mo, sfx_waved1); S_StopSoundByID(player->mo, sfx_waved2); + if (!S_SoundPlaying(player->mo, sfx_waved4) && player->sliptideZip > 0) + S_StartSound(player->mo, sfx_waved4); } player->aizdrifttilt -= player->aizdrifttilt / 4; @@ -9465,6 +9471,7 @@ static void K_KartDrift(player_t *player, boolean onground) { player->sliptideZipDelay = 0; S_StopSoundByID(player->mo, sfx_waved2); + S_StopSoundByID(player->mo, sfx_waved4); if (!S_SoundPlaying(player->mo, sfx_waved1)) S_StartSound(player->mo, sfx_waved1); } diff --git a/src/sounds.c b/src/sounds.c index 33bd5bdbc..636b0b0f3 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -1134,6 +1134,7 @@ sfxinfo_t S_sfx[NUMSFX] = {"waved1", false, 32, 64, -1, NULL, 0, -1, -1, LUMPERROR, ""}, {"waved2", false, 32, 64, -1, NULL, 0, -1, -1, LUMPERROR, ""}, {"waved3", false, 32, 64, -1, NULL, 0, -1, -1, LUMPERROR, ""}, + {"waved4", false, 32, 64, -1, NULL, 0, -1, -1, LUMPERROR, ""}, // Passing sounds {"pass01", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, diff --git a/src/sounds.h b/src/sounds.h index a1d1e1707..3a2e9ed5a 100644 --- a/src/sounds.h +++ b/src/sounds.h @@ -1203,7 +1203,8 @@ typedef enum sfx_waved1, sfx_waved2, sfx_waved3, - + sfx_waved4, + // Passing sounds sfx_pass01, sfx_pass02, From 06f583a15d55e6092aa72bb5aa16e568565402b9 Mon Sep 17 00:00:00 2001 From: AJ Martinez Date: Tue, 7 Mar 2023 05:57:01 -0700 Subject: [PATCH 06/16] Un-re-buff wavedash boost because tripwire --- src/k_kart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/k_kart.c b/src/k_kart.c index bd83df9cb..8cd3c60fe 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -3110,7 +3110,7 @@ static void K_GetKartBoostPower(player_t *player) if (player->sliptideZipBoost) { // NB: This is intentionally under the 25% threshold required to initiate a sliptide - ADDBOOST(9*FRACUNIT/10, 4*FRACUNIT, 2*SLIPTIDEHANDLING/5); // + 90% top speed, + 400% acceleration, +20% handling + ADDBOOST(8*FRACUNIT/10, 4*FRACUNIT, 2*SLIPTIDEHANDLING/5); // + 80% top speed, + 400% acceleration, +20% handling } if (player->spindashboost) // Spindash boost From da2aab1af19542778d1d654ab6b040965e3a0af5 Mon Sep 17 00:00:00 2001 From: AJ Martinez Date: Tue, 7 Mar 2023 06:08:20 -0700 Subject: [PATCH 07/16] Avoid sound iteration, if we can help it --- src/k_kart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/k_kart.c b/src/k_kart.c index 8cd3c60fe..368d4cb0c 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -9455,7 +9455,7 @@ static void K_KartDrift(player_t *player, boolean onground) { S_StopSoundByID(player->mo, sfx_waved1); S_StopSoundByID(player->mo, sfx_waved2); - if (!S_SoundPlaying(player->mo, sfx_waved4) && player->sliptideZip > 0) + if (player->sliptideZip > 0 && !S_SoundPlaying(player->mo, sfx_waved4)) S_StartSound(player->mo, sfx_waved4); } From afa62f240290732186c1a42aa1698186d41ef43a Mon Sep 17 00:00:00 2001 From: James R Date: Fri, 3 Mar 2023 03:36:29 -0800 Subject: [PATCH 08/16] I_Error if exchndl.dll is missing for Windows builds --- src/sdl/i_main.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/sdl/i_main.cpp b/src/sdl/i_main.cpp index 90b1a6a96..2efe4126b 100644 --- a/src/sdl/i_main.cpp +++ b/src/sdl/i_main.cpp @@ -202,14 +202,17 @@ static void InitLogging(void) static void init_exchndl() { HMODULE exchndl_module = LoadLibraryA("exchndl.dll"); - if (exchndl_module != NULL) + + if (exchndl_module == NULL) { - using PFN_ExcHndlInit = void(*)(void); - PFN_ExcHndlInit pfnExcHndlInit = reinterpret_cast( - GetProcAddress(exchndl_module, "ExcHndlInit")); - if (pfnExcHndlInit != NULL) - (pfnExcHndlInit)(); + I_Error("exchndl.dll or mgwhelp.dll is missing"); } + + using PFN_ExcHndlInit = void(*)(void); + PFN_ExcHndlInit pfnExcHndlInit = reinterpret_cast( + GetProcAddress(exchndl_module, "ExcHndlInit")); + if (pfnExcHndlInit != NULL) + (pfnExcHndlInit)(); } #endif From 6d530ec81003352d7b9d2956822ac885316c8efb Mon Sep 17 00:00:00 2001 From: James R Date: Tue, 7 Mar 2023 18:26:50 -0800 Subject: [PATCH 09/16] PARANOIA: snacpending negative error plays sfx_monch --- src/d_netcmd.c | 4 ++++ src/sounds.c | 2 ++ src/sounds.h | 2 ++ 3 files changed, 8 insertions(+) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index a1fae65f2..258521d27 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -1628,7 +1628,11 @@ static void Got_NameAndColor(UINT8 **cp, INT32 playernum) #ifdef PARANOIA if (snacpending[i] < 0) + { + S_StartSound(NULL, sfx_monch); + I_Sleep(1000); // let the monch play out for 1 second I_Error("snacpending[%d] negative!", i); + } #endif localplayer = i; diff --git a/src/sounds.c b/src/sounds.c index 636b0b0f3..dcaf42e76 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -1180,6 +1180,8 @@ sfxinfo_t S_sfx[NUMSFX] = {"clawk1", false, 64, 16, -1, NULL, 0, -1, -1, LUMPERROR, ""}, // SF_X8AWAYSOUND {"clawk2", false, 64, 16, -1, NULL, 0, -1, -1, LUMPERROR, ""}, // SF_X8AWAYSOUND + {"monch", false, 255, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, + // SRB2Kart - Engine sounds // Engine class A {"krta00", false, 48, 65, -1, NULL, 0, -1, -1, LUMPERROR, ""}, diff --git a/src/sounds.h b/src/sounds.h index 3a2e9ed5a..221abd92e 100644 --- a/src/sounds.h +++ b/src/sounds.h @@ -1249,6 +1249,8 @@ typedef enum sfx_clawk1, sfx_clawk2, + sfx_monch, + // Next up: UNIQUE ENGINE SOUNDS! Hoooooo boy... // Engine class A - Low Speed, Low Weight sfx_krta00, From 6d983852d9df4be65435bbe733a9d14712a9565c Mon Sep 17 00:00:00 2001 From: AJ Martinez Date: Wed, 8 Mar 2023 15:58:56 -0700 Subject: [PATCH 10/16] Fix null ref in eggman transfer --- src/p_map.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index a02a5191d..07241dccb 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -1412,12 +1412,15 @@ static BlockItReturn_t PIT_CheckThing(mobj_t *thing) K_PvPTouchDamage(tm.thing, thing); } - if (thing->player->eggmanexplode) + if (!P_MobjWasRemoved(thing) && !P_MobjWasRemoved(tm.thing)) { - K_EggmanTransfer(thing->player, tm.thing->player); - } else if (tm.thing->player->eggmanexplode) - { - K_EggmanTransfer(tm.thing->player, thing->player); + if (thing->player->eggmanexplode) + { + K_EggmanTransfer(thing->player, tm.thing->player); + } else if (tm.thing->player->eggmanexplode) + { + K_EggmanTransfer(tm.thing->player, thing->player); + } } return BMIT_CONTINUE; From d8670bae2070f7679a7372f94418f5fb88b963a2 Mon Sep 17 00:00:00 2001 From: AJ Martinez Date: Wed, 8 Mar 2023 16:58:15 -0700 Subject: [PATCH 11/16] Fix nonfunctional wizard guard for wizards --- src/p_map.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index 07241dccb..eac1f59e2 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -1397,6 +1397,17 @@ static BlockItReturn_t PIT_CheckThing(mobj_t *thing) return BMIT_CONTINUE; } + if (!P_MobjWasRemoved(thing) && !P_MobjWasRemoved(tm.thing)) + { + if (thing->player->eggmanexplode) + { + K_EggmanTransfer(thing->player, tm.thing->player); + } else if (tm.thing->player->eggmanexplode) + { + K_EggmanTransfer(tm.thing->player, thing->player); + } + } + // The bump has to happen last if (P_IsObjectOnGround(thing) && tm.thing->momz < 0 && tm.thing->player->trickpanel) { @@ -1412,17 +1423,6 @@ static BlockItReturn_t PIT_CheckThing(mobj_t *thing) K_PvPTouchDamage(tm.thing, thing); } - if (!P_MobjWasRemoved(thing) && !P_MobjWasRemoved(tm.thing)) - { - if (thing->player->eggmanexplode) - { - K_EggmanTransfer(thing->player, tm.thing->player); - } else if (tm.thing->player->eggmanexplode) - { - K_EggmanTransfer(tm.thing->player, thing->player); - } - } - return BMIT_CONTINUE; } else if (thing->type == MT_SPECIAL_UFO) From 23b04832ad642273a0499ed24f4164bde411f2d3 Mon Sep 17 00:00:00 2001 From: VelocitOni Date: Wed, 8 Mar 2023 22:02:24 -0500 Subject: [PATCH 12/16] Buff Spikes Both Vertical and Wallspikes size and increase, vertical spikes tumble, speed is now TICRATE instead of 2*TICRATE --- src/info.c | 4 ++-- src/p_map.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/info.c b/src/info.c index cb00a3bff..60516c822 100644 --- a/src/info.c +++ b/src/info.c @@ -8880,8 +8880,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_SPIKED2, // xdeathstate sfx_mspogo, // deathsound 2*TICRATE, // speed - 8*FRACUNIT, // radius - 32*FRACUNIT, // height + 14*FRACUNIT, // radius + 64*FRACUNIT, // height 0, // display offset 4, // mass 0, // damage diff --git a/src/p_map.c b/src/p_map.c index a02a5191d..07dafc620 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -1257,11 +1257,11 @@ static BlockItReturn_t PIT_CheckThing(mobj_t *thing) { if (thing->z + thing->height <= tm.thing->z + FixedMul(FRACUNIT, tm.thing->scale) && thing->z + thing->height + thing->momz >= tm.thing->z + FixedMul(FRACUNIT, tm.thing->scale) + tm.thing->momz) - P_DamageMobj(thing, tm.thing, tm.thing, 1, DMG_NORMAL); + P_DamageMobj(thing, tm.thing, tm.thing, 1, DMG_TUMBLE); } else if (thing->z >= tm.thing->z + tm.thing->height - FixedMul(FRACUNIT, tm.thing->scale) && thing->z + thing->momz <= tm.thing->z + tm.thing->height - FixedMul(FRACUNIT, tm.thing->scale) + tm.thing->momz) - P_DamageMobj(thing, tm.thing, tm.thing, 1, DMG_NORMAL); + P_DamageMobj(thing, tm.thing, tm.thing, 1, DMG_TUMBLE); } else if (thing->type == MT_SPIKE && thing->flags & MF_SOLID && tm.thing->player) // unfortunate player falls into spike?! { @@ -1269,11 +1269,11 @@ static BlockItReturn_t PIT_CheckThing(mobj_t *thing) { if (tm.thing->z + tm.thing->height <= thing->z - FixedMul(FRACUNIT, thing->scale) && tm.thing->z + tm.thing->height + tm.thing->momz >= thing->z - FixedMul(FRACUNIT, thing->scale)) - P_DamageMobj(tm.thing, thing, thing, 1, DMG_NORMAL); + P_DamageMobj(tm.thing, thing, thing, 1, DMG_TUMBLE); } else if (tm.thing->z >= thing->z + thing->height + FixedMul(FRACUNIT, thing->scale) && tm.thing->z + tm.thing->momz <= thing->z + thing->height + FixedMul(FRACUNIT, thing->scale)) - P_DamageMobj(tm.thing, thing, thing, 1, DMG_NORMAL); + P_DamageMobj(tm.thing, thing, thing, 1, DMG_TUMBLE); } if (tm.thing->type == MT_WALLSPIKE && tm.thing->flags & MF_SOLID && thing->player) // wall spike impales player From cd2dd1315a4627973673ae8664bf0a9e028b6b5e Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Mon, 6 Mar 2023 00:46:43 -0500 Subject: [PATCH 13/16] Reduce waypoint radius for bots on turns --- src/k_bot.c | 65 +++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 61 insertions(+), 4 deletions(-) diff --git a/src/k_bot.c b/src/k_bot.c index cb0b57eb0..b76423438 100644 --- a/src/k_bot.c +++ b/src/k_bot.c @@ -634,6 +634,60 @@ fixed_t K_DistanceOfLineFromPoint(fixed_t v1x, fixed_t v1y, fixed_t v2x, fixed_t return R_PointToDist2(px, py, startx + vx, starty + vy); } +/*-------------------------------------------------- + static fixed_t K_GetBotWaypointRadius(waypoint_t *waypoint) + + Calculates a new waypoint radius size to use, making it + thinner depending on how harsh the turn is. + + Input Arguments:- + waypoint - Waypoint to retrieve the radius of. + + Return:- + New radius value. +--------------------------------------------------*/ +static fixed_t K_GetBotWaypointRadius(waypoint_t *const waypoint) +{ + static const fixed_t maxReduce = FRACUNIT/32; + static const angle_t maxDelta = ANGLE_45; + + fixed_t radius = waypoint->mobj->radius; + fixed_t reduce = FRACUNIT; + angle_t delta = 0; + + size_t i, j; + + for (i = 0; i < waypoint->numnextwaypoints; i++) + { + const waypoint_t *next = waypoint->nextwaypoints[i]; + const angle_t nextAngle = R_PointToAngle2( + waypoint->mobj->x, waypoint->mobj->y, + next->mobj->x, next->mobj->y + ); + + for (j = 0; j < waypoint->numprevwaypoints; j++) + { + const waypoint_t *prev = waypoint->prevwaypoints[j]; + const angle_t prevAngle = R_PointToAngle2( + prev->mobj->x, prev->mobj->y, + waypoint->mobj->x, waypoint->mobj->y + ); + + delta = max(delta, AngleDelta(nextAngle, prevAngle)); + } + } + + if (delta > maxDelta) + { + delta = maxDelta; + } + + reduce = FixedDiv(delta, maxDelta); + reduce = FRACUNIT + FixedMul(reduce, maxReduce - FRACUNIT); + + return FixedMul(radius, reduce); +} + /*-------------------------------------------------- static botprediction_t *K_CreateBotPrediction(player_t *player) @@ -695,6 +749,8 @@ static botprediction_t *K_CreateBotPrediction(player_t *player) { for (i = 0; i < pathtofinish.numnodes; i++) { + fixed_t radius = 0; + wp = (waypoint_t *)pathtofinish.array[i].nodedata; if (i == 0) @@ -716,9 +772,10 @@ static botprediction_t *K_CreateBotPrediction(player_t *player) radreduce = FRACUNIT >> 1; } - if (wp->mobj->radius < smallestradius) + radius = K_GetBotWaypointRadius(wp); + if (radius < smallestradius) { - smallestradius = wp->mobj->radius; + smallestradius = radius; } distanceleft -= disttonext; @@ -1386,7 +1443,7 @@ void K_BuildBotTiccmd(player_t *player, ticcmd_t *cmd) return; } - if (botController != NULL && (botController->args[1] & TMBOT_NOCONTROL)) // FIXME: UDMF-ify + if (botController != NULL && (botController->args[1] & TMBOT_NOCONTROL)) { // Disable bot controls entirely. return; @@ -1394,7 +1451,7 @@ void K_BuildBotTiccmd(player_t *player, ticcmd_t *cmd) destangle = player->mo->angle; - if (botController != NULL && (botController->args[1] & TMBOT_FORCEDIR)) // FIXME: UDMF-ify + if (botController != NULL && (botController->args[1] & TMBOT_FORCEDIR)) { const fixed_t dist = DEFAULT_WAYPOINT_RADIUS * player->mo->scale; From d7256aa5f6a4adeecc62d621913f2245b3268d32 Mon Sep 17 00:00:00 2001 From: Sally Coolatta Date: Mon, 6 Mar 2023 03:15:28 -0500 Subject: [PATCH 14/16] Give bots friction rubberband again --- src/k_kart.c | 20 +++++++++++++++++--- src/k_kart.h | 2 +- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 6f89cf067..df282cd2b 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -3467,7 +3467,7 @@ fixed_t K_GetNewSpeed(player_t *player) // Don't calculate the acceleration as ever being above top speed if (oldspeed > p_speed) oldspeed = p_speed; - newspeed = FixedDiv(FixedDiv(FixedMul(oldspeed, accelmax - p_accel) + FixedMul(p_speed, p_accel), accelmax), K_PlayerBaseFriction(ORIG_FRICTION)); + newspeed = FixedDiv(FixedDiv(FixedMul(oldspeed, accelmax - p_accel) + FixedMul(p_speed, p_accel), accelmax), K_PlayerBaseFriction(player, ORIG_FRICTION)); finalspeed = newspeed - oldspeed; @@ -10189,7 +10189,7 @@ static void K_AirFailsafe(player_t *player) // // K_PlayerBaseFriction // -fixed_t K_PlayerBaseFriction(fixed_t original) +fixed_t K_PlayerBaseFriction(player_t *player, fixed_t original) { fixed_t frict = original; @@ -10197,6 +10197,20 @@ fixed_t K_PlayerBaseFriction(fixed_t original) { frict -= FRACUNIT >> 4; } + else if (K_PlayerUsesBotMovement(player) == true) + { + // A bit extra friction to help them without drifting. + // Remove this line once they can drift. + frict -= FRACUNIT >> 5; + + // Bots gain more traction as they rubberband. + if (player->botvars.rubberband > FRACUNIT) + { + static const fixed_t extraFriction = FRACUNIT >> 5; + const fixed_t mul = player->botvars.rubberband - FRACUNIT; + frict -= FixedMul(extraFriction, mul); + } + } if (frict > FRACUNIT) { frict = FRACUNIT; } if (frict < 0) { frict = 0; } @@ -10209,7 +10223,7 @@ fixed_t K_PlayerBaseFriction(fixed_t original) // void K_AdjustPlayerFriction(player_t *player) { - const fixed_t prevfriction = K_PlayerBaseFriction(player->mo->friction); + const fixed_t prevfriction = K_PlayerBaseFriction(player, player->mo->friction); if (P_IsObjectOnGround(player->mo) == false) { diff --git a/src/k_kart.h b/src/k_kart.h index 381395155..c789eb98d 100644 --- a/src/k_kart.h +++ b/src/k_kart.h @@ -179,7 +179,7 @@ fixed_t K_3dKartMovement(player_t *player); boolean K_PlayerEBrake(player_t *player); SINT8 K_Sliptiding(player_t *player); boolean K_FastFallBounce(player_t *player); -fixed_t K_PlayerBaseFriction(fixed_t original); +fixed_t K_PlayerBaseFriction(player_t *player, fixed_t original); void K_AdjustPlayerFriction(player_t *player); void K_MoveKartPlayer(player_t *player, boolean onground); void K_CheckSpectateStatus(void); From 85c492e848463a6e6b6b2bcc4572273854c068f3 Mon Sep 17 00:00:00 2001 From: AJ Martinez Date: Thu, 9 Mar 2023 02:01:57 -0700 Subject: [PATCH 15/16] Wavedashing no longer puts everyone in your netgame into a hurricane --- src/k_kart.c | 8 ++++---- src/sounds.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 368d4cb0c..627d7411b 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -9414,7 +9414,7 @@ static void K_KartDrift(player_t *player, boolean onground) if (K_IsLosingSliptideZip(player) && player->sliptideZip > 0) { if (!S_SoundPlaying(player->mo, sfx_waved2)) - S_StartSound(player->mo, sfx_waved2); + S_StartSoundAtVolume(player->mo, sfx_waved2, 255/2); // Losing combo time, going to boost S_StopSoundByID(player->mo, sfx_waved1); S_StopSoundByID(player->mo, sfx_waved4); player->sliptideZipDelay++; @@ -9448,7 +9448,7 @@ static void K_KartDrift(player_t *player, boolean onground) S_StopSoundByID(player->mo, sfx_waved1); S_StopSoundByID(player->mo, sfx_waved2); S_StopSoundByID(player->mo, sfx_waved4); - S_StartSound(player->mo, sfx_waved3); + S_StartSoundAtVolume(player->mo, sfx_waved3, 2*255/3); // Boost } } else @@ -9456,7 +9456,7 @@ static void K_KartDrift(player_t *player, boolean onground) S_StopSoundByID(player->mo, sfx_waved1); S_StopSoundByID(player->mo, sfx_waved2); if (player->sliptideZip > 0 && !S_SoundPlaying(player->mo, sfx_waved4)) - S_StartSound(player->mo, sfx_waved4); + S_StartSoundAtVolume(player->mo, sfx_waved4, 2*255/5); // Passive woosh } player->aizdrifttilt -= player->aizdrifttilt / 4; @@ -9473,7 +9473,7 @@ static void K_KartDrift(player_t *player, boolean onground) S_StopSoundByID(player->mo, sfx_waved2); S_StopSoundByID(player->mo, sfx_waved4); if (!S_SoundPlaying(player->mo, sfx_waved1)) - S_StartSound(player->mo, sfx_waved1); + S_StartSoundAtVolume(player->mo, sfx_waved1, 255/2); // Charging } if (player->drift diff --git a/src/sounds.c b/src/sounds.c index dcaf42e76..4e369edd7 100644 --- a/src/sounds.c +++ b/src/sounds.c @@ -1131,10 +1131,10 @@ sfxinfo_t S_sfx[NUMSFX] = {"gate04", false, 32, 64, -1, NULL, 0, -1, -1, LUMPERROR, ""}, {"gate05", false, 32, 64, -1, NULL, 0, -1, -1, LUMPERROR, ""}, - {"waved1", false, 32, 64, -1, NULL, 0, -1, -1, LUMPERROR, ""}, - {"waved2", false, 32, 64, -1, NULL, 0, -1, -1, LUMPERROR, ""}, + {"waved1", false, 32, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, + {"waved2", false, 32, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, {"waved3", false, 32, 64, -1, NULL, 0, -1, -1, LUMPERROR, ""}, - {"waved4", false, 32, 64, -1, NULL, 0, -1, -1, LUMPERROR, ""}, + {"waved4", false, 32, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, // Passing sounds {"pass01", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""}, From 43991dd798b567053d1091f05da12fc339f9a85c Mon Sep 17 00:00:00 2001 From: SteelT Date: Fri, 10 Mar 2023 21:43:51 -0500 Subject: [PATCH 16/16] Auto load altmusic.pk3 on startup --- src/d_main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/d_main.c b/src/d_main.c index 26adaf72e..613f528a1 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -1165,6 +1165,7 @@ static void IdentifyVersion(void) MUSICTEST("sounds.pk3") MUSICTEST("music.pk3") + MUSICTEST("altmusic.pk3") #undef MUSICTEST