痛いOTAKUのポエム

地雷多すぎ人間の愚痴

SimplyLoveの判定ヒストグラムでITGモードでもFA-を白くしたかったけどもう遅い!もう公式で白表示できるようにされちゃったしこの記事のLuaにはバグがあって非推奨

元々は以下の文章を5月中に下書きとして書いていました。
これをやるとバグがあることは分かっていて、それが割と致命的だったのが公開してなかった理由です。
勿体ないので放流。

なにこれ

SimplyLoveベースのテーマ(SimplyLoveそのものや、DigitalDanceなど)では判定のヒストグラムが出せます。
最初からFA+モードで起動すれば判定ヒストグラム水色FANTASTICと白FANTASTICを区別してくれますが、
FA+シミュレート機能を使用している状態だとヒストグラムでは白FANTASTICも水色に塗られてしまいます。

これを無理やり解決します。

おことわり

同じことをやって不利益を被っても当方は責任を負いません。
また、力業で解決しているため、FA+シミュレートなしのITGモードを使っても白くなりますし、判定を変えていても白くなります。

変更するファイル

Simply-Love-SM5/BGAnimations/ScreenEvaluation common/Panes/Pane5/

Calculations.lua

2023年5月現在のv5.2.1ではPane5になっていますが、開発段階によっては変更されている可能性があります。
同じ階層のフォルダの「default.lua」に

-- Pane5 displays an aggregate histogram of judgment offsets
-- as well as the mean timing error, median, and mode of those offsets.

みたいなことが書いてあるはずなので、それを見て判断しましょう。

変更内容の調査

169行目から以下の記述があるはずなので探します。

local i=1
for offset=-worst_window, worst_window, 0.001 do
offset = round(offset,3)
x = i * w
y = smooth_offsets[offset] or 0

-- don't bother adding vert data for offsets that were smoothed
-- beyond whatever the worst_offset actually earned by the player was
if math.abs(offset) <= worst_offset then
-- scale the highest point on the histogram to be 0.75 times as high as the pane
y = -1 * scale(y, 0, highest_offset_count, 0, pane_height*0.75)
c = colors[DetermineTimingWindow(offset)]

-- the ActorMultiVertex is in "QuadStrip" drawmode, like a series of quads placed next to one another
-- each vertex is a table of two tables:
-- {x, y, z}, {r, g, b, a}
verts[#verts+1] = {{x, 0, 0}, c }
verts[#verts+1] = {{x, y, 0}, c }
end

i = i+1
end

この中の
c = colors[DetermineTimingWindow(offset)]
ヒストグラムの色を決定しています。

DetermineTimingWindow()については
Simply-Love-SM5/Scripts/SL-Helpers.lua
で定義されており、戻り値は1以上の整数値です。
FANTASTICが1でEXCELLENTが2でGREATが3で……と判定が高い順に1から順に番号を振ったものです。
通常モードでFA+シミュレートを使ってもこの処理が変わらないため、FAが区別されません。

colors[]の中身については「Calculations.lua」と同じ階層の「default.lua」で

local colors = {}
for w=NumJudgmentsAvailable(),1,-1 do
if SL.Global.ActiveModifiers.TimingWindows[w]==true then
colors[w] = DeepCopy(SL.JudgmentColors[SL.Global.GameMode][w])
else
abbreviations[SL.Global.GameMode][w] = abbreviations[SL.Global.GameMode][w+1]
colors[w] = DeepCopy(colors[w+1] or SL.JudgmentColors[SL.Global.GameMode][w+1])
end
end

として記載されています。

今度は「SL.JudgmentColors[SL.Global.GameMode][w]」の設定が欲しいので
Simply-Love-SM5/Scripts/SL_Init.lua を見ます。
これは

JudgmentColors = {
Casual = {
color("#21CCE8"), -- blue
color("#e29c18"), -- gold
color("#66c955"), -- green
color("#b45cff"), -- purple (greatly lightened)
color("#c9855e"), -- peach?
color("#ff3030") -- red (slightly lightened)
},
ITG = {
color("#21CCE8"), -- blue
color("#e29c18"), -- gold
color("#66c955"), -- green
color("#b45cff"), -- purple (greatly lightened)
color("#c9855e"), -- peach?
color("#ff3030") -- red (slightly lightened)
},
["FA+"] = {
color("#21CCE8"), -- blue
color("#ffffff"), -- white
color("#e29c18"), -- gold
color("#66c955"), -- green
color("#b45cff"), -- purple (greatly lightened)
color("#ff3030") -- red (slightly lightened)
},
},

です。

本来はFA+シミュレートオプションを使ったときにはFA+の設定を使うように分岐させるのが正しいですが、面倒なのでやりません。

よって、cを決定するタイミングか、描画する直前にオフセットの絶対値が一定以内の時に
c = color("#ffffff")
を差し込んでやれば白くなるはずです。

変更内容

local i=1
for offset=-worst_window, worst_window, 0.001 do
offset = round(offset,3)
x = i * w
y = smooth_offsets[offset] or 0

-- don't bother adding vert data for offsets that were smoothed
-- beyond whatever the worst_offset actually earned by the player was
if math.abs(offset) <= worst_offset then
-- scale the highest point on the histogram to be 0.75 times as high as the pane
y = -1 * scale(y, 0, highest_offset_count, 0, pane_height*0.75)
c = colors[DetermineTimingWindow(offset)]
if (offset > 0.0135 and offset < 0.0215) or (offset < -0.0135 and offset > -0.0215) then
color("#ffffff")
end

-- the ActorMultiVertex is in "QuadStrip" drawmode, like a series of quads placed next to one another
-- each vertex is a table of two tables:
-- {x, y, z}, {r, g, b, a}
verts[#verts+1] = {{x, 0, 0}, c }
verts[#verts+1] = {{x, y, 0}, c }
end

i = i+1
end

おわりに

ここまで書いたんですが、Simply Love for SM5 - v5.3.0で無用の長物となりました。
しかも、そっちなら表示のON/OFFが変えられますし、バグもないです。