Replace GP points with exp

update GP results screen lap patches with exp patches
This commit is contained in:
Ashnal 2025-04-28 18:49:48 -04:00
parent b88453f995
commit 8242cb89f0
8 changed files with 29 additions and 30 deletions

View file

@ -744,6 +744,11 @@ extern int
// Amp scaling // Amp scaling
#define MAXAMPSCALINGDIST 18000 #define MAXAMPSCALINGDIST 18000
// Exp
#define MINDISPLAYEXP 50 // The min value target
#define TARGETDISPLAYEXP 100 // The target value needed for A rank
#define MAXDISPLAYEXP 125 // The max value displayed by the hud and in the tally screen and GP results screen
#ifdef __cplusplus #ifdef __cplusplus
} // extern "C" } // extern "C"
#endif #endif

View file

@ -4716,7 +4716,7 @@ static void G_DoCompleted(void)
if (grandprixinfo.eventmode == GPEVENT_NONE) if (grandprixinfo.eventmode == GPEVENT_NONE)
{ {
grandprixinfo.rank.winPoints += K_CalculateGPRankPoints(player->position, grandprixinfo.rank.totalPlayers); grandprixinfo.rank.winPoints += K_CalculateGPRankPoints(player, grandprixinfo.rank.totalPlayers);
grandprixinfo.rank.laps += player->lapPoints; grandprixinfo.rank.laps += player->lapPoints;
} }
else if (grandprixinfo.eventmode == GPEVENT_SPECIAL) else if (grandprixinfo.eventmode == GPEVENT_SPECIAL)

View file

@ -51,13 +51,14 @@ UINT8 K_BotStartingDifficulty(SINT8 value)
} }
/*-------------------------------------------------- /*--------------------------------------------------
INT16 K_CalculateGPRankPoints(UINT8 position, UINT8 numplayers) INT16 K_CalculateGPRankPoints(player_t* player, UINT8 numplayers)
See header file for description. See header file for description.
--------------------------------------------------*/ --------------------------------------------------*/
INT16 K_CalculateGPRankPoints(UINT8 position, UINT8 numplayers) INT16 K_CalculateGPRankPoints(player_t* player, UINT8 numplayers)
{ {
INT16 points; INT16 points;
UINT8 position = player->position;
if (position >= numplayers || position == 0) if (position >= numplayers || position == 0)
{ {
@ -65,7 +66,7 @@ INT16 K_CalculateGPRankPoints(UINT8 position, UINT8 numplayers)
return 0; return 0;
} }
points = numplayers - position; points = K_GetDisplayEXP(player);
// Give bonus to high-ranking players, depending on player count // Give bonus to high-ranking players, depending on player count
// This rounds out the point gain when you get 1st every race, // This rounds out the point gain when you get 1st every race,
@ -79,16 +80,16 @@ INT16 K_CalculateGPRankPoints(UINT8 position, UINT8 numplayers)
case 0: case 1: case 2: // 1v1 case 0: case 1: case 2: // 1v1
break; // No bonus needed. break; // No bonus needed.
case 3: case 4: // 3-4P case 3: case 4: // 3-4P
if (position == 1) { points += 1; } // 1st gets +1 extra point if (position == 1) { points += 5; } // 1st gets +1 extra point
break; break;
case 5: case 6: // 5-6P case 5: case 6: // 5-6P
if (position == 1) { points += 3; } // 1st gets +3 extra points if (position == 1) { points += 10; } // 1st gets +3 extra points
else if (position == 2) { points += 1; } // 2nd gets +1 extra point // else if (position == 2) { points += 4; } // 2nd gets +1 extra point
break; break;
default: // Normal matches default: // Normal matches
if (position == 1) { points += 5; } // 1st gets +5 extra points if (position == 1) { points += 10; } // 1st gets +5 extra points
else if (position == 2) { points += 3; } // 2nd gets +3 extra points // else if (position == 2) { points += 5; } // 2nd gets +3 extra points
else if (position == 3) { points += 1; } // 3rd gets +1 extra point // else if (position == 3) { points += 2; } // 3rd gets +1 extra point
break; break;
} }

View file

@ -60,7 +60,7 @@ UINT8 K_BotStartingDifficulty(SINT8 value);
/*-------------------------------------------------- /*--------------------------------------------------
INT16 K_CalculateGPRankPoints(UINT8 position, UINT8 numplayers); INT16 K_CalculateGPRankPoints(player_t* player, UINT8 numplayers);
Calculates the number of points that a player would Calculates the number of points that a player would
recieve if they won the round. recieve if they won the round.
@ -73,7 +73,7 @@ UINT8 K_BotStartingDifficulty(SINT8 value);
Number of points to give. Number of points to give.
--------------------------------------------------*/ --------------------------------------------------*/
INT16 K_CalculateGPRankPoints(UINT8 position, UINT8 numplayers); INT16 K_CalculateGPRankPoints(player_t* player, UINT8 numplayers);
/*-------------------------------------------------- /*--------------------------------------------------

View file

@ -15500,7 +15500,7 @@ UINT16 K_GetDisplayEXP(player_t *player)
// target is where you should be if you're doing good and at a 1.0 mult // target is where you should be if you're doing good and at a 1.0 mult
fixed_t clampedexp = max(FRACUNIT/2, min(FRACUNIT*5/4, player->exp)); // clamp between 0.5 and 1.25 fixed_t clampedexp = max(FRACUNIT/2, min(FRACUNIT*5/4, player->exp)); // clamp between 0.5 and 1.25
fixed_t targetdisplayexp = (100*player->gradingpointnum/numgradingpoints)<<FRACBITS; fixed_t targetdisplayexp = (TARGETDISPLAYEXP*player->gradingpointnum/numgradingpoints)<<FRACBITS;
UINT16 displayexp = FixedMul(clampedexp, targetdisplayexp)>>FRACBITS; UINT16 displayexp = FixedMul(clampedexp, targetdisplayexp)>>FRACBITS;
return displayexp; return displayexp;

View file

@ -136,10 +136,8 @@ void podiumData_s::Init(void)
rank.numLevels = 8; rank.numLevels = 8;
constexpr INT32 numRaces = 5; constexpr INT32 numRaces = 5;
for (INT32 i = 0; i < rank.numPlayers; i++)
{ rank.totalPoints += numRaces * TARGETDISPLAYEXP;
rank.totalPoints += numRaces * K_CalculateGPRankPoints(i + 1, rank.totalPlayers);
}
rank.totalRings = numRaces * rank.numPlayers * 20; rank.totalRings = numRaces * rank.numPlayers * 20;
// Randomized winnings // Randomized winnings
@ -685,7 +683,7 @@ void podiumData_s::Draw(void)
{ {
drawer_gametype drawer_gametype
.xy(0, 1) .xy(0, 1)
.patch("K_SPTLAP"); .patch("K_SPTEXP");
drawer_gametype drawer_gametype
.xy(22, 1) .xy(22, 1)
@ -823,7 +821,7 @@ void podiumData_s::Draw(void)
.text(va("%c%d", (rank.scorePrisons > 0 ? '+' : ' '), rank.scorePrisons)); .text(va("%c%d", (rank.scorePrisons > 0 ? '+' : ' '), rank.scorePrisons));
drawer_totals_right drawer_totals_right
.patch("RANKLAPS"); .patch("K_STEXP");
drawer_totals_right drawer_totals_right
.xy(44.0, 0.0) .xy(44.0, 0.0)

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(i + 1, totalPlayers); totalPoints += grandprixinfo.cup->numlevels * TARGETDISPLAYEXP;
} }
totalRings = grandprixinfo.cup->numlevels * numHumans * 20; totalRings = grandprixinfo.cup->numlevels * numHumans * 20;
@ -371,10 +371,7 @@ void gpRank_t::Rejigger(UINT16 removedmap, UINT16 removedgt, UINT16 addedmap, UI
if ((removedgt == GT_RACE) != (addedgt == GT_RACE)) if ((removedgt == GT_RACE) != (addedgt == GT_RACE))
{ {
for (i = 0; i < numPlayers; i++) deltaPoints += TARGETDISPLAYEXP;
{
deltaPoints += K_CalculateGPRankPoints(i + 1, totalPlayers);
}
if (addedgt == GT_RACE) if (addedgt == GT_RACE)
totalPoints += deltaPoints; totalPoints += deltaPoints;
@ -512,7 +509,7 @@ void gpRank_t::Update(void)
lvl->time = UINT32_MAX; lvl->time = UINT32_MAX;
lvl->totalLapPoints = 100; lvl->totalLapPoints = TARGETDISPLAYEXP;
lvl->totalPrisons = maptargets; lvl->totalPrisons = maptargets;
UINT8 i; UINT8 i;

View file

@ -50,6 +50,7 @@
#include "k_hud.h" // K_DrawMapThumbnail #include "k_hud.h" // K_DrawMapThumbnail
#include "k_battle.h" #include "k_battle.h"
#include "k_boss.h" #include "k_boss.h"
#include "k_kart.h"
#include "k_pwrlv.h" #include "k_pwrlv.h"
#include "k_grandprix.h" #include "k_grandprix.h"
#include "k_serverstats.h" // SV_BumpMatchStats #include "k_serverstats.h" // SV_BumpMatchStats
@ -308,7 +309,7 @@ static void Y_CalculateMatchData(UINT8 rankingsmode, void (*comparison)(INT32))
if (data.pos[data.numplayers] < pointgetters if (data.pos[data.numplayers] < pointgetters
&& !(players[i].pflags & PF_NOCONTEST)) && !(players[i].pflags & PF_NOCONTEST))
{ {
data.increase[i] = K_CalculateGPRankPoints(data.pos[data.numplayers], pointgetters); data.increase[i] = K_GetDisplayEXP(&players[i]);
} }
} }
@ -2195,10 +2196,7 @@ static UINT32 Y_EstimatePodiumScore(player_t *const player, UINT8 numPlaying)
UINT8 pos = Y_PlayersBestPossiblePosition(player); UINT8 pos = Y_PlayersBestPossiblePosition(player);
UINT32 ourScore = player->score; UINT32 ourScore = player->score;
if (pos < numPlaying) ourScore += K_GetDisplayEXP(player);
{
ourScore += K_CalculateGPRankPoints(pos, numPlaying);
}
return ourScore; return ourScore;
} }