A mod file whose name carries Product.<n> and which the RomFS lacks was counted as made for another game version and never served. The game does ask for such names: on 1.4.3 with mods on, the file trace (trace = fs) shows it opening Sound/Resource/Pack_MasterSword.Product.110.bars.zs, while its RomFS holds only the Product.140 and the unversioned file. A sound mod that ships its pack under all those names was silent here and works on a console, where LayeredFS shows the game every file of a mod. Such files are now added overlays like any other new file. Another version's resource size table is still not served and still lends its entries; the files are still counted, and the Mods tab and docs/mods.md now say they are read only when asked for by name. tests/mods_romfs_check.py gets a case for it. Not run here: the test and --probe-fs need a build and the game's files. runtime/romfs.c compiles with llvm-mingw. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TgQM2zwuVagwScByEJhT8V
8.4 KiB
Mods
TotK Recomp loads the mods players make for the Switch emulators (Ryujinx, yuzu and its forks): texture and model
packs, gameplay and text changes from GameBanana and similar sites, TKMM's merged output, code patches (.ips,
.pchtxt) and Atmosphère cheat files. No mod or cheat file ships with the port.
Install a mod
-
Open the settings menu (F1, Esc, or Minus and Plus together on a controller), go to the Mods tab and choose Open mods folder. That is the
modsfolder next tototk.exe; the menu creates it when it is missing. -
Make one folder per mod in it and unpack the mod's archive into that folder. The mod's own folders (
romfs,exefs,cheats) must sit directly inside the mod's folder:mods\ Better Grass\ romfs\ ... Fast Travel Anywhere\ exefs\ patch.pchtxt My cheats\ cheats\ 277178B7DBA1B6D4.txtAn archive laid out for a Switch SD card or an emulator works as it is. Inside the mod's folder the port also finds
atmosphere\contents\0100F2C0115B6000\romfs,contents\0100F2C0115B6000\romfsand0100F2C0115B6000\romfs, the same places forexefsandcheats, andatmosphere\exefs_patches\<name>\for code patches. -
Start the game. A mod that patches the game's code makes the game rebuild itself first (see Code patches below).
-
Open the Mods tab to check the mod. Each row says how many game files the mod replaces and adds, how many cheats it brings, and why a part of it is not used.
Order and switches
The Mods tab lists every folder in mods. Select a mod and press A or Enter to switch it on or off. The top face button
or Ctrl+Up moves it up, the left face button or Ctrl+Down moves it down. When two mods change the same file, the
higher one wins; the lower mod's row says how many of its files the higher one covers. Changes apply after a restart.
The menu saves the order and the switches in totk.ini, under [mods], by folder name: mods_order and
mods_disabled. A folder the list does not name yet, such as a new or renamed one, goes below the named ones.
Mods that change the same files
Two mods that edit the same game file do not combine: the higher one wins the whole file. Merge such mods with
TKMM (TotK Mod Manager) and set its export location to an empty folder inside
mods, for example mods\TKMM. The exported folder then counts as one mod here. Mods packaged for TKMM only
(.tkcl files) go the same way.
The port merges the resource size table on its own: at every start with mods on, it combines the tables the mods ship
and raises the entries for files a mod made larger or added, the files inside a mod's packs (Pack\**\*.pack.zs)
included. A separate RESTBL mod is not needed. The table tells the game how much memory each file needs: a file that
outgrew its entry crashes the game when it loads, which can be long after the start, when the game first needs it. The
log line RomFS: resource size table: ... says how many entries were raised and names the first files inside packs.
Code patches (ExeFS)
A mod with .ips or .pchtxt files patches the game's code. A patch is for one game update: an .ips file is named
after the build id of the update's code, a .pchtxt file names it on its @nsobid line. The game's code is compiled
ahead of time, so these patches are built into totk.exe:
- The first start after such a mod is added closes the game and opens the setup's rebuild window. The rebuild takes a few minutes (the shaders stay prepared), then the game starts again. Saves and settings are kept.
- Until the rebuild succeeds, the whole mod stays off, its other files included.
- After the rebuild the mod switches on and off from the Mods tab like any other, without another rebuild.
The rebuild needs the setup folder the game was installed from. When that folder was moved or deleted, run
TotK-Setup.exe again on the same install folder: it does the same job. mods_rebuild = off under [mods] in
totk.ini turns the automatic rebuild off.
A code patch over one of the port's own patches (the 60 FPS patch, the resolution patch and the other entries under Built into the port) turns that built-in patch off while the mod is on. The mod's row names it.
A patch file may also change the game's data (constants and tables in its .rodata and .data). Those bytes are
stored into the loaded game at start, before it runs. When two mods write the same bytes, the higher one wins,
as with files.
Cheats
A cheat file is part of a mod: mods\<mod>\cheats\<build id>.txt, switched cheat by cheat on the Cheats tab. Cheats
that change the game's code need the same rebuild as code patches. cheats.md explains the file names for
each game update, the rebuild and which cheats cannot run.
Renaming a mod folder
The port keys a mod by its folder name. A renamed folder counts as a new mod:
- it moves below the mods the list names, and comes back switched on;
- its cheats come back switched off;
- its code patches and code cheats are built again, so the next start runs the rebuild.
Rename mod folders before you set them up in the menu, not after.
HD texture packs
Texture packs made for the emulators replace the game's textures with larger ones, so the heap the world's textures
stream into must grow. Such a pack grows it in its own System/HeapSize/Product.Nin_NX_NVN.HeapDef.byml.zs, sized for
the emulators' 8 GB memory option. The port reads that file at start: the texture heap and the game's memory pool grow
by the pack's amount, and the game gets the port's own heap table with that growth (the log says
resolution: mod <name> ships a HeapDef with TextureHeap ...). Nothing needs to be set. For a pack without such a file
that still loops the panic Blood Moon, set tex_heap_extra_mb under [mods] in totk.ini (0 to 4096 MiB).
Tested: HDPacks.com Tears of the Kingdom 4K Texture Pack v1.0 (4kTextures, 10,407 textures, 6.5 GB) on game 1.4.3
and 1.2.1, RTX 4080 SUPER: it loads into the game from a save and runs at the same frame rate, with about 3.3 GB more of
textures in memory (4.5 GB of game memory pools against 1.2 GB without it). Other packs are not tested and come with no
guarantee. Such a pack needs a lot of video memory; on a GPU with less than 8 GB, astc_bc = 1 under [performance]
keeps its textures at a quarter of the size.
What does not work
| On the Mods tab | Why | What to do |
|---|---|---|
| This folder has no romfs, exefs or cheats files. | The archive was unpacked one level too deep (mods\Mod\Mod\romfs), or it holds no game files. |
Move the folders up so romfs sits directly in the mod's folder. |
| ... files carry another game version in their names. | The files are named for another update (.Product.<number>.) and the game's own files have no such name. They are still served under those names, as on a console, because the game sometimes asks for one; another update's resource size table is the exception and only lends its entries. |
Nothing if the mod works. If it does nothing, download its release for your game update. |
| Its code patches (exefs) are made for another game version. | The patch files name another update's build id. | Same: get the release for your update. |
| This mod brings its own game code (a subsdk plugin or a replaced main). | Mods such as UltraCam ship compiled Switch code. The port cannot load it. | No workaround; the whole mod stays off. |
| This mod patches the game code (exefs) in a way the port cannot apply. | The patch writes the game's data, not its code, or changes code in a form the port cannot build. | No workaround; the reason follows on the row. |
| The folder name contains |. | The mod list uses | between names. |
Rename the folder. |
A mod never stops the game from starting. Whatever the port cannot use is left out and shown on the Mods tab.
When something looks wrong
- Switch the newest mod off on the Mods tab and restart. If the problem goes away, check that the mod is made for your game update and does not fight another mod over the same files.
logs\totk.lognext tototk.exenames every mod at the start (lines starting withmods:), the cheats (cheats:) and the resource size table (RomFS: resource size table:). Open log folder on the Advanced tab of the menu shows the logs.- When reporting a problem, attach
totk.logand list your mods with the links you downloaded them from.