From 2ec0fdcc46350395a5911a37a8f739a8a834b0de Mon Sep 17 00:00:00 2001 From: Antonio Martinez Date: Sun, 22 Jun 2025 18:54:15 -0400 Subject: [PATCH 1/4] Refactor EXP logic to reuse math in minmax calcs --- src/k_kart.c | 98 +++++++++++++++++++++++++++------------------------- src/k_kart.h | 2 +- 2 files changed, 52 insertions(+), 48 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 3cda6c47a..aedc6ac0b 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -15964,18 +15964,11 @@ boolean K_PlayerCanUseItem(player_t *player) return (player->mo->health > 0 && !player->spectator && !P_PlayerInPain(player) && !mapreset && leveltime > introtime); } -fixed_t K_GetGradingFactorAdjustment(player_t *player) +static UINT8 K_Opponents(player_t *player) { - fixed_t power = EXP_POWER; // adjust to change overall xp volatility - const fixed_t stablerate = EXP_STABLERATE; // how low is your placement before losing XP? 4*FRACUNIT/10 = top 40% of race will gain - fixed_t result = 0; + UINT8 opponents = 0; // players we are competing against - if (g_teamplay) - power = 3 * power / 4; - - INT32 live_players = 0; // players we are competing against - - for (INT32 i = 0; i < MAXPLAYERS; i++) + for (UINT8 i = 0; i < MAXPLAYERS; i++) { if (!playeringame[i] || players[i].spectator || player == players+i) continue; @@ -15986,13 +15979,42 @@ fixed_t K_GetGradingFactorAdjustment(player_t *player) continue; } - live_players++; + opponents++; } - if (live_players < 8) - { - power += (8 - live_players) * power/4; - } + return opponents; +} + +static fixed_t K_EXPPower(player_t *player) +{ + fixed_t power = EXP_POWER; // adjust to change overall xp volatility + UINT8 opponents = K_Opponents(player); + + if (g_teamplay) + power = 3 * power / 4; + + if (opponents < 8) + power += (8 - opponents) * power/4; + + return power; +} + +static fixed_t K_EXPGainPerWin(player_t *player) +{ + return K_EXPPower(player); +} + +static fixed_t K_EXPDrainPerCheckpoint(player_t *player) +{ + // EXP_STABLERATE: How low do you have to place before losing XP? 4*FRACUNIT/10 = top 40% of race gains, 60% loses. + UINT8 opponents = K_Opponents(player); + fixed_t power = K_EXPPower(player); + return FixedMul(power, FixedMul(opponents*FRACUNIT, FRACUNIT - EXP_STABLERATE)); +} + +fixed_t K_GetGradingFactorAdjustment(player_t *player) +{ + fixed_t result = 0; // Increase XP for each player you're beating... for (INT32 i = 0; i < MAXPLAYERS; i++) @@ -16007,49 +16029,31 @@ fixed_t K_GetGradingFactorAdjustment(player_t *player) } if (player->position < players[i].position) - result += power; + result += K_EXPGainPerWin(player); } // ...then take all of the XP you could possibly have earned, // and lose it proportional to the stable rate. If you're below // the stable threshold, this results in you losing XP. - result -= FixedMul(power, FixedMul(live_players*FRACUNIT, FRACUNIT - stablerate)); + result -= K_EXPDrainPerCheckpoint(player); return result; } -fixed_t K_GetGradingFactorMinMax(UINT32 gradingpointnum, boolean max) +fixed_t K_GetGradingFactorMinMax(player_t *player, boolean max) { - // Create a dummy player structure for the theoretical last-place player - player_t dummy_player; - memset(&dummy_player, 0, sizeof(player_t)); - dummy_player.gradingfactor = FRACUNIT; // Start at 1.0 + fixed_t factor = FRACUNIT; // Starting EXP. + UINT8 opponents = K_Opponents(player); + UINT8 winning = (max) ? opponents : 0; - if (G_GametypeHasTeams()) + for (UINT8 i = 0; i < player->gradingpointnum; i++) // For each gradingpoint you've reached... { - const UINT8 orange_count = G_CountTeam(TEAM_ORANGE); - const UINT8 blue_count = G_CountTeam(TEAM_BLUE); - if (orange_count <= blue_count) - { - dummy_player.team = TEAM_ORANGE; - } - else - { - dummy_player.team = TEAM_BLUE; - } - dummy_player.position = max ? 0 : D_NumPlayersInRace() + 1; // Ensures that all enemy players are counted, and our dummy won't overlap + for (UINT8 j = 0; j < winning; j++) + factor += K_EXPGainPerWin(player); // If max, increase EXP for each player you could have been beating. + factor -= K_EXPDrainPerCheckpoint(player); // Then, drain like usual. } - else - { - dummy_player.position = max ? 1 : D_NumPlayersInRace(); - } - - // Apply the adjustment for each grading point - for (UINT32 i = 0; i < gradingpointnum; i++) - { - dummy_player.gradingfactor += K_GetGradingFactorAdjustment(&dummy_player); - } - return dummy_player.gradingfactor; + + return factor; } UINT16 K_GetEXP(player_t *player) @@ -16057,8 +16061,8 @@ UINT16 K_GetEXP(player_t *player) UINT32 numgradingpoints = K_GetNumGradingPoints(); UINT16 targetminexp = (MINEXP*player->gradingpointnum/max(1,numgradingpoints)); // about what a last place player should be at this stage of the race UINT16 targetexp = (MAXEXP*player->gradingpointnum/max(1,numgradingpoints)); // about what a 1.0 factor should be at this stage of the race - fixed_t factormin = K_GetGradingFactorMinMax(player->gradingpointnum, false); - fixed_t factormax = K_GetGradingFactorMinMax(player->gradingpointnum, true); + fixed_t factormin = K_GetGradingFactorMinMax(player, false); + fixed_t factormax = K_GetGradingFactorMinMax(player, true); fixed_t clampedfactor = max(factormin, min(factormax, player->gradingfactor)); fixed_t range = factormax - factormin; fixed_t normalizedfactor = FixedDiv(clampedfactor - factormin, range); diff --git a/src/k_kart.h b/src/k_kart.h index ff269dbb9..9d9f3fdf8 100644 --- a/src/k_kart.h +++ b/src/k_kart.h @@ -325,7 +325,7 @@ boolean K_ThunderDome(void); boolean K_PlayerCanUseItem(player_t *player); fixed_t K_GetGradingFactorAdjustment(player_t *player); -fixed_t K_GetGradingFactorMinMax(UINT32 gradingpointnum, boolean max); +fixed_t K_GetGradingFactorMinMax(player_t *player, boolean max); UINT16 K_GetEXP(player_t *player); UINT32 K_GetNumGradingPoints(void); From bc328e50403481779e1114003bc9347ca1cf046d Mon Sep 17 00:00:00 2001 From: Antonio Martinez Date: Sun, 22 Jun 2025 19:10:46 -0400 Subject: [PATCH 2/4] Avoid duplicated opponents check --- src/k_kart.c | 42 +++++++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index aedc6ac0b..858db0b12 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -15964,22 +15964,32 @@ boolean K_PlayerCanUseItem(player_t *player) return (player->mo->health > 0 && !player->spectator && !P_PlayerInPain(player) && !mapreset && leveltime > introtime); } +// === +// THE EXP ZONE +// === + +static boolean K_IsValidOpponent(player_t *me, player_t *them) +{ + UINT8 i = (them - players); + + if (!playeringame[i] || players[i].spectator) + return false; + if (me == them) + return false; + if (G_SameTeam(me, them)) + return false; + + return true; +} + static UINT8 K_Opponents(player_t *player) { UINT8 opponents = 0; // players we are competing against for (UINT8 i = 0; i < MAXPLAYERS; i++) { - if (!playeringame[i] || players[i].spectator || player == players+i) - continue; - - if (G_SameTeam(player, &players[i]) == true) - { - // You don't win/lose against your teammates. - continue; - } - - opponents++; + if (K_IsValidOpponent(player, &players[i])) + opponents++; } return opponents; @@ -16019,15 +16029,9 @@ fixed_t K_GetGradingFactorAdjustment(player_t *player) // Increase XP for each player you're beating... for (INT32 i = 0; i < MAXPLAYERS; i++) { - if (!playeringame[i] || players[i].spectator || player == players+i) + if (!K_IsValidOpponent(player, &players[i])) continue; - if (G_SameTeam(player, &players[i]) == true) - { - // You don't win/lose against your teammates. - continue; - } - if (player->position < players[i].position) result += K_EXPGainPerWin(player); } @@ -16084,6 +16088,10 @@ UINT32 K_GetNumGradingPoints(void) return numlaps * (1 + Obj_GetCheckpointCount()); } +// === +// END EXP ZONE +// === + void K_BotHitPenalty(player_t *player) { if (K_PlayerUsesBotMovement(player)) From 092f8a63e6ab396e4ee1c33cb0990b61471effe2 Mon Sep 17 00:00:00 2001 From: Ashnal Date: Sun, 22 Jun 2025 23:12:34 -0400 Subject: [PATCH 3/4] New Rescale functions First use in cleanup of K_GetEXP --- src/k_kart.c | 20 +++++------ src/m_easing.c | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++ src/m_easing.h | 3 ++ 3 files changed, 101 insertions(+), 12 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 858db0b12..84c2cceae 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -16063,20 +16063,16 @@ fixed_t K_GetGradingFactorMinMax(player_t *player, boolean max) UINT16 K_GetEXP(player_t *player) { UINT32 numgradingpoints = K_GetNumGradingPoints(); - UINT16 targetminexp = (MINEXP*player->gradingpointnum/max(1,numgradingpoints)); // about what a last place player should be at this stage of the race - UINT16 targetexp = (MAXEXP*player->gradingpointnum/max(1,numgradingpoints)); // about what a 1.0 factor should be at this stage of the race + fixed_t targetminexp = (MINEXP*player->gradingpointnum<gradingpointnum<gradingfactor)); - fixed_t range = factormax - factormin; - fixed_t normalizedfactor = FixedDiv(clampedfactor - factormin, range); - fixed_t easedexp = Easing_Linear(normalizedfactor, targetminexp, targetexp); - // fixed_t easedexp = Easing_Linear(normalizedfactor, MINEXP*FRACUNIT, MAXEXP*FRACUNIT); - UINT16 exp = easedexp; - // CONS_Printf("Player %s numgradingpoints=%d targetminexp=%d targetexp=%d factormin=%.2f factormax=%.2f clampedfactor=%.2f normalizedfactor=%.2f easedexp=%d\n", - // player_names[player - players], numgradingpoints, targetminexp, targetexp, FIXED_TO_FLOAT(factormin), FIXED_TO_FLOAT(factormax), - // FIXED_TO_FLOAT(clampedfactor), FIXED_TO_FLOAT(normalizedfactor), easedexp); - // UINT16 exp = (player->gradingfactor*100)>>FRACBITS; + + UINT16 exp = FixedRescale(player->gradingfactor, factormin, factormax, Easing_Linear, targetminexp, targetmaxexp)>>FRACBITS; + + // CONS_Printf("Player %s numgradingpoints=%d gradingpoint=%d targetminexp=%d targetmaxexp=%d factor=%.2f factormin=%.2f factormax=%.2f exp=%d\n", + // player_names[player - players], numgradingpoints, player->gradingpointnum, targetminexp, targetmaxexp, FIXED_TO_FLOAT(player->gradingfactor), FIXED_TO_FLOAT(factormin), FIXED_TO_FLOAT(factormax), exp); + return exp; } diff --git a/src/m_easing.c b/src/m_easing.c index ef48abe51..e1e225ecd 100644 --- a/src/m_easing.c +++ b/src/m_easing.c @@ -430,3 +430,93 @@ const char *easing_funcnames[EASE_MAX] = #undef COMMA #undef EASINGFUNC + +// ================== +// FEATURE RESCALING +// ================== + +/*-------------------------------------------------- + fixed_t Rescale(fixed_t value, fixed_t inmin, fixed_t inmax, easingfunc_t easing_func, fixed_t outmin, fixed_t outmax) + + Rescales a feature value from [min, max] to [start, end] using + a custom easing function pointer. + + Input Arguments:- + value - The input value to rescale + inmin - Minimum value of the input range + inmax - Maximum value of the input range + easing_func - Pointer to the easing function to use + outmin - Start value of the output range + outmax - End value of the output range + + Return:- + The rescaled value using the specified easing function. +--------------------------------------------------*/ +fixed_t FixedRescale(fixed_t value, fixed_t inmin, fixed_t inmax, easingfunc_t easing_func, fixed_t outmin, fixed_t outmax) +{ + // Handle edge case where min == max + if (inmin == inmax) + return outmin; + + // Clamp the input value to the range + max(inmin, min(inmax, value)); + + // Normalize the value to [0, FRACUNIT] range + fixed_t t = FixedDiv(value - inmin, inmax - inmin); + + // Apply the easing function if provided + if (easing_func != NULL) + { + return easing_func(t, outmin, outmax); + } + + // Fallback to linear if no function provided + return Easing_Linear(t, outmin, outmax); +} + +/*-------------------------------------------------- + INT16 IntRescale(INT16 value, INT16 inmin, INT16 inmax, easingfunc_t easing_func, INT16 outmin, INT16 outmax) + + Rescales a feature value from [min, max] to [start, end] using + a custom easing function pointer. + Can only take in up to INT16 because it uses fixed_t internally + + Input Arguments:- + value - The input value to rescale + inmin - Minimum value of the input range + inmax - Maximum value of the input range + easing_func - Pointer to the easing function to use + outmin - Start value of the output range + outmax - End value of the output range + + Return:- + The rescaled value using the specified easing function. +--------------------------------------------------*/ +INT16 IntRescale(INT16 value, INT16 inmin, INT16 inmax, easingfunc_t easing_func, INT16 outmin, INT16 outmax) +{ + // Handle edge case where min == max + if (inmin == inmax) + return outmin; + + // Clamp the input value to the range + max(inmin, min(inmax, value)); + + // Conversion shit + value = value<>FRACBITS; + } + + // Fallback to linear if no function provided + return Easing_Linear(t, outmin, outmax)>>FRACBITS; +} diff --git a/src/m_easing.h b/src/m_easing.h index 3685ed192..bae0029c6 100644 --- a/src/m_easing.h +++ b/src/m_easing.h @@ -105,6 +105,9 @@ EASINGFUNC(InOutBackParameterized) /* Easing_InOutBackParameterized */ #undef EASINGFUNC +fixed_t FixedRescale(fixed_t value, fixed_t inmin, fixed_t inmax, easingfunc_t easing_func, fixed_t outmin, fixed_t outmax); +INT16 IntRescale(INT16 value, INT16 inmin, INT16 inmax, easingfunc_t easing_func, INT16 outmin, INT16 outmax); + #ifdef __cplusplus } // extern "C" #endif From 741097888293eb1ea655365f22fb36394f85db18 Mon Sep 17 00:00:00 2001 From: Ashnal Date: Sun, 22 Jun 2025 23:36:21 -0400 Subject: [PATCH 4/4] Cleanup No functionality changes --- src/doomdef.h | 6 +++--- src/k_kart.c | 34 +++++++++++++++++----------------- src/k_podium.cpp | 14 +++++++------- src/k_rank.cpp | 12 ++++++------ src/k_tally.cpp | 2 +- 5 files changed, 34 insertions(+), 34 deletions(-) diff --git a/src/doomdef.h b/src/doomdef.h index 3ff5c274b..2842e4d80 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -747,9 +747,9 @@ extern int // Exp #define EXP_STABLERATE 3*FRACUNIT/10 // how low is your placement before losing XP? 4*FRACUNIT/10 = top 40% of race will gain #define EXP_POWER 3*FRACUNIT/100 // adjust to change overall xp volatility -#define MINEXP 25 // The min value target -#define TARGETEXP 120 // Used for grading ... -#define MAXEXP 120 // The max value displayed by the hud and in the tally screen and GP results screen +#define EXP_MIN 25 // The min value target +#define EXP_TARGET 120 // Used for grading ... +#define EXP_MAX 120 // The max value displayed by the hud and in the tally screen and GP results screen #ifdef __cplusplus } // extern "C" diff --git a/src/k_kart.c b/src/k_kart.c index 84c2cceae..5ac1ba0ad 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -15995,9 +15995,9 @@ static UINT8 K_Opponents(player_t *player) return opponents; } -static fixed_t K_EXPPower(player_t *player) +static fixed_t K_GradingFactorPower(player_t *player) { - fixed_t power = EXP_POWER; // adjust to change overall xp volatility + fixed_t power = EXP_POWER; // adjust to change overall exp volatility UINT8 opponents = K_Opponents(player); if (g_teamplay) @@ -16009,16 +16009,16 @@ static fixed_t K_EXPPower(player_t *player) return power; } -static fixed_t K_EXPGainPerWin(player_t *player) +static fixed_t K_GradingFactorGainPerWin(player_t *player) { - return K_EXPPower(player); + return K_GradingFactorPower(player); } -static fixed_t K_EXPDrainPerCheckpoint(player_t *player) +static fixed_t K_GradingFactorDrainPerCheckpoint(player_t *player) { - // EXP_STABLERATE: How low do you have to place before losing XP? 4*FRACUNIT/10 = top 40% of race gains, 60% loses. + // EXP_STABLERATE: How low do you have to place before losing gradingfactor? 4*FRACUNIT/10 = top 40% of race gains, 60% loses. UINT8 opponents = K_Opponents(player); - fixed_t power = K_EXPPower(player); + fixed_t power = K_GradingFactorPower(player); return FixedMul(power, FixedMul(opponents*FRACUNIT, FRACUNIT - EXP_STABLERATE)); } @@ -16026,35 +16026,35 @@ fixed_t K_GetGradingFactorAdjustment(player_t *player) { fixed_t result = 0; - // Increase XP for each player you're beating... + // Increase gradingfactor for each player you're beating... for (INT32 i = 0; i < MAXPLAYERS; i++) { if (!K_IsValidOpponent(player, &players[i])) continue; if (player->position < players[i].position) - result += K_EXPGainPerWin(player); + result += K_GradingFactorGainPerWin(player); } - // ...then take all of the XP you could possibly have earned, + // ...then take all of the gradingfactor you could possibly have earned, // and lose it proportional to the stable rate. If you're below - // the stable threshold, this results in you losing XP. - result -= K_EXPDrainPerCheckpoint(player); + // the stable threshold, this results in you losing gradingfactor + result -= K_GradingFactorDrainPerCheckpoint(player); return result; } fixed_t K_GetGradingFactorMinMax(player_t *player, boolean max) { - fixed_t factor = FRACUNIT; // Starting EXP. + fixed_t factor = FRACUNIT; // Starting gradingfactor UINT8 opponents = K_Opponents(player); UINT8 winning = (max) ? opponents : 0; for (UINT8 i = 0; i < player->gradingpointnum; i++) // For each gradingpoint you've reached... { for (UINT8 j = 0; j < winning; j++) - factor += K_EXPGainPerWin(player); // If max, increase EXP for each player you could have been beating. - factor -= K_EXPDrainPerCheckpoint(player); // Then, drain like usual. + factor += K_GradingFactorGainPerWin(player); // If max, increase gradingfactor for each player you could have been beating. + factor -= K_GradingFactorDrainPerCheckpoint(player); // Then, drain like usual. } return factor; @@ -16063,8 +16063,8 @@ fixed_t K_GetGradingFactorMinMax(player_t *player, boolean max) UINT16 K_GetEXP(player_t *player) { UINT32 numgradingpoints = K_GetNumGradingPoints(); - fixed_t targetminexp = (MINEXP*player->gradingpointnum<gradingpointnum<gradingpointnum<gradingpointnum<totalExp = TARGETEXP; + lvl->totalExp = EXP_TARGET; texp += lvl->totalExp * rank.numPlayers; break; } @@ -203,7 +203,7 @@ void podiumData_s::Init(void) dta->rings = M_RandomRange(0, 20); rgs += dta->rings; - dta->exp = M_RandomRange(MINEXP, MAXEXP); + dta->exp = M_RandomRange(EXP_MIN, EXP_MAX); pexp += dta->exp; } @@ -727,8 +727,8 @@ void podiumData_s::Draw(void) // Colorize the crystal, just like we do for hud skincolornum_t overlaycolor = SKINCOLOR_MUSTARD; fixed_t stablerateinverse = FRACUNIT - EXP_STABLERATE; - INT16 exp_range = MAXEXP-MINEXP; - INT16 exp_offset = dta->exp-MINEXP; + INT16 exp_range = EXP_MAX-EXP_MIN; + INT16 exp_offset = dta->exp-EXP_MIN; fixed_t factor = (exp_offset*FRACUNIT) / exp_range; // 0.0 to 1.0 in fixed // amount of blue is how much factor is above EXP_STABLERATE, and amount of red is how much factor is below // assume that EXP_STABLERATE is within 0.0 to 1.0 in fixed @@ -892,9 +892,9 @@ void podiumData_s::Draw(void) .patch("K_STEXP"); // Colorize the crystal for the totals, just like we do for in race hud - fixed_t extraexpfactor = (MAXEXP*FRACUNIT) / TARGETEXP; + fixed_t extraexpfactor = (EXP_MAX*FRACUNIT) / EXP_TARGET; INT16 totalExpMax = FixedMul(rank.totalExp*FRACUNIT, extraexpfactor) / FRACUNIT; // im just going to calculate it from target lol - INT16 totalExpMin = rank.numPlayers*MINEXP; + INT16 totalExpMin = rank.numPlayers*EXP_MIN; skincolornum_t overlaycolor = SKINCOLOR_MUSTARD; fixed_t stablerateinverse = FRACUNIT - EXP_STABLERATE; INT16 exp_range = totalExpMax-totalExpMin; diff --git a/src/k_rank.cpp b/src/k_rank.cpp index c2e222158..3ca026fc8 100644 --- a/src/k_rank.cpp +++ b/src/k_rank.cpp @@ -322,7 +322,7 @@ void gpRank_t::Init(void) // (Should this account for all coop players?) for (i = 0; i < numHumans; i++) { - totalPoints += grandprixinfo.cup->numlevels * K_CalculateGPRankPoints(MAXEXP, i+1, totalPlayers); + totalPoints += grandprixinfo.cup->numlevels * K_CalculateGPRankPoints(EXP_MAX, i+1, totalPlayers); } totalRings = grandprixinfo.cup->numlevels * numHumans * 20; @@ -332,7 +332,7 @@ void gpRank_t::Init(void) const INT32 cupLevelNum = grandprixinfo.cup->cachedlevels[i]; if (cupLevelNum < nummapheaders && mapheaderinfo[cupLevelNum] != NULL) { - exp += TARGETEXP; + exp += EXP_TARGET; } } @@ -372,7 +372,7 @@ void gpRank_t::Rejigger(UINT16 removedmap, UINT16 removedgt, UINT16 addedmap, UI { for (i = 0; i < numPlayers; i++) { - deltaPoints += K_CalculateGPRankPoints(MAXEXP, i + 1, totalPlayers); + deltaPoints += K_CalculateGPRankPoints(EXP_MAX, i + 1, totalPlayers); } if (addedgt == GT_RACE) totalPoints += deltaPoints; @@ -391,7 +391,7 @@ void gpRank_t::Rejigger(UINT16 removedmap, UINT16 removedgt, UINT16 addedmap, UI { if (removedgt == GT_RACE) { - deltaExp -= TARGETEXP; + deltaExp -= EXP_TARGET; } if ((gametypes[removedgt]->rules & GTR_SPHERES) == 0) { @@ -408,7 +408,7 @@ void gpRank_t::Rejigger(UINT16 removedmap, UINT16 removedgt, UINT16 addedmap, UI { if (addedgt == GT_RACE) { - deltaExp += TARGETEXP; + deltaExp += EXP_TARGET; } if ((gametypes[addedgt]->rules & GTR_SPHERES) == 0) { @@ -492,7 +492,7 @@ void gpRank_t::Update(void) lvl->time = UINT32_MAX; - lvl->totalExp = TARGETEXP; + lvl->totalExp = EXP_TARGET; lvl->totalPrisons = maptargets; UINT8 i; diff --git a/src/k_tally.cpp b/src/k_tally.cpp index f8e91b46c..ba17f4153 100644 --- a/src/k_tally.cpp +++ b/src/k_tally.cpp @@ -347,7 +347,7 @@ void level_tally_t::Init(player_t *player) if (player->exp) { exp = player->exp; - totalExp = TARGETEXP; + totalExp = EXP_TARGET; } }