mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-02-18 03:22:35 +00:00
grading refinements attempt
This commit is contained in:
parent
7c1df623ae
commit
2a36838b54
4 changed files with 55 additions and 15 deletions
|
|
@ -745,9 +745,11 @@ extern int
|
|||
#define MAXAMPSCALINGDIST 18000
|
||||
|
||||
// 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 100 // The target value needed for A rank
|
||||
#define MAXEXP 125 // The max value displayed by the hud and in the tally screen and GP results screen
|
||||
#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
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
|
|
|
|||
|
|
@ -15739,8 +15739,8 @@ boolean K_PlayerCanUseItem(player_t *player)
|
|||
|
||||
fixed_t K_GetGradingFactorAdjustment(player_t *player)
|
||||
{
|
||||
fixed_t power = 3*FRACUNIT/100; // adjust to change overall xp volatility
|
||||
fixed_t stablerate = 3*FRACUNIT/10; // how low is your placement before losing XP? 4*FRACUNIT/10 = top 40% of race will gain
|
||||
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;
|
||||
|
||||
if (g_teamplay)
|
||||
|
|
|
|||
|
|
@ -723,10 +723,28 @@ void podiumData_s::Draw(void)
|
|||
.xy(0, 1)
|
||||
.colorize(static_cast<skincolornum_t>(SKINCOLOR_MUSTARD))
|
||||
.patch("K_SPTEXP");
|
||||
|
||||
// Colorize the crystal, just like we do for hud
|
||||
fixed_t factor = FixedDiv(dta->exp*FRACUNIT, lvl->totalExp*FRACUNIT);
|
||||
skincolornum_t overlaycolor = factor < FRACUNIT ? SKINCOLOR_RUBY : SKINCOLOR_ULTRAMARINE;
|
||||
if (factor >= FRACUNIT) {factor += factor-FRACUNIT;} // exaggerate the positive side, since reverse engineering the factor like this results in half the translucency range
|
||||
skincolornum_t overlaycolor = SKINCOLOR_MUSTARD;
|
||||
fixed_t stablerateinverse = FRACUNIT - EXP_STABLERATE;
|
||||
INT16 exp_range = MAXEXP-MINEXP;
|
||||
INT16 exp_offset = dta->exp-MINEXP;
|
||||
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
|
||||
if (factor <= stablerateinverse)
|
||||
{
|
||||
overlaycolor = SKINCOLOR_RUBY;
|
||||
factor = FixedDiv(factor, stablerateinverse);
|
||||
}
|
||||
else
|
||||
{
|
||||
overlaycolor = SKINCOLOR_ULTRAMARINE;
|
||||
fixed_t bluemaxoffset = EXP_STABLERATE;
|
||||
factor = factor - stablerateinverse;
|
||||
factor = FRACUNIT - FixedDiv(factor, bluemaxoffset);
|
||||
}
|
||||
|
||||
auto transflag = K_GetTransFlagFromFixed(factor);
|
||||
drawer_gametype
|
||||
.xy(0, 1)
|
||||
|
|
@ -872,12 +890,32 @@ void podiumData_s::Draw(void)
|
|||
drawer_totals_right
|
||||
.colorize(static_cast<skincolornum_t>(SKINCOLOR_MUSTARD))
|
||||
.patch("K_STEXP");
|
||||
|
||||
// Colorize the crystal for the totals, just like we do for in race hud
|
||||
fixed_t factor = FixedDiv((rank.exp+(35*rank.numPlayers-1))*FRACUNIT, rank.totalExp*FRACUNIT); // bump the calc a bit, because its probably not possible for every human to get 125 on every race
|
||||
skincolornum_t overlaycolor = factor < FRACUNIT ? SKINCOLOR_RUBY : SKINCOLOR_ULTRAMARINE;
|
||||
if (factor >= FRACUNIT) {factor += factor-FRACUNIT;} // exaggerate the positive side, since reverse engineering the factor like this results in half the translucency range
|
||||
fixed_t extraexpfactor = (MAXEXP*FRACUNIT) / TARGETEXP;
|
||||
INT16 totalExpMax = FixedMul(rank.totalExp*FRACUNIT, extraexpfactor) / FRACUNIT; // im just going to calculate it from target lol
|
||||
INT16 totalExpMin = rank.numPlayers*MINEXP;
|
||||
skincolornum_t overlaycolor = SKINCOLOR_MUSTARD;
|
||||
fixed_t stablerateinverse = FRACUNIT - EXP_STABLERATE;
|
||||
INT16 exp_range = totalExpMax-totalExpMin;
|
||||
INT16 exp_offset = rank.exp-totalExpMin;
|
||||
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
|
||||
if (factor <= stablerateinverse)
|
||||
{
|
||||
overlaycolor = SKINCOLOR_RUBY;
|
||||
factor = FixedDiv(factor, stablerateinverse);
|
||||
}
|
||||
else
|
||||
{
|
||||
overlaycolor = SKINCOLOR_ULTRAMARINE;
|
||||
fixed_t bluemaxoffset = EXP_STABLERATE;
|
||||
factor = factor - stablerateinverse;
|
||||
factor = FRACUNIT - FixedDiv(factor, bluemaxoffset);
|
||||
}
|
||||
|
||||
auto transflag = K_GetTransFlagFromFixed(factor);
|
||||
|
||||
drawer_totals_right
|
||||
.colorize(static_cast<skincolornum_t>(overlaycolor))
|
||||
.flags(transflag)
|
||||
|
|
|
|||
|
|
@ -204,14 +204,14 @@ INT32 level_tally_t::CalculateGrade(void)
|
|||
}
|
||||
case TALLY_BONUS_SCORE:
|
||||
{
|
||||
bonusWeights[i] = ((pointLimit != 0) ? 100 : 0);
|
||||
bonusWeights[i] = ((pointLimit != 0) ? 200 : 0);
|
||||
break;
|
||||
}
|
||||
case TALLY_BONUS_EXP:
|
||||
case TALLY_BONUS_PRISON:
|
||||
case TALLY_BONUS_POWERSTONES:
|
||||
{
|
||||
bonusWeights[i] = 150;
|
||||
bonusWeights[i] = 300;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
|
@ -222,7 +222,7 @@ INT32 level_tally_t::CalculateGrade(void)
|
|||
}
|
||||
}
|
||||
|
||||
const INT32 positionWeight = (position > 0 && numPlayers > 2) ? 20 : 0;
|
||||
const INT32 positionWeight = (position > 0 && numPlayers > 2) ? 50 : 0;
|
||||
const INT32 total = positionWeight + bonusWeights[0] + bonusWeights[1];
|
||||
|
||||
INT32 ours = 0;
|
||||
|
|
@ -247,7 +247,7 @@ INT32 level_tally_t::CalculateGrade(void)
|
|||
case TALLY_BONUS_EXP:
|
||||
{
|
||||
const fixed_t frac = std::min(FRACUNIT, ((exp) * FRACUNIT) / std::max(1, static_cast<int>(totalExp)));
|
||||
ours += Easing_InQuint(frac, 0, bonusWeights[i]);
|
||||
ours += Easing_Linear(frac, 0, bonusWeights[i]);
|
||||
break;
|
||||
}
|
||||
case TALLY_BONUS_PRISON:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue