No functionality changes
This commit is contained in:
Ashnal 2025-06-22 23:36:21 -04:00
parent 092f8a63e6
commit 7410978882
5 changed files with 34 additions and 34 deletions

View file

@ -747,9 +747,9 @@ extern int
// Exp // 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_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 EXP_POWER 3*FRACUNIT/100 // adjust to change overall xp volatility
#define MINEXP 25 // The min value target #define EXP_MIN 25 // The min value target
#define TARGETEXP 120 // Used for grading ... #define EXP_TARGET 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_MAX 120 // The max value displayed by the hud and in the tally screen and GP results screen
#ifdef __cplusplus #ifdef __cplusplus
} // extern "C" } // extern "C"

View file

@ -15995,9 +15995,9 @@ static UINT8 K_Opponents(player_t *player)
return opponents; 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); UINT8 opponents = K_Opponents(player);
if (g_teamplay) if (g_teamplay)
@ -16009,16 +16009,16 @@ static fixed_t K_EXPPower(player_t *player)
return power; 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); 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)); return FixedMul(power, FixedMul(opponents*FRACUNIT, FRACUNIT - EXP_STABLERATE));
} }
@ -16026,35 +16026,35 @@ fixed_t K_GetGradingFactorAdjustment(player_t *player)
{ {
fixed_t result = 0; 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++) for (INT32 i = 0; i < MAXPLAYERS; i++)
{ {
if (!K_IsValidOpponent(player, &players[i])) if (!K_IsValidOpponent(player, &players[i]))
continue; continue;
if (player->position < players[i].position) 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 // and lose it proportional to the stable rate. If you're below
// the stable threshold, this results in you losing XP. // the stable threshold, this results in you losing gradingfactor
result -= K_EXPDrainPerCheckpoint(player); result -= K_GradingFactorDrainPerCheckpoint(player);
return result; return result;
} }
fixed_t K_GetGradingFactorMinMax(player_t *player, boolean max) 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 opponents = K_Opponents(player);
UINT8 winning = (max) ? opponents : 0; UINT8 winning = (max) ? opponents : 0;
for (UINT8 i = 0; i < player->gradingpointnum; i++) // For each gradingpoint you've reached... for (UINT8 i = 0; i < player->gradingpointnum; i++) // For each gradingpoint you've reached...
{ {
for (UINT8 j = 0; j < winning; j++) 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_GradingFactorGainPerWin(player); // If max, increase gradingfactor for each player you could have been beating.
factor -= K_EXPDrainPerCheckpoint(player); // Then, drain like usual. factor -= K_GradingFactorDrainPerCheckpoint(player); // Then, drain like usual.
} }
return factor; return factor;
@ -16063,8 +16063,8 @@ fixed_t K_GetGradingFactorMinMax(player_t *player, boolean max)
UINT16 K_GetEXP(player_t *player) UINT16 K_GetEXP(player_t *player)
{ {
UINT32 numgradingpoints = K_GetNumGradingPoints(); UINT32 numgradingpoints = K_GetNumGradingPoints();
fixed_t targetminexp = (MINEXP*player->gradingpointnum<<FRACBITS) / max(1,numgradingpoints); // about what a last place player should be at this stage of the race fixed_t targetminexp = (EXP_MIN*player->gradingpointnum<<FRACBITS) / max(1,numgradingpoints); // about what a last place player should be at this stage of the race
fixed_t targetmaxexp = (MAXEXP*player->gradingpointnum<<FRACBITS) / max(1,numgradingpoints); // about what a 1.0 factor should be at this stage of the race fixed_t targetmaxexp = (EXP_MAX*player->gradingpointnum<<FRACBITS) / max(1,numgradingpoints); // about what a 1.0 factor should be at this stage of the race
fixed_t factormin = K_GetGradingFactorMinMax(player, false); fixed_t factormin = K_GetGradingFactorMinMax(player, false);
fixed_t factormax = K_GetGradingFactorMinMax(player, true); fixed_t factormax = K_GetGradingFactorMinMax(player, true);

View file

@ -139,7 +139,7 @@ void podiumData_s::Init(void)
constexpr INT32 numRaces = 5; constexpr INT32 numRaces = 5;
for (INT32 i = 0; i < rank.numPlayers; i++) for (INT32 i = 0; i < rank.numPlayers; i++)
{ {
rank.totalPoints += numRaces * K_CalculateGPRankPoints(MAXEXP, i+1, rank.totalPlayers); rank.totalPoints += numRaces * K_CalculateGPRankPoints(EXP_MAX, i+1, rank.totalPlayers);
} }
rank.totalRings = numRaces * rank.numPlayers * 20; rank.totalRings = numRaces * rank.numPlayers * 20;
@ -180,7 +180,7 @@ void podiumData_s::Init(void)
} }
default: default:
{ {
lvl->totalExp = TARGETEXP; lvl->totalExp = EXP_TARGET;
texp += lvl->totalExp * rank.numPlayers; texp += lvl->totalExp * rank.numPlayers;
break; break;
} }
@ -203,7 +203,7 @@ void podiumData_s::Init(void)
dta->rings = M_RandomRange(0, 20); dta->rings = M_RandomRange(0, 20);
rgs += dta->rings; rgs += dta->rings;
dta->exp = M_RandomRange(MINEXP, MAXEXP); dta->exp = M_RandomRange(EXP_MIN, EXP_MAX);
pexp += dta->exp; pexp += dta->exp;
} }
@ -727,8 +727,8 @@ void podiumData_s::Draw(void)
// Colorize the crystal, just like we do for hud // Colorize the crystal, just like we do for hud
skincolornum_t overlaycolor = SKINCOLOR_MUSTARD; skincolornum_t overlaycolor = SKINCOLOR_MUSTARD;
fixed_t stablerateinverse = FRACUNIT - EXP_STABLERATE; fixed_t stablerateinverse = FRACUNIT - EXP_STABLERATE;
INT16 exp_range = MAXEXP-MINEXP; INT16 exp_range = EXP_MAX-EXP_MIN;
INT16 exp_offset = dta->exp-MINEXP; INT16 exp_offset = dta->exp-EXP_MIN;
fixed_t factor = (exp_offset*FRACUNIT) / exp_range; // 0.0 to 1.0 in fixed 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 // 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 // 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"); .patch("K_STEXP");
// Colorize the crystal for the totals, just like we do for in race hud // 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 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; skincolornum_t overlaycolor = SKINCOLOR_MUSTARD;
fixed_t stablerateinverse = FRACUNIT - EXP_STABLERATE; fixed_t stablerateinverse = FRACUNIT - EXP_STABLERATE;
INT16 exp_range = totalExpMax-totalExpMin; INT16 exp_range = totalExpMax-totalExpMin;

View file

@ -322,7 +322,7 @@ void gpRank_t::Init(void)
// (Should this account for all coop players?) // (Should this account for all coop players?)
for (i = 0; i < numHumans; i++) 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; totalRings = grandprixinfo.cup->numlevels * numHumans * 20;
@ -332,7 +332,7 @@ void gpRank_t::Init(void)
const INT32 cupLevelNum = grandprixinfo.cup->cachedlevels[i]; const INT32 cupLevelNum = grandprixinfo.cup->cachedlevels[i];
if (cupLevelNum < nummapheaders && mapheaderinfo[cupLevelNum] != NULL) 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++) 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) if (addedgt == GT_RACE)
totalPoints += deltaPoints; totalPoints += deltaPoints;
@ -391,7 +391,7 @@ void gpRank_t::Rejigger(UINT16 removedmap, UINT16 removedgt, UINT16 addedmap, UI
{ {
if (removedgt == GT_RACE) if (removedgt == GT_RACE)
{ {
deltaExp -= TARGETEXP; deltaExp -= EXP_TARGET;
} }
if ((gametypes[removedgt]->rules & GTR_SPHERES) == 0) 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) if (addedgt == GT_RACE)
{ {
deltaExp += TARGETEXP; deltaExp += EXP_TARGET;
} }
if ((gametypes[addedgt]->rules & GTR_SPHERES) == 0) if ((gametypes[addedgt]->rules & GTR_SPHERES) == 0)
{ {
@ -492,7 +492,7 @@ void gpRank_t::Update(void)
lvl->time = UINT32_MAX; lvl->time = UINT32_MAX;
lvl->totalExp = TARGETEXP; lvl->totalExp = EXP_TARGET;
lvl->totalPrisons = maptargets; lvl->totalPrisons = maptargets;
UINT8 i; UINT8 i;

View file

@ -347,7 +347,7 @@ void level_tally_t::Init(player_t *player)
if (player->exp) if (player->exp)
{ {
exp = player->exp; exp = player->exp;
totalExp = TARGETEXP; totalExp = EXP_TARGET;
} }
} }