Compare commits

...
Author SHA1 Message Date
Yonokid 19d1fcc859 Merge branch 'main' into result-gauge-cells 2026-09-11 03:54:19 +02:00
Yonokid f5f35d6b8f Merge pull request 'Dan gauge: one 21 px cell per bar piece' (#26) from GanYiZhong/YataiDONNijiiro:dan-gauge-cells into main
Reviewed-on: Yonokid/YataiDONNijiiro#26
2026-09-11 03:54:08 +02:00
TaikoZhongandClaude Fable 5.1 ed7f7224f7 Result: fill the soul gauge cell by cell on the cabinet's 50-cell grid
The result gauge stepped in 87 engine units of 8.4 px, so the fill crept
across the 50-cell / 21 px groove instead of lighting one cell at a time.
Convert the fill target to cells (points * 50 / max, floored like the game
HUD), step one cell per 7 frames (kGageSpeed_), place the norma at cell
30 / 35 / 40, and give the fill pieces the HUD's one-cell-wide art on the
groove's grid.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-11 09:37:40 +08:00
6 changed files with 34 additions and 21 deletions

No files matched your search

Binary file not shown.

Before

Width:  |  Height:  |  Size: 112 B

After

Width:  |  Height:  |  Size: 139 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 111 B

After

Width:  |  Height:  |  Size: 135 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 109 B

After

Width:  |  Height:  |  Size: 117 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 109 B

After

Width:  |  Height:  |  Size: 122 B

+19 -10
View File
@@ -272,21 +272,21 @@
"1p_bar": [
{
"x": 87,
"y": 241
"y": 240
},
{
"x": 1034,
"y": 241
"y": 240
}
],
"2p_bar": [
{
"x": 87,
"y": 241
"y": 240
},
{
"x": 1034,
"y": 241
"y": 240
}
],
"bar_clear_bottom": [
@@ -302,20 +302,20 @@
"bar_clear_top": [
{
"x": 87,
"y": 216
"y": 217
},
{
"x": 1034,
"y": 216
"y": 217
}
],
"bar_clear_transition": [
{
"x": 89,
"x": 87,
"y": 215
},
{
"x": 1036,
"x": 1034,
"y": 215
}
],
@@ -349,7 +349,16 @@
"y": 207
}
],
"tamashii_fire": [{"x": 794, "y": 118}, {"x": 1741, "y": 118}],
"tamashii_fire": [
{
"x": 794,
"y": 118
},
{
"x": 1741,
"y": 118
}
],
"footer": [
{
"x": 0,
@@ -464,4 +473,4 @@
"y": 210
}
]
}
}
+15 -11
View File
@@ -10,7 +10,8 @@ ResultPlayer = {}
ResultPlayer.__index = ResultPlayer
local GAUGE_SCALE = 0.7 -- arcade places tamashii_gage at 0.7 on the result board
local GAUGE_UNIT = 12 * GAUGE_SCALE -- 12 px per YataiDON gauge unit in the plate groove (87 units)
local GAUGE_CELLS = 50 -- the cabinet's gauge is 50 cells (kMaxGage_), like the game HUD
local GAUGE_UNIT = 21 * GAUGE_SCALE -- one 21 px cell of the groove, at the board's 0.7
local OPTION_PITCH = 43
-- ROUND 15 — the whole result sequence is now the cabinet's own state machine, read out of
@@ -37,7 +38,7 @@ local OPTION_PITCH = 43
local F = 1000 / 120 -- ROUND 24 (r24-fpsaudit): Common.FPS is the cabinet's
-- 120 fps script-logic clock, not 60 -- see ENGINE_BINDINGS.md
local WAIT_GAUGE_MS = 100 * F -- 833.3 fade-in done -> the gauge starts filling
local GAUGE_MS_UNIT = 7 * F * (50 / 87) -- 33.53 ms per YataiDON unit == 7 f per arcade unit
local GAUGE_MS_UNIT = 7 * F -- 58.33 ms per cell (kGageSpeed_ = 7 f per arcade unit)
local WAIT_SCORE_MS = 100 * F -- 833.3 gauge full -> StartScoreDisplay
local SCORE_TO_CROWN = 500 * F -- 4166.7 UpdateScore state length
local CROWN_TO_ACTION = 150 * F -- 1250.0 Crown state length -> MoveResultAction
@@ -169,6 +170,9 @@ function ResultPlayer.new(player_num, is_2p, has_2p,
self.is_2p = is_2p
self.has_2p = has_2p
self.gauge_length = gauge_length
-- Fill target in cells: gauge_length is the engine's 87-unit display value
-- (points / max * 87), so cells = points * 50 / max, floored like the HUD gauge.
self.gauge_cells = math.floor(gauge_length * GAUGE_CELLS / 87 + 1e-4)
self.difficulty = difficulty
self.selected_difficulty = selected_difficulty
self.crown_type = crown_type
@@ -214,7 +218,7 @@ function ResultPlayer.new(player_num, is_2p, has_2p,
self.gauge_started = false
self.gauge_start_ms = -1
self.gauge_shown = 0 -- units currently filled (animates up to gauge_length)
self.gauge_shown = 0 -- cells currently filled (animates up to gauge_cells)
self.gauge_done = false
self.score_delay = nil
self.fade_in_started = false -- read by C++: starts the score roll
@@ -349,7 +353,7 @@ function ResultPlayer:update(current_ms, fade_in_finished,
-- isEffectSkip_ (ResultMain): every remaining state collapses at once.
if is_skipped and not self.skipped then
self.skipped = true
self.gauge_shown = math.floor(self.gauge_length)
self.gauge_shown = self.gauge_cells
-- ROUND 52: skip cuts the count-up loop (UpdateTamashiiGage's
-- isEffectSkip branch does TSound:StopSlot, ResultMain.lua:1069) and
-- lands everything on one don_big (ScoreBase UpdateScoreDisplay's
@@ -372,7 +376,7 @@ function ResultPlayer:update(current_ms, fade_in_finished,
if self.gauge_started then
self.tamashii_fire:update(current_ms)
local target = math.floor(self.gauge_length)
local target = self.gauge_cells
-- WaitUpdateTamashiiGage: 100 frames of nothing, then 7 frames per arcade unit
local elapsed = current_ms - self.gauge_start_ms - WAIT_GAUGE_MS
if self.skipped then
@@ -388,7 +392,7 @@ function ResultPlayer:update(current_ms, fade_in_finished,
self.gauge_shown = math.min(target, math.floor(elapsed / GAUGE_MS_UNIT))
-- ROUND 52: the fill reaching the rainbow top plays
-- achieve_tamashii (ResultMain.lua:1086-1088; non-skip path only).
if not self.achieve_played and self.gauge_state == 2 and self.gauge_shown >= 87 then
if not self.achieve_played and self.gauge_state == 2 and self.gauge_shown >= GAUGE_CELLS then
self.achieve_played = true
audio.play_sound("achieve_tamashii" .. self.seat_lr, "sound")
end
@@ -410,7 +414,7 @@ function ResultPlayer:update(current_ms, fade_in_finished,
if audio.stop_sound then audio.stop_sound("count_up_loop" .. self.seat_c) end
end
end
if self.gauge_state == 2 and self.gauge_shown >= 87 then
if self.gauge_state == 2 and self.gauge_shown >= GAUGE_CELLS then
if self.rainbow_start_ms < 0 then self.rainbow_start_ms = current_ms end
self.rainbow_frac = math.fmod((current_ms - self.rainbow_start_ms) / 75.0, 8.0)
end
@@ -618,7 +622,7 @@ function ResultPlayer:draw_gauge()
local gl_int = self.gauge_shown
-- ROUND 48: the clear-zone position follows the norma art tier
-- (hard = normal's segment-35 zone), see the init block above.
local clear_pts = { 52, 60, 69 }
local clear_pts = { 30, 35, 40 } -- easy / normal+hard / oni norma cells
local clear_pt = clear_pts[self.art_index + 1]
local u = GAUGE_UNIT
@@ -626,7 +630,7 @@ function ResultPlayer:draw_gauge()
tex.draw_texture(self.t_gauge_unfilled, { scale = scale, fade = base_fade, index = p_idx })
end
if self.gauge_state == 2 and gl_int >= 87 then
if self.gauge_state == 2 and gl_int >= GAUGE_CELLS then
-- ROUND 53: rainbow cycle sampled from anim/gauge_rainbow (sprite 31): 83.33 ms per
-- step, base cel at 1 with the next fading in over it — the cabinet's own display
-- list, drawn leaf by leaf in depth order. Fallback = pre-R53 75 ms hand cycle.
@@ -692,7 +696,7 @@ function ResultPlayer:draw_gauge()
-- findings stand: the flame holds local (+43,-43) scale **0.800** through the
-- `fever` loop, which is why the drawn scale stays a constant 0.8 here.
local fire_sheen = nil
if self.gauge_state == 2 and gl_int >= 87 and self.t_gauge_tamashii_fire then
if self.gauge_state == 2 and gl_int >= GAUGE_CELLS and self.t_gauge_tamashii_fire then
local ff, fa2, sheen_a = fire_state(self.rainbow_start_ms, tex.get_current_ms())
if ff then
fire_sheen = sheen_a
@@ -708,7 +712,7 @@ function ResultPlayer:draw_gauge()
if self.t_gauge_tamashii then
tex.draw_texture(self.t_gauge_tamashii, { scale = scale, fade = base_fade, index = p_idx })
end
if self.gauge_state == 2 and gl_int >= 87 and self.t_gauge_tamashii_overlay then
if self.gauge_state == 2 and gl_int >= GAUGE_CELLS and self.t_gauge_tamashii_overlay then
if fire_sheen ~= nil then
if fire_sheen > 0.0 then
tex.draw_texture(self.t_gauge_tamashii_overlay,