Repository navigation
Rehearsal: gameplay timing - #1
Draft
carrdylan52 wants to merge 15 commits into
Draft
carrdylan52 wants to merge 15 commits into
carrdylan52 wants to merge 15 commits into
Conversation
carrdylan52
force-pushed
the
rehearsal/tick60
branch
from
October 14, 2026 00:34
bb2ce50 to
50006e3
Compare
The PAL release shortened frame counts and sped up per-frame steps to make up for its 50 Hz fields. Each such value now reads PAL_TIMING(pal, ntsc): event and camera sequence conversions, fades and BGM fades, character motion speed, menu, inventory, aquarium, title and status timers, and play-time differences compared with 1/60 s limits. The PS2 build keeps the PAL tokens.
…timing The PAL disc scripts keep the NTSC frame counts and convert them while they run: the event library scales field counts by 50/60, monster scripts pass frame counts through conv(n) = ftoi(itof(n) / 30.0f * 25.0f), a few scripts divide by 30 and multiply by 25 in integers, and some literals were retuned by hand. With the NTSC timing, ResolveFile now hands every .stb to script_timing::Patch before a loader or the file cache sees it. Recipes match decoded instructions inside the script's functions (program table, CALL targets, unreferenced function blocks) and turn each conversion into opcode-22 no-ops, which CRunScript::exe() steps over; the converter keeps its FTOI so callers still get integers. The lip-sync cue assignment that PAL derives from the scaled timeout is removed whole. Hand-tuned literals (d03 jump, s03 turn, m06b delay and wait, i01h01b backpack scene, one e221a turn) and Max's and Monica's eight motion-ratio window bounds are anchored: the PAL value must be found once before the NTSC value is written; the attack-window policy is a constant. A marker no-op records what it replaced, so a converted script converts to the same bytes again. script_timing_inventory.inc lists the 906 scripts that hold a conversion (including the PAL-only language copies) with the count of each recipe. A listed script that does not match, or an unlisted one that holds a conversion, stops the game with status 5 and its name. The PAL timing leaves every script untouched; datapack scripts are not converted.
Select and save PAL/50 or NTSC/60 together, preserve custom pairs, and show a restart notice separately from save failures. Make tick_rate restart-only alongside the timing profile. Applying the paired row live would change the clock while executable values and loaded scripts retain the old profile. Latch both at startup and use the active clock rate for fallback audio, including sound steps before startup.
Check every indexed script with the load-time recipes before starting the clock. Include datapack replacements and offer PAL timing for this session when scripts cannot be converted. Keep saved settings unchanged. Headless mismatches exit with status 5 and the asset list. Show the active PAL fallback truthfully in settings, and accept unlisted undecodable scripts unchanged with a warning once per asset per session. Convert matching datapack scripts through the normal loader, log each asset once, and reuse the data index and script keys across real-data tests. Cover startup rejection, replacement conversion, session state, and repeated loads with synthetic scripts and a process-exit fixture.
carrdylan52
force-pushed
the
rehearsal/tick60
branch
from
October 14, 2026 01:03
50006e3 to
1baea16
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rehearsal run inside the fork: gameplay timing (PAL 50 Hz / NTSC 60 Hz) on top of upstream master f44a756. Not for merge.