mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2025-06-28 23:10:13 +00:00
Compare commits
1 Commits
72395a2d80
...
2464e4adda
Author | SHA1 | Date | |
---|---|---|---|
![]() |
2464e4adda |
@ -51,6 +51,11 @@ motd=Welcome to OpenFusion!
|
|||||||
# and pre-Academy builds must *not* contain it.
|
# and pre-Academy builds must *not* contain it.
|
||||||
#enabledpatches=1013
|
#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
|
# xdt json filename
|
||||||
#xdtdata=xdt.json
|
#xdtdata=xdt.json
|
||||||
# NPC json filename
|
# NPC json filename
|
||||||
|
@ -105,12 +105,18 @@ static void racingEnd(CNSocket* sock, CNPacketData* data) {
|
|||||||
uint64_t now = getTime() / 1000;
|
uint64_t now = getTime() / 1000;
|
||||||
int timeDiff = now - epRace.startTime;
|
int timeDiff = now - epRace.startTime;
|
||||||
int podsCollected = epRace.collectedRings.size();
|
int podsCollected = epRace.collectedRings.size();
|
||||||
|
int score = 0, fm = 0;
|
||||||
|
|
||||||
int score = std::min(epInfo.maxScore, (int)std::exp(
|
if (settings::OGRACINGSCORES) {
|
||||||
(epInfo.podFactor * podsCollected) / epInfo.maxPods
|
score = std::min(epInfo.maxScore, (int)std::exp(
|
||||||
- (epInfo.timeFactor * timeDiff) / epInfo.maxTime
|
(epInfo.podFactor * podsCollected) / epInfo.maxPods
|
||||||
+ epInfo.scaleFactor));
|
- (epInfo.timeFactor * timeDiff) / epInfo.maxTime
|
||||||
int fm = (1.0 + std::exp(epInfo.scaleFactor - 1.0) * epInfo.podFactor * podsCollected) / epInfo.maxPods;
|
+ 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;
|
||||||
|
}
|
||||||
|
|
||||||
// we submit the ranking first...
|
// we submit the ranking first...
|
||||||
Database::RaceRanking postRanking = {};
|
Database::RaceRanking postRanking = {};
|
||||||
|
@ -9,9 +9,9 @@
|
|||||||
struct EPInfo {
|
struct EPInfo {
|
||||||
// available through XDT (maxScore may be updated by drops)
|
// available through XDT (maxScore may be updated by drops)
|
||||||
int zoneX, zoneY, EPID, maxScore;
|
int zoneX, zoneY, EPID, maxScore;
|
||||||
// available through drops
|
// (maybe) available through drops
|
||||||
int maxTime, maxPods;
|
int maxTime = 0, maxPods = 0;
|
||||||
double scaleFactor, podFactor, timeFactor;
|
double scaleFactor = 0.0, podFactor = 0.0, timeFactor = 0.0;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct EPRace {
|
struct EPRace {
|
||||||
|
@ -588,11 +588,15 @@ static void loadDrops(json& dropData) {
|
|||||||
|
|
||||||
// time limit isn't stored in the XDT, so we include it in the reward table instead
|
// time limit isn't stored in the XDT, so we include it in the reward table instead
|
||||||
epInfo.maxTime = (int)race["TimeLimit"];
|
epInfo.maxTime = (int)race["TimeLimit"];
|
||||||
epInfo.maxScore = (int)race["ScoreCap"];
|
|
||||||
epInfo.maxPods = (int)race["TotalPods"];
|
// the following has to be present based on the score calculation method
|
||||||
epInfo.scaleFactor = (double)race["ScaleFactor"];
|
if (settings::OGRACINGSCORES) {
|
||||||
epInfo.podFactor = (double)race["PodFactor"];
|
epInfo.maxScore = (int)race["ScoreCap"];
|
||||||
epInfo.timeFactor = (double)race["TimeFactor"];
|
epInfo.maxPods = (int)race["TotalPods"];
|
||||||
|
epInfo.scaleFactor = (double)race["ScaleFactor"];
|
||||||
|
epInfo.podFactor = (double)race["PodFactor"];
|
||||||
|
epInfo.timeFactor = (double)race["TimeFactor"];
|
||||||
|
}
|
||||||
|
|
||||||
// score cutoffs
|
// score cutoffs
|
||||||
std::vector<int> rankScores;
|
std::vector<int> rankScores;
|
||||||
|
@ -67,6 +67,9 @@ int settings::MONITORINTERVAL = 5000;
|
|||||||
// event mode settings
|
// event mode settings
|
||||||
int settings::EVENTMODE = 0;
|
int settings::EVENTMODE = 0;
|
||||||
|
|
||||||
|
// racing score mode
|
||||||
|
bool settings::OGRACINGSCORES = true;
|
||||||
|
|
||||||
void settings::init() {
|
void settings::init() {
|
||||||
INIReader reader("config.ini");
|
INIReader reader("config.ini");
|
||||||
|
|
||||||
@ -111,6 +114,7 @@ void settings::init() {
|
|||||||
EVENTMODE = reader.GetInteger("shard", "eventmode", EVENTMODE);
|
EVENTMODE = reader.GetInteger("shard", "eventmode", EVENTMODE);
|
||||||
DISABLEFIRSTUSEFLAG = reader.GetBoolean("shard", "disablefirstuseflag", DISABLEFIRSTUSEFLAG);
|
DISABLEFIRSTUSEFLAG = reader.GetBoolean("shard", "disablefirstuseflag", DISABLEFIRSTUSEFLAG);
|
||||||
ANTICHEAT = reader.GetBoolean("shard", "anticheat", ANTICHEAT);
|
ANTICHEAT = reader.GetBoolean("shard", "anticheat", ANTICHEAT);
|
||||||
|
OGRACINGSCORES = reader.GetBoolean("shard", "ogracingscores", OGRACINGSCORES);
|
||||||
MONITORENABLED = reader.GetBoolean("monitor", "enabled", MONITORENABLED);
|
MONITORENABLED = reader.GetBoolean("monitor", "enabled", MONITORENABLED);
|
||||||
MONITORPORT = reader.GetInteger("monitor", "port", MONITORPORT);
|
MONITORPORT = reader.GetInteger("monitor", "port", MONITORPORT);
|
||||||
MONITORINTERVAL = reader.GetInteger("monitor", "interval", MONITORINTERVAL);
|
MONITORINTERVAL = reader.GetInteger("monitor", "interval", MONITORINTERVAL);
|
||||||
|
@ -38,6 +38,7 @@ namespace settings {
|
|||||||
extern int MONITORPORT;
|
extern int MONITORPORT;
|
||||||
extern int MONITORINTERVAL;
|
extern int MONITORINTERVAL;
|
||||||
extern bool DISABLEFIRSTUSEFLAG;
|
extern bool DISABLEFIRSTUSEFLAG;
|
||||||
|
extern bool OGRACINGSCORES;
|
||||||
|
|
||||||
void init();
|
void init();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user