Panel state resolution sweep¶
scripts/frida/panel_state_resolution_sweep.js is the capture script for issue
#165 ("support all resolutions").
It automates panel/text capture per launcher resolution:
- Force known panel-heavy states via
game_state_set. - Capture UI element geometry (
ui_element_render) and text draws (grim_draw_text_mono/grim_draw_text_small) in each state. - During capture of hover-sensitive states (
14,15,16by default), drive synthetic cursor hover points so right-panel variants are logged. - Write one log file per active resolution.
Default sweep targets:
0,1,2,3,4,11,14,15,16,17,20,26,5,6,7,8,12,21
These cover menu and panel states while skipping known non-panel/unsafe states
like quit transition (10) and plugin runtime (22).
Sweep start now waits for a minimum number of observed UI frames before forcing
state transitions. This avoids launcher-time early transitions where
game_state_set can fire before menu/UI init is stable.
Attach flow¶
- Start launcher and choose a resolution.
- Attach the script.
- Press "Start Game".
- Wait for
sweep_donein the log.
Attach command:
Just shortcut (Windows VM):
Output¶
Default directory: C:\share\frida (override with CRIMSON_FRIDA_DIR).
Output filename pattern:
panel_state_resolution_capture_<WIDTH>x<HEIGHT>_<RUNID>.jsonl
Examples:
panel_state_resolution_capture_640x480_20260215_214455_99cf7b0e.jsonlpanel_state_resolution_capture_1920x1080_20260215_215103_1a04f3dc.jsonl
Each row includes:
- current state globals (
state_id,state_pending,state_prev) - resolution globals (
screen_width,screen_height,windowed) - UI transition globals (
timeline,direction,alpha) - panel element payloads (
panel_element) - text payloads (
panel_text) - per-state summary rows (
state_result) - run summary row (
sweep_done)
Post-capture triage¶
Reduce one or more panel_state_resolution_capture_*.jsonl files into a run/resolution summary:
or:
Outputs:
analysis/frida/panel_state_resolution_capture_summary.jsonanalysis/frida/panel_state_resolution_capture_report.md
The reducer classifies files as:
complete: sweep finished with captured signal in all requested states.degraded: sweep finished but has non-captured states and/or captured states with zero panel/text/frame signal.partial: nosweep_done(often a startup handoff file if resolution changed immediately after attach).
Useful env overrides¶
CRIMSON_PANEL_SWEEP_STATES=...override state list.CRIMSON_PANEL_SWEEP_START_DELAY_MS=...wait before first forced transition.CRIMSON_PANEL_SWEEP_MIN_UI_FRAMES=...minimum observedui_elements_update_and_rendercalls before sweep start.CRIMSON_PANEL_SWEEP_ENTER_TIMEOUT_MS=...timeout waiting for state activation.CRIMSON_PANEL_SWEEP_SETTLE_MS=...wait after entering a state.CRIMSON_PANEL_SWEEP_DWELL_MS=...capture duration per state.CRIMSON_PANEL_SWEEP_HOVER_STATES=...states that receive synthetic hover capture (default14,15,16).CRIMSON_PANEL_SWEEP_HOVER_STEP_MS=...hover-point step interval while dwelling.CRIMSON_PANEL_SWEEP_HOVER_MAX_POINTS=...cap for UI-derived hover points per state.CRIMSON_PANEL_SWEEP_MAX_UNIQUE_PANELS=...per-state panel event cap.CRIMSON_PANEL_SWEEP_MAX_UNIQUE_TEXTS=...per-state text event cap.CRIMSON_PANEL_SWEEP_ZERO_SIGNAL_RETRIES=...retry count for states that capture zero frames/panels/text.CRIMSON_PANEL_SWEEP_CONSOLE=1mirror JSONL rows to console.