Help:Updating the RSTB: Difference between revisions
imported>Leoetlino (Created page with "The resource size table (RSTB) determines how much memory is allocated for a resource. If after editing a game resource its uncompressed file size has increased, the RSTB...") |
imported>Leoetlino No edit summary |
||
Line 1: | Line 1: | ||
The [[resource size table]] (RSTB) determines how much memory is allocated for a resource. If after editing a game resource its uncompressed file size has increased, the RSTB entry must be edited to avoid load failures. | The [[resource size table]] (RSTB) determines how much memory is allocated for a resource. If after editing a game resource its ''uncompressed'' file size has increased, the RSTB entry must be edited to avoid load failures. | ||
Symptoms of RSTB issues: | Symptoms of RSTB issues: |
Revision as of 22:19, 29 December 2018
The resource size table (RSTB) determines how much memory is allocated for a resource. If after editing a game resource its uncompressed file size has increased, the RSTB entry must be edited to avoid load failures.
Symptoms of RSTB issues:
- The game crashes when loading a resource.
- The game fails to load a resource.
- The game gets stuck on the loading screen.
This guide explains how to update the RSTB.
Prerequisites
- Python 3.6+ 64 bit (more details at Help:Setting up tools)
- rstbtool
Updating entries
Open a terminal / command prompt and run the following command:
rstbtool [path to RSTB] set [resource path] [new size]
- [path to RSTB] is a path to the ResourceSizeTable.product.rsizetable file. It can be found in System/Resource.
- [resource path] is the canonical resource path of the resource. Generally, this is the path of the resource (relative to any archive) without the "s" prefix in the extension for compressed files. If you're not sure what this is, look at the second column in the lists of resources.
- [new size] is a path to your edited file.
- If you're editing a Wii U RSTB, add
-b
(Big Endian) at the end of the line.
Example
For Switch:
rstbtool botw/System/Resource/ResourceSizeTable.product.srsizetable set Actor/GeneralParamList/Item_Fruit_A.bgparamlist path/to/edited/Item_Fruit_A.sbgparamlist
For Wii U:
rstbtool -b botw/System/Resource/ResourceSizeTable.product.srsizetable set Actor/GeneralParamList/Item_Fruit_A.bgparamlist path/to/edited/Item_Fruit_A.sbgparamlist
To make it clear: the first path (the one that comes right after set
) does not depend on where your modified file is. Think of it like a unique identifier for the resource file.
If everything goes well, no errors will be shown on the screen. If rstbtool says it is unable to calculate the resource size, then read the following section.
Deleting entries
Run the following command:
rstbtool [path to RSTB] del [resource path]
- [path to RSTB] and [resource path]: see above.
- If you're editing a Wii U RSTB, add
-b
(Big Endian) at the end of the line.
Example
For Switch:
rstbtool botw/System/Resource/ResourceSizeTable.product.srsizetable del Actor/GeneralParamList/Item_Fruit_A.bgparamlist
For Wii U:
rstbtool -b botw/System/Resource/ResourceSizeTable.product.srsizetable del Actor/GeneralParamList/Item_Fruit_A.bgparamlist
Why deleting entries is sometimes necessary
Currently, rstbtool cannot calculate sizes for complex resources (e.g. bfres, AAMP files). The workaround is to delete their RSTB entry: doing that causes the game to allocate a lot of memory, enough to ensure that the resource can be loaded correctly. This wastes a significant amount of memory, but it is a quick and simple workaround that is perfectly fine if you only do it for a limited number of resources (100 should be safe).