Skip to content

Commit

Permalink
its like the bachelor but im cooler and better looking than those guys
Browse files Browse the repository at this point in the history
  • Loading branch information
MinaciousGrace committed Apr 17, 2020
1 parent edf9734 commit f8e5b5b
Show file tree
Hide file tree
Showing 2 changed files with 154 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ local customWindows = timingWindowConfig:get_data().customWindows

local scoreType = themeConfig:get_data().global.DefaultScoreType

-- wife3 test stuff
local wife_poi_test_val_a = 55
local wife_poi_test_val_b = 57
local wife_dev_test_val_a = 20
local wife_dev_test_val_b = 23

if GAMESTATE:GetNumPlayersEnabled() == 1 and themeConfig:get_data().eval.ScoreBoardEnabled then
t[#t + 1] = LoadActor("scoreboard")
end
Expand Down Expand Up @@ -303,7 +297,7 @@ function scoreBoard(pn, position)
{
Name = "NormalText",
InitCommand = function(self)
self:xy(frameX + 5, frameY + 9):zoom(0.45):halign(0):valign(0):maxwidth(capWideScale(320, 360))
self:xy(frameX + capWideScale(220, 320), frameY + 9 + capWideScale(0, 30)):zoom(0.45):halign(0):valign(0):maxwidth(capWideScale(320, 360))
end,
BeginCommand = function(self)
self:queuecommand("Set")
Expand All @@ -318,20 +312,38 @@ function scoreBoard(pn, position)
local minesHit =
pss:GetRadarPossible():GetValue("RadarCategory_Mines") - score:GetRadarValues():GetValue("RadarCategory_Mines")
local wife2perc = 1
local wife3perc = 1
local wife3perc1 = 1
local wife3perc2 = 1
local wife3perc3 = 1
local wife3perc4 = 1
local wife3perc5 = 1
local wife3perc6 = 1
if PREFSMAN:GetPreference("SortBySSRNormPercent") then
ws = "Wife J4"
wife2perc = notShit.floor(getRescoredWifeJudge(dvt, 4, totalHolds - holdsHit, minesHit, totalTaps) * 100) / 100
wife3perc = notShit.floor(getRescoredWife3Judge(dvt, 4, totalHolds - holdsHit, minesHit, totalTaps, 2, -5.5, 11, 180, wife_poi_test_val_a, wife_dev_test_val_a) * 100) / 100
wife3perc2 = notShit.floor(getRescoredWife3Judge(dvt, 4, totalHolds - holdsHit, minesHit, totalTaps, 2, -5.5, 11, 180, wife_poi_test_val_b, wife_dev_test_val_b) * 100) / 100
wife2perc = getRescoredWifeJudge(dvt, 4, totalHolds - holdsHit, minesHit, totalTaps)
wife3perc1 = getRescoredWife3Judge(1, dvt, 4, totalHolds - holdsHit, minesHit, totalTaps)
wife3perc2 = getRescoredWife3Judge(2, dvt, 4, totalHolds - holdsHit, minesHit, totalTaps)
wife3perc3 = getRescoredWife3Judge(3, dvt, 4, totalHolds - holdsHit, minesHit, totalTaps)
wife3perc4 = getRescoredWife3Judge(4, dvt, 4, totalHolds - holdsHit, minesHit, totalTaps)
wife3perc5 = getRescoredWife3Judge(5, dvt, 4, totalHolds - holdsHit, minesHit, totalTaps)
wife3perc6 = getRescoredWife3Judge(6, dvt, 4, totalHolds - holdsHit, minesHit, totalTaps)
else
-- normalize to the currently selected judge, not the replay judge
wife2perc = notShit.floor(getRescoredWifeJudge(dvt, GetTimingDifficulty(), totalHolds - holdsHit, minesHit, totalTaps) * 100) / 100
wife3perc = notShit.floor(getRescoredWife3Judge(dvt, GetTimingDifficulty(), totalHolds - holdsHit, minesHit, totalTaps, 2, -5.5, 11, 180, wife_poi_test_val_a, wife_dev_test_val_a) * 100) / 100
wife3perc2 = notShit.floor(getRescoredWife3Judge(dvt, GetTimingDifficulty(), totalHolds - holdsHit, minesHit, totalTaps, 2, -5.5, 11, 180, wife_poi_test_val_b, wife_dev_test_val_b) * 100) / 100
wife2perc = getRescoredWifeJudge(dvt, GetTimingDifficulty(), totalHolds - holdsHit, minesHit, totalTaps)
wife3perc1 = getRescoredWife3Judge(1, dvt, GetTimingDifficulty(), totalHolds - holdsHit, minesHit, totalTaps)
wife3perc2 = getRescoredWife3Judge(2, dvt, GetTimingDifficulty(), totalHolds - holdsHit, minesHit, totalTaps)
wife3perc3 = getRescoredWife3Judge(3, dvt, GetTimingDifficulty(), totalHolds - holdsHit, minesHit, totalTaps)
wife3perc4 = getRescoredWife3Judge(4, dvt, GetTimingDifficulty(), totalHolds - holdsHit, minesHit, totalTaps)
wife3perc5 = getRescoredWife3Judge(5, dvt, GetTimingDifficulty(), totalHolds - holdsHit, minesHit, totalTaps)
wife3perc6 = getRescoredWife3Judge(6, dvt, GetTimingDifficulty(), totalHolds - holdsHit, minesHit, totalTaps)

end
self:settextf("%05.2f%% : %05.2f%% : %05.2f%% (%s)", notShit.floor(wife2perc * 100) / 100, wife3perc, wife3perc2, ws..GetTimingDifficulty())
self:settextf(
"%05.2f%% (%s)\n%05.2f%% : %05.2f%% : %05.2f%%\n%05.2f%% : %05.2f%% : %05.2f%%",
notShit.floor(wife2perc * 100) / 100, ws..GetTimingDifficulty(),
notShit.floor(wife3perc1 * 100) / 100, notShit.floor(wife3perc2 * 100) / 100, notShit.floor(wife3perc3 * 100) / 100,
notShit.floor(wife3perc4 * 100) / 100, notShit.floor(wife3perc5 * 100) / 100, notShit.floor(wife3perc6 * 100) / 100
) -- uauagagugggahghghhhhhhh
end,
ScoreChangedMessageCommand = function(self)
self:queuecommand("Set")
Expand Down Expand Up @@ -367,35 +379,47 @@ function scoreBoard(pn, position)
end
elseif params.Name == "PrevJudge" and judge > 1 then
judge = judge - 1
local wife2perc = notShit.floor(getRescoredWifeJudge(dvt, judge, totalHolds - holdsHit, minesHit, totalTaps) * 100) / 100
local wife3perc = notShit.floor(getRescoredWife3Judge(dvt, judge, totalHolds - holdsHit, minesHit, totalTaps, 2, -5.5, 11, 180, wife_poi_test_val_a, wife_dev_test_val_a) * 100) / 100
local wife3perc2 = notShit.floor(getRescoredWife3Judge(dvt, judge, totalHolds - holdsHit, minesHit, totalTaps, 2, -5.5, 11, 180, wife_poi_test_val_b, wife_dev_test_val_b) * 100) / 100
local wife2perc = getRescoredWifeJudge(dvt, judge, totalHolds - holdsHit, minesHit, totalTaps)
local wife3perc1 = getRescoredWife3Judge(1, dvt, judge, totalHolds - holdsHit, minesHit, totalTaps)
local wife3perc2 = getRescoredWife3Judge(2, dvt, judge, totalHolds - holdsHit, minesHit, totalTaps)
local wife3perc3 = getRescoredWife3Judge(3, dvt, judge, totalHolds - holdsHit, minesHit, totalTaps)
local wife3perc4 = getRescoredWife3Judge(4, dvt, judge, totalHolds - holdsHit, minesHit, totalTaps)
local wife3perc5 = getRescoredWife3Judge(5, dvt, judge, totalHolds - holdsHit, minesHit, totalTaps)
local wife3perc6 = getRescoredWife3Judge(6, dvt, judge, totalHolds - holdsHit, minesHit, totalTaps)
self:settextf(
self:settextf(
"%05.2f%% : %05.2f%% : %05.2f%% (%s)",
wife2perc, wife3perc, wife3perc2,
"Wife J" .. judge
"%05.2f%% (%s)\n%05.2f%% : %05.2f%% : %05.2f%%\n%05.2f%% : %05.2f%% : %05.2f%%",
notShit.floor(wife2perc * 100) / 100, "Wife J" .. judge,
notShit.floor(wife3perc1 * 100) / 100, notShit.floor(wife3perc2 * 100) / 100, notShit.floor(wife3perc3 * 100) / 100,
notShit.floor(wife3perc4 * 100) / 100, notShit.floor(wife3perc5 * 100) / 100, notShit.floor(wife3perc6 * 100) / 100
)
)
MESSAGEMAN:Broadcast("RecalculateGraphs", {judge = judge})
elseif params.Name == "NextJudge" and judge < 9 then
judge = judge + 1
local wife2perc = notShit.floor(getRescoredWifeJudge(dvt, judge, totalHolds - holdsHit, minesHit, totalTaps) * 100) / 100
local wife3perc = notShit.floor(getRescoredWife3Judge(dvt, judge, totalHolds - holdsHit, minesHit, totalTaps, 2, -5.5, 11, 180, wife_poi_test_val_a, wife_dev_test_val_a) * 100) / 100
local wife3perc2 = notShit.floor(getRescoredWife3Judge(dvt, judge, totalHolds - holdsHit, minesHit, totalTaps, 2, -5.5, 11, 180, wife_poi_test_val_b, wife_dev_test_val_b) * 100) / 100
local wife2perc = getRescoredWifeJudge(dvt, judge, totalHolds - holdsHit, minesHit, totalTaps)
local wife3perc1 = getRescoredWife3Judge(1, dvt, judge, totalHolds - holdsHit, minesHit, totalTaps)
local wife3perc2 = getRescoredWife3Judge(2, dvt, judge, totalHolds - holdsHit, minesHit, totalTaps)
local wife3perc3 = getRescoredWife3Judge(3, dvt, judge, totalHolds - holdsHit, minesHit, totalTaps)
local wife3perc4 = getRescoredWife3Judge(4, dvt, judge, totalHolds - holdsHit, minesHit, totalTaps)
local wife3perc5 = getRescoredWife3Judge(5, dvt, judge, totalHolds - holdsHit, minesHit, totalTaps)
local wife3perc6 = getRescoredWife3Judge(6, dvt, judge, totalHolds - holdsHit, minesHit, totalTaps)
if judge == 9 then
self:settextf(
self:settextf(
"%05.2f%% : %05.2f%% : %05.2f%% (%s)",
wife2perc, wife3perc, wife3perc2,
"justice"
"%05.2f%% (%s)\n%05.2f%% : %05.2f%% : %05.2f%%\n%05.2f%% : %05.2f%% : %05.2f%%",
notShit.floor(wife2perc * 100) / 100, "justice",
notShit.floor(wife3perc1 * 100) / 100, notShit.floor(wife3perc2 * 100) / 100, notShit.floor(wife3perc3 * 100) / 100,
notShit.floor(wife3perc4 * 100) / 100, notShit.floor(wife3perc5 * 100) / 100, notShit.floor(wife3perc6 * 100) / 100
)
)
else
self:settextf(
"%05.2f%% : %05.2f%% : %05.2f%% (%s)",
wife2perc, wife3perc, wife3perc2,
"Wife J" .. judge
"%05.2f%% (%s)\n%05.2f%% : %05.2f%% : %05.2f%%\n%05.2f%% : %05.2f%% : %05.2f%%",
notShit.floor(wife2perc * 100) / 100, "Wife J" .. judge,
notShit.floor(wife3perc1 * 100) / 100, notShit.floor(wife3perc2 * 100) / 100, notShit.floor(wife3perc3 * 100) / 100,
notShit.floor(wife3perc4 * 100) / 100, notShit.floor(wife3perc5 * 100) / 100, notShit.floor(wife3perc6 * 100) / 100

)
end
MESSAGEMAN:Broadcast("RecalculateGraphs", {judge = judge})
Expand Down Expand Up @@ -837,16 +861,16 @@ function scoreBoard(pn, position)
local smallest, largest = wifeRange(devianceTable)
local doot = {
THEME:GetString("ScreenEvaluation", "Mean"),
THEME:GetString("ScreenEvaluation", "AbsMean"),
THEME:GetString("ScreenEvaluation", "StandardDev"),
"Largest",
THEME:GetString("ScreenEvaluation", "LeftCB"),
THEME:GetString("ScreenEvaluation", "RightCB"),
THEME:GetString("ScreenEvaluation", "MiddleCB")
}
local mcscoot = {
wifeMean(devianceTable),
wifeAbsMean(devianceTable),
wifeSd(devianceTable),
largest,
cbl,
cbr,
cbm
Expand Down
120 changes: 98 additions & 22 deletions Themes/_fallback/Scripts/10 Scores.lua
Original file line number Diff line number Diff line change
Expand Up @@ -620,38 +620,114 @@ function erf(x)
end

-- note lua should always be dealing with MS not S as a unit
function wife3(maxms, ts, max_points, miss_weight, ridic, max_boo_weight, poi, dev) -- only args for testing/comparison purposes atm
-- judge scaling stuff
local ridic = ridic * ts
local max_boo_weight = max_boo_weight * ts
local poi = poi * ts
local dev = dev * ts

-- shortcut case handling
if maxms <= ridic then -- anything below this (judge scaled) threshold is counted as full pts
return max_points
end
if maxms > max_boo_weight then -- we can just set miss values manually
return miss_weight -- technically the max boo is always 180 above j4 however this is immaterial to the
end -- purpose of the scoring curve, which is to assign point values

-- actual calculations
function wife3(maxms, ts, version) -- args are going to be set from in here for now
-- hoooooo boy shits about to get reeaaallll messy
local max_points = 0
local miss_weight = 0
local ridic = 0
local max_boo_weight = 0
local j_pow = 0
local poi = 0
local dev = 0
local magic = 0
local log_pow = 0
local lower_bound = 0

if (version == 1) or (version == 4) then -- hyperbolic lower bound
if (version == 1) then
max_points = 2
miss_weight = -5.5
ridic = 11 * ts
max_boo_weight = 180 * ts
j_pow = 0.66
poi = 56 * (ts^j_pow)
dev = 26 * (ts^j_pow)
else
max_points = 2
miss_weight = -5.5
ridic = 5 * ts
max_boo_weight = 180 * ts
j_pow = 0.66
poi = 55 * (ts^j_pow)
dev = 20 * (ts^j_pow)
end
-- shortcut case handling
if maxms <= ridic then -- anything below this (judge scaled) threshold is counted as full pts
return max_points
end
if maxms > max_boo_weight then -- we can just set miss values manually
return miss_weight -- technically the max boo is always 180 above j4 however this is immaterial to the
end -- purpose of the scoring curve, which is to assign point values

-- lower bound calculation
local lower_bound = max_points + ((miss_weight - max_points) * math.sqrt(maxms * maxms - ridic * ridic) / (max_boo_weight - ridic));
else -- logarithmic lower bound
if version == 2 then
max_points = 2
miss_weight = -5
ridic = 11 * ts
max_boo_weight = 180 * ts
j_pow = 0.66
poi = 55 * (ts^j_pow)
dev = 30 * (ts^j_pow)
magic = 180 * ts
log_pow = 8 -- higher = more linear, but its really sensitive and you have to change some other parameters along with it just dont touch ok
elseif version == 3 then
max_points = 2
miss_weight = -5.5
ridic = 9 * ts
max_boo_weight = 180 * ts
j_pow = 0.66
poi = 53 * (ts^j_pow)
dev = 31 * (ts^j_pow)
magic = 0.05 * ts
log_pow = 2
elseif version == 5 then
max_points = 2
miss_weight = -5
ridic = 11 * ts
max_boo_weight = 180 * ts
j_pow = 0.66
poi = 61 * (ts^j_pow)
dev = 29 * (ts^j_pow)
magic = 100 * ts
log_pow = 6.5
elseif version == 6 then
max_points = 2
miss_weight = -5.5
ridic = 9 * ts
max_boo_weight = 180 * ts
j_pow = 0.66
poi = 53 * (ts^j_pow)
dev = 31 * (ts^j_pow)
magic = 0.05 * ts
log_pow = 2
end
-- shortcut case handling
if maxms <= ridic then -- anything below this (judge scaled) threshold is counted as full pts
return max_points
end
if maxms > max_boo_weight then -- we can just set miss values manually
return miss_weight -- technically the max boo is always 180 above j4 however this is immaterial to the
end -- purpose of the scoring curve, which is to assign point values

-- WHY is this so complicated surely there is a better way
lower_bound = max_points + ((miss_weight - max_points) * (math.log(((maxms - ridic)*magic) + 1)/math.log(((max_boo_weight - ridic)*magic) + 1))^log_pow);
end
-- calculate the actual value
local y_val = (erf((poi - maxms) / dev) + 1) / 2;
local lower_bound = max_points +
((miss_weight - max_points) * math.sqrt(maxms * maxms - ridic * ridic) / (max_boo_weight - ridic));

return (max_points - lower_bound) * y_val + lower_bound;
end

-- holy shit this is fugly
function getRescoredWife3Judge(offsetVector, judgeScale, holdsMissed, minesHit, totalNotes, a, b, c, d, e, f)
function getRescoredWife3Judge(version, offsetVector, judgeScale, holdsMissed, minesHit, totalNotes)
local tso = {1.50, 1.33, 1.16, 1.00, 0.84, 0.66, 0.50, 0.33, 0.20}
local ts = tso[judgeScale]
local p = 0.0
for i = 1, #offsetVector do -- wife2 does not require abs due to ^2 but this does
p = p + wife3(math.abs(offsetVector[i]), ts, a, b, c, d, e, f)
p = p + wife3(math.abs(offsetVector[i]), ts, version)
end
p = p + (holdsMissed * -4.5)
p = p + (minesHit * -7)
return (p / (totalNotes * 2)) * 100.0
end
end

0 comments on commit f8e5b5b

Please sign in to comment.