diff --git a/config.ini b/config.ini index c4d73fb..fb7977d 100644 --- a/config.ini +++ b/config.ini @@ -51,11 +51,6 @@ motd=Welcome to OpenFusion! # and pre-Academy builds must *not* contain it. #enabledpatches=1013 -# Use Original FusionFall's racing score and reward calculation? -# Set false to use Retro's calculation, make sure you have the correct -# patch(es) loaded. -#ogracingscores=true - # xdt json filename #xdtdata=xdt.json # NPC json filename diff --git a/src/Racing.cpp b/src/Racing.cpp index e8977d2..62cfe47 100644 --- a/src/Racing.cpp +++ b/src/Racing.cpp @@ -103,18 +103,12 @@ static void racingEnd(CNSocket* sock, CNPacketData* data) { uint64_t now = getTime() / 1000; int timeDiff = now - epRace.startTime; int podsCollected = epRace.collectedRings.size(); - int score = 0, fm = 0; - if (settings::OGRACINGSCORES) { - score = std::min(epInfo.maxScore, (int)std::exp( - (epInfo.podFactor * podsCollected) / epInfo.maxPods - - (epInfo.timeFactor * timeDiff) / epInfo.maxTime - + epInfo.scaleFactor)); - fm = (1.0 + std::exp(epInfo.scaleFactor - 1.0) * epInfo.podFactor * podsCollected) / epInfo.maxPods; - } else { - score = std::max(0, 500 * podsCollected - 10 * timeDiff); - fm = score * plr->level * (1.0f / 36) * 0.3f; - } + int score = std::min(epInfo.maxScore, (int)std::exp( + (epInfo.podFactor * podsCollected) / epInfo.maxPods + - (epInfo.timeFactor * timeDiff) / epInfo.maxTime + + epInfo.scaleFactor)); + int fm = (1.0 + std::exp(epInfo.scaleFactor - 1.0) * epInfo.podFactor * podsCollected) / epInfo.maxPods; // we submit the ranking first... Database::RaceRanking postRanking = {}; diff --git a/src/Racing.hpp b/src/Racing.hpp index 90cc9f2..44ad739 100644 --- a/src/Racing.hpp +++ b/src/Racing.hpp @@ -7,9 +7,9 @@ struct EPInfo { // available through XDT (maxScore may be updated by drops) int zoneX, zoneY, EPID, maxScore; - // (maybe) available through drops - int maxTime = 0, maxPods = 0; - double scaleFactor = 0.0, podFactor = 0.0, timeFactor = 0.0; + // available through drops + int maxTime, maxPods; + double scaleFactor, podFactor, timeFactor; }; struct EPRace { diff --git a/src/TableData.cpp b/src/TableData.cpp index f562b04..1ee8322 100644 --- a/src/TableData.cpp +++ b/src/TableData.cpp @@ -576,15 +576,11 @@ static void loadDrops(json& dropData) { // time limit isn't stored in the XDT, so we include it in the reward table instead epInfo.maxTime = (int)race["TimeLimit"]; - - // the following has to be present based on the score calculation method - if (settings::OGRACINGSCORES) { - epInfo.maxScore = (int)race["ScoreCap"]; - epInfo.maxPods = (int)race["TotalPods"]; - epInfo.scaleFactor = (double)race["ScaleFactor"]; - epInfo.podFactor = (double)race["PodFactor"]; - epInfo.timeFactor = (double)race["TimeFactor"]; - } + epInfo.maxScore = (int)race["ScoreCap"]; + epInfo.maxPods = (int)race["TotalPods"]; + epInfo.scaleFactor = (double)race["ScaleFactor"]; + epInfo.podFactor = (double)race["PodFactor"]; + epInfo.timeFactor = (double)race["TimeFactor"]; // score cutoffs std::vector rankScores; diff --git a/src/settings.cpp b/src/settings.cpp index a148cbb..14d8de4 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -66,9 +66,6 @@ int settings::MONITORINTERVAL = 5000; // event mode settings int settings::EVENTMODE = 0; -// racing score mode -bool settings::OGRACINGSCORES = true; - void settings::init() { INIReader reader("config.ini"); @@ -113,7 +110,6 @@ void settings::init() { EVENTMODE = reader.GetInteger("shard", "eventmode", EVENTMODE); DISABLEFIRSTUSEFLAG = reader.GetBoolean("shard", "disablefirstuseflag", DISABLEFIRSTUSEFLAG); ANTICHEAT = reader.GetBoolean("shard", "anticheat", ANTICHEAT); - OGRACINGSCORES = reader.GetBoolean("shard", "ogracingscores", OGRACINGSCORES); MONITORENABLED = reader.GetBoolean("monitor", "enabled", MONITORENABLED); MONITORPORT = reader.GetInteger("monitor", "port", MONITORPORT); MONITORINTERVAL = reader.GetInteger("monitor", "interval", MONITORINTERVAL); diff --git a/src/settings.hpp b/src/settings.hpp index 4986784..1ea3a43 100644 --- a/src/settings.hpp +++ b/src/settings.hpp @@ -36,7 +36,6 @@ namespace settings { extern int MONITORPORT; extern int MONITORINTERVAL; extern bool DISABLEFIRSTUSEFLAG; - extern bool OGRACINGSCORES; void init(); }