soh links torch as a static library, which compiles out torch's own CLI,
so build-time extraction needs an entry point. soh-torch supplies one
around the same SohTorch::Extract the game calls -- one implementation,
so the CLI and the in-game path can't drift.
ExtractAssets keeps its old contract: SOH_ROM_PATH accepts roms and/or
directories of roms and defaults to roms/, so dropping a vanilla and a
master quest rom in produces oot.o2r and oot-mq.o2r in one run, and
chaining GenerateSohOtr keeps soh.o2r coming out of it too.
Extract now returns the archive name torch chose rather than deriving it
from IsMasterQuest(), so config.yml is the only thing naming archives.
The name comes from Companion::GetOutputPath(): scanning the destination
for *.o2r picks up an unrelated soh.o2r when extracting into the build
directory, which is only invisible in the game because it extracts into
an empty temp dir.
ExtractAssetHeaders stays as a target that explains why it can't run --
torch registers no OoT header exporter and emits no #define d<sym>, which
soh source references ~24k times. Documented in BUILDING.md alongside it.
This removes the last ZAPD dependency from the build.
Vanilla then MQ extracted in one process, both loaded and played. Closes
PLAN.md risk #6 in the game rather than only against the harness driver,
and confirms config.yml-driven archive naming end to end.
Adds soh/assets/yml as a submodule (briaguya0/soh-asset-yml, 20,353 asset
definitions) and FetchContents torch at 4cae4416, configured exactly as
Gate A' measured it: static lib, OoT only, no UI, no StormLib.
find_package(ZLIB) has to run before torch is declared. Torch declares
zlib with OVERRIDE_FIND_PACKAGE, so it takes over the whole build's
find_package(ZLIB), and its copy provides no ZLIB::ZLIB -- which both
StormLib and CMake's FindPNG link by name. Filed upstream as Torch#233.
CallZapd becomes CallTorch: no chdir, no symlinked assets dir, no 22-entry
argv. Everything that needed the working directory is now a parameter.
TorchExtract.cpp is the only TU that includes Companion.h, since torch
exports its whole lib/ as PUBLIC includes.
Progress uses torch's phase callback, which fires once per yml file, with
the denominator counted off disk. Gate A confirmed the two match exactly
for all three yml counts, so the bar runs 0-100 without the sawtooth the
old per-file counter would have produced.
GetZapdVerStr becomes GetTorchVersionDir, returning the version directory
under the yml tree rather than a ZAPD xml directory.
soh.elf links torch and no longer references zapd_report.
Unblocks the rest of the migration. soh.o2r is produced by ZAPD via
OTRExporter/extract_assets.py, both of which this migration deletes; its
replacement is a small in-tree packer that has to reproduce ZAPD's
texture quantisation exactly. Rather than block Phases 2/3/5 on that
packer, check the archive in and make GenerateSohOtr a copy.
The archive doubles as Phase 4's acceptance oracle -- the packer is
correct when its output matches this entry-for-entry -- which is strictly
more useful than Gate E's planned manifest of hashes of it.
Generation turns out to be content-deterministic but NOT byte-
deterministic: two runs give identical payloads for all 1,042 entries but
different file hashes, because zip stores per-entry timestamps. So the
Phase 4 comparison must be entry-wise; whole-file would fail even on a
correct archive. Recorded in prebuilt/README.md.
Adds a configure-time guard on the baked-in portVersion. OTRGlobals.cpp
:283 requires exact major.minor.patch equality and RunExtract exit(1)s
with "soh.o2r is outdated", which is an opaque symptom for a stale
checked-in file; verified the guard fires by building against 9.2.4.
ExtractAssets, CI and copy-existing-otrs.cmake are deliberately untouched
-- ExtractAssets still generates a correct archive while ZAPD exists, and
the CI job keeps working since it just builds this target.
Static lib + OoT-only + Release together: 19/19 identical plus the
vanilla-then-MQ pair. Flags verified from the generated cache rather than
assumed, so Phase 2's CMake block and TorchExtract.cpp can be
transcriptions of this build and RunOnce respectively.
Archive bytes turn out to be configuration-independent -- the pair
produced exactly the sizes the Debug static-lib run did, phases=1450 on
both runs. Extraction 11.8s mean, so the static-lib wrapper costs nothing
over Gate C.
Confirms both Phase 2 dependency risks in the configuration that actually
ships: zlib fetched with BUILD_STORMLIB=OFF and no zlib.h includes,
tinyxml2 fetched with BUILD_NAUDIO=OFF removing its only consumers. Both
FetchContent declarations are unconditional.
OoT-only (eight BUILD_<game> flags OFF) and Release (-O3) each 19/19
identical, one variable moved apiece -- verified against the option()
defaults so the other flags genuinely match the baseline cache.
Gate C mattered: every parity measurement to date, including the original
14/14, was Debug, while CI and releases build -O3.
Also records extraction wall-clock from torch's own timing line: Release
averages 11.4s per ROM against Debug's 26.7s, and the OoT-only flags cost
nothing. SoH ships Release, so PLAN.md risk #5 looks much smaller than the
Debug numbers suggested -- though ZAPD's time on the same machine is still
unmeasured.
Two extractions in one process, vanilla then MQ, both byte-identical to
their references. The second run's phases=1450 matches pal_mq's on-disk
yml count exactly, which is the direct refutation of the gProcessedFiles
risk -- a leak would have skipped files and truncated the archive. A
fresh Companion per extraction is sufficient; PLAN.md risk #6 retired.
Also records what the gate turned up on the way: torch writes 25
duplicate archive entries, benign because libultraship indexes by CRC64
of the path. Filed as Torch#233 item 5. Corrects the Gate A note that
attributed the whole ~343 KB size delta to compression -- 76 KB of it is
these duplicates.
USE_STANDALONE=OFF plus driving Companion by hand produces byte-identical
archives for all 19 ROM dumps.
The real question was libgfxd, which is fetched only if(USE_STANDALONE) --
_deps/ confirms it is absent, so the Binary export path is genuinely
gfxd-free. Reading said so; now it's run.
Progress denominator confirmed exact: SetPhaseCallback fires once per yml
file, matching the on-disk count for all three classes (1449/1450/1480).
Phase 3's bar can be monotonic with no change to OTRGlobals.
Also observed for Phase 2: zlib is fetched even with BUILD_STORMLIB=OFF and
no zlib.h use in torch/src, confirming risk #1; spdlog is not fetched, so
only the global-logger stomping applies there.
Baseline Torch build (USE_STANDALONE=ON, all games, Debug, PORT_VERSION_
ENDIANNESS=ON) reproduces every reference archive: 19 ROM dumps, all
0 failed / 0 not generated / 0 not in reference. Counts match the harness
README's 14-target table, and the duplicate dumps agree with each other,
which the 14-target matrix never showed.
Reference manifests also spot-checked by re-derivation from two o2r files
-- the baseline the gates measure against hasn't drifted.
The "filtered subset" was a misread. The log line prints the pre-recursion
yml count (1320); setup_scratch's external_files recursion then pulls in the
remaining 130, so an unfiltered run copies all 1450 - verified by replaying
the logic. So the gates use test_assets.py, the same tool that produced the
existing 14/14, with a TORCH_BIN env override as the only harness patch.
Gate A2 keeps the check.sh path, since it needs two extractions in one
process and test_assets.py execs the binary once per ROM.
Adds torch-migration/PHASE0.md with the full gate detail: what each gate's
variable is, the driver source, exact commands, cost, and exit criteria.
Two gates the plan was missing:
- Gate C (Release build) - the harness 14/14 is a Debug measurement; CI
and releases build -O3.
- Gate A2 (two extractions in one process) - free once the driver exists,
retires the re-entrancy risk offline instead of by hand in the game.
Also: gates run full-tree + check.sh rather than test_assets.py (which
hardcodes the torch path and copies a filtered yml subset), 19 ROM dumps
not 17, and libgfxd being USE_STANDALONE-only is called out as the real
hazard in Gate A.
- Name the actual repo (briaguya0/soh-asset-yml); it holds yml only, and is
edited directly rather than regenerated. zapd_to_torch.py is a one-shot
conversion, not an ongoing workflow, since nobody edits the ZAPD XMLs once
ZAPD is gone.
- Phase 5 is pure deletion. Generator inputs are already preserved by the
harness's shipwright@95d8f7e submodule pin and by git history, so nothing
needs snapshotting or moving out of Shipwright.
- Clarify soh/CMakeLists.txt:107-109 as a configure-soh-directly fallback with
nothing left to fall back to.
- Downgrade the extraction wall-clock risk; perf work landed in Torch#219.
Co-Authored-By: Claude <noreply@anthropic.com>
Rewrite Gfx_TexScrollEx / Gfx_TwoTexScrollEx / Gfx_TwoTexScrollEnvColorEx to
emit one command per tile instead of one baked tile size per interpolated frame,
so texture DL memory no longer scales with InterpolationFPS
RegisterBetterSave registered its VB_LOAD_SAVE_MENU and VB_DRAW_SAVE_MENU
hooks unconditionally, and hardcoded the save/continue text overrides to
`true`, so the feature applied regardless of the enable checkbox and
toggling it off did nothing. CVAR_BETTERSAVE_VALUE was defined but never
read.
Gate all five hooks on CVAR_BETTERSAVE_VALUE (COND_VB_SHOULD for the two
vanilla-behavior hooks, the condition arg for the three OnOpenText hooks).
RegisterShipInitFunc already re-runs RegisterBetterSave when CVAR_BETTERSAVE
changes, so the COND_* macros unregister the hooks when it is off and
re-register them when it is on.
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Allow player to try opening doors while climbing. Player can't open anything if a door doesn't offer it, so it's ok to try. Handle doors don't change player y position (player walks in the air), so manually lower it.
Increase y height limit for doors to offer open from 15.0f/20.0f to 50.0f (normal door height). (For shutter doors height could be individualized depending on shutter door type in the future.)
Make climbing up animation play even for sloped ledges. The animation/action breaks because game thinks player is not on ground. So, at the end of Player_ProcessSceneCollision, if player is in climbing up action, manually set BGCHECKFLAG_GROUND.
Adds an option for a Better Save Menu that, after saving, allows you to effectively soft-reset the current save (either return to spawn or reset to the dungeon entrance), and additionally lets you reset to spawn specifcally, even if you are in a dungeon. This allows for escaping from the rare entrance-rando related softlock that can happen.
Journal ranking of not-yet-obtainable major items.
The Journal ranks item hints by item category, but the rank lookup called
Context::GetFinalGIEntry with checkObtainability = true. For any hinted item
that isn't currently obtainable, that helper substitutes a blue rupee, so
genuine major items (e.g. Anju's Lens of Truth while adult) were categorized
as junk and sorted below Pieces of Heart and Gold Skulltula Tokens.
Pass checkObtainability = false so hints rank by the true placed item's value
regardless of current reachability. Ice-trap disguises still rank as their
cover item (handled by the separate overrides path in GetFinalGIEntry), and
Mysterious Shuffle still disables the ranking.
Follow-up fix to the in-game Hint Tracker feature.
Add found-item handling to the Hint Tracker Journal.
Once every location an item hint points at has been collected, the hint is
"found": it sinks to the bottom of its group, renders dimmed with a tick
prefix, and can be removed entirely via a new "Hide Found Items" toggle. A
"Found (collected)" colour picker sets the dim colour.
Only item and item-area hints in the Journal are affected; Way of the Hero,
Foolish and area hints are untouched, and the Locations view is unchanged.
Found state is derived from each location's collection status
(ItemLocation::HasObtained), so no new save data is introduced.
Make Hint Tracker settings searchable, matching the Check Tracker.
The Check Tracker registers its checkbox settings as searchable menu widgets
(WidgetInfo + AddSearchWidget); the Hint Tracker only did so for its colours
and window type, leaving every checkbox reachable only from the dedicated
settings window. Convert the checkboxes (Enable Dragging, Only Enable While
Paused, Expand/Collapse Buttons, Search Input, Hint Totals, Hide Found Items)
to the same searchable widget pattern. The Font Size slider stays inline, as
the Check Tracker leaves its own font slider inline too.
Items group out into the seven categories. The tier collapse functions are replaced
by a single label lookup in ItemCategoryRank order, and the type-priority
key scaling grows from 4 to 8 slots to fit the extra groups.
Category labels reuse the established translations from the hint text
tables. Mysterious Shuffle still keeps the single "Items" group.
If Ruto enters Bigocto's room after she has already been abducted, the room behaves weird due to actor functions. Randomizer respawns Ruto after abduction, so this can become a problem.
The easiest solution is probably to just not let player open doors to Bigocto room while carrying Ruto after abduction.
This fix makes shutter doors in randomizer when offering player to open the door - check scene, abduction flag, if door is transition actor index 21 or 3, held actor, and if held actor is Ruto.
Looks like this: https://www.youtube.com/watch?v=2Siq2Z41Pqo
The shutter door in decomp and thus this fix uses macros that are missing here, I copied all of them to the corresponding place in actor.h as they are very useful for actor params and will be added anyway when/if code is synced with decomp.