imported>Ginger |
imported>NiceneNerd |
Line 117: |
Line 117: |
|
| |
|
| PARSE_SIZE is the amount of memory allocated from the resource heap in the <code>Resource::parse</code> function. Determining the exact value of PARSE_SIZE requires reversing that function and tracking calls to <code>operator new()</code> because the amount of dynamically allocated memory depends on the resource. | | PARSE_SIZE is the amount of memory allocated from the resource heap in the <code>Resource::parse</code> function. Determining the exact value of PARSE_SIZE requires reversing that function and tracking calls to <code>operator new()</code> because the amount of dynamically allocated memory depends on the resource. |
|
| |
| ==== BFRES resource size estimation (Wii U only) ====
| |
| [[File:Allrstb.png|alt=All BFRES RSTB entries|thumb|RSTB size analysis for all BFRES files. Y-axis: ratio, X-axis: BFRES file size, dot size: RSTB entry size.]]
| |
| Though current tools cannot yet calculate exact RSTB values for BFRES files, by analyzing the BFRES files Nintendo shipped with the game and their RSTB entries, it is possible to make some general observations which permit loose estimates for setting BFRES RSTB values.
| |
|
| |
| There are two types of BFRES file: model and texture. (Texture files are further divided into regular textures, which include <code>Tex1</code> in the name, and mipmaps, which contain <code>Tex2</code> in the name, but there seems to be no difference in RSTB calculations concerning these two types of textures.)
| |
|
| |
| [[File:Modelrstb.png|thumb|RSTB size analysis for BFRES model files. Y-axis: ratio, X-axis: BFRES file size, dot size: RSTB entry size.]]
| |
| For models, the ratio of RSTB entry size to BFRES file size increases early, but lazily, as BFRES file size decreases. The estimations are trickier for models than they are for textures, but they are still fairly simple overall.
| |
|
| |
| * If your model BFRES is less than 100KB, your RSTB entry should be 200% of your BFRES file size.
| |
| * If your model BFRES is greater than 100KB, but less than 1MB, your RSTB entry should be 175% of your BFRES file size.
| |
| * If your model BFRES is greater then 1MB, but less than 2MB, your RSTB entry should be 150% of your BFRES file size.
| |
| * If your model BFRES is greater than 2MB, your RSTB entry should be 125% of your BFRES file size.
| |
|
| |
| [[File:Tex1rstb.png|thumb|RSTB size analysis for BFRES tex1 texture files. Y-axis: ratio, X-axis: BFRES file size, dot size: RSTB entry size.]]
| |
| For textures, the ratio of RSTB entry size to BFRES file size increases late, but sharply, as BFRES file size decreases. This makes the estimates for RSTB entry size for textures incredibly easy.
| |
|
| |
| * If your texture BFRES is less than 100KB, your RSTB entry should be 200% of your BFRES file size.
| |
| * If your texture BFRES is greater than 100KB but less than 500KB, your RSTB entry should be 110% of your BFRES file size.
| |
| * If your texture BFRES is greater than 500KB, your RSTB entry should be 101% of your BFRES file size.
| |
|
| |
| [[File:Tex2rstb.png|thumb|RSTB size analysis for BFRES tex2 texture files. Y-axis: ratio, X-axis: BFRES file size, dot size: RSTB entry size.]]
| |
| Note: These analyses were done on the Wii U 1.5.0 version. Switch version calculations will vary.
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
| |
|
| [[Category:Internals]] | | [[Category:Internals]] |
| <references /> | | <references /> |