Replacing original TPL textures.
Mar 14, 2020 2:22:45 GMT 10
tomazm, Re-Play games, and 6 more like this
Post by spuntik80 on Mar 14, 2020 2:22:45 GMT 10
Hi, this is my first post on this forum, so please don't yell at me much if i did something wrong^^
First of all i want to tell big thanks to people who is maintaining this great resource with many nice mods, and many great guides regardless modding Resident Evil games.
Now to subject, during my search for RE 4 HD mods i was not able to find any mod which will enhance textures from main menu, some items, treasures, and plenty of other minor textures which are located in, for example "ss.dat" file. Only one that i was able to find is working with "Texmod", and this is not actually the thing i wanted.
That "ss.dat" archive can be easily unpacked with "GCA" tool, but unlike "xfile.dat" or "xscr.dat" archives it don't contain unpacked textures, for example those in "TGA" format which can be easily replaced, it contain another "DAT" archives and "TPL" files.
Lets take single "TPL" files first, as i discover those are similar to "Mario Kart" ones. Similar but not same, let me explain what i was able to understand in those "TPL" textures, for example lets take "f00a.tpl" from "ss\eng\" folder:
If we open this file in hex editor we will find this header:
00 10 00 00 01 00 00 00 10 00 00 00 00 00 00 00
00 02 00 01 09 00 02 00 00 02 00 00 00 20 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
40 00 00 00 40 00 02 00 00 00 32 25 06 00 00 40
Lets disassemble it:
01 00 00 00
this 4 bytes if for textures quantity
00 02 00 01
this 4 bytes is for texture resolution in little-endian
Example for 512x256:
00 02 => (convert to big-endian) => 02 00 = 512
00 01 => (convert to big-endian) => 01 00 = 256
Example for 2048x1024:
00 08 => (convert to big-endian) => 08 00 = 2048
00 04 => (convert to big-endian) => 04 00 = 1024
09
this byte is for color rate, i'm not 100% sure yet, 08 = 4bit, 09 = 8bit
40 00 00 00
this 4 bytes is for texture data start offset
40 00 02 00
this 4 bytes is for texture data end offset in little-endian, and also start of some texture description section, size of that section for any 8bit texture always is "1024" bytes
40 is actually added header size to offset, if we subtract 40 from 40 00 02 00 we will receive multiplied resolution only
Example for 512x256:
40 00 02 00 - 40 = 00 00 02 00 => (convert to big-endian) => 00 02 00 00 = 131072 = 512*256
Example for 2048x1024:
40 00 20 00 - 40 = 00 00 20 00 => (convert to big-endian) => 00 20 00 00 = 2097152 = 2048*1024
I was able to replace this original texture 512x256 with 2048x1024 one, i was trying different combination of resolutions, for example 1920x1080, 2560x1440, they all get loaded but they have wrong position on screen, i guess if further dig this "TPL" texture header there is a possibility to fix texture position, but during my experiments i was not able to do so.
For now i can say that original texture must be replaced with one with same aspect ratio, like in described case it's "2:1". Also i was only able to work with "8 bit" textures, i don't know if this "TPL" is supporting "32 bit".
Also there is slightly different "TPL" files, those mostly used for numbers textures, for example lets take one of "TPL's" from "chap01.dat" from "ss\eng\" folder:
00 10 00 00 0C 00 00 00 10 00 00 00 00 00 00 00
10 00 10 00 09 00 00 00 20 00 00 00 10 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
50 02 00 00 50 03 00 00 00 80 30 11 05 00 00 40
10 00 10 00 09 00 00 00 20 00 00 00 10 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
50 07 00 00 50 08 00 00 00 80 30 11 05 00 00 40
10 00 10 00 09 00 00 00 20 00 00 00 10 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
50 0C 00 00 50 0D 00 00 00 80 30 11 05 00 00 40
10 00 10 00 09 00 00 00 20 00 00 00 10 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
50 11 00 00 50 12 00 00 00 80 30 11 05 00 00 40
10 00 10 00 09 00 00 00 20 00 00 00 10 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
50 16 00 00 50 17 00 00 00 80 30 11 05 00 00 40
10 00 10 00 09 00 00 00 20 00 00 00 10 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
50 1B 00 00 50 1C 00 00 00 80 30 11 05 00 00 40
10 00 10 00 09 00 00 00 20 00 00 00 10 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
50 20 00 00 50 21 00 00 00 80 30 11 05 00 00 40
10 00 10 00 09 00 00 00 20 00 00 00 10 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
50 25 00 00 50 26 00 00 00 80 30 11 05 00 00 40
10 00 10 00 09 00 00 00 20 00 00 00 10 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
50 2A 00 00 50 2B 00 00 00 80 30 11 05 00 00 40
10 00 10 00 09 00 00 00 20 00 00 00 10 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
50 2F 00 00 50 30 00 00 00 80 30 11 05 00 00 40
10 00 10 00 09 00 00 00 20 00 00 00 10 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
50 34 00 00 50 35 00 00 00 80 30 11 05 00 00 40
10 00 10 00 09 00 00 00 20 00 00 00 10 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
50 39 00 00 50 3A 00 00 00 80 30 11 05 00 00 40
As in first example this one have some similar values:
0C 00 00 00
this 4 bytes if for textures quantity
10 00 10 00
this 4 bytes is for texture resolution in little-endian
09
this byte is for color rate, 08 = 4bit, 09 = 8bit
50 02 00 00 - 50 39 00 00
all those yellow marked bytes, as in example above, is for texture data start offset
50 03 00 00 - 50 3A 00 00
all those blue marked bytes, as in example above, is for texture data end offset
50 03 00 00 - 50 07 00 00
free padding between first texture end and second texture start, and for second texture end and third texture start, and so on, is always "1024" bytes, it is reserved for texture description section, which i mention above
If we take first texture end value 50 03 00 00 and subtract first texture start value from it 50 02 00 00, we will receive multiplied resolution only
Example for 16x16:
50 03 00 00 - 50 02 00 00 = 00 01 => (convert to big-endian) => 01 00 = 256 = 16*16
Example for 128x128:
50 42 00 00 - 50 02 00 00 = 00 40 => (convert to big-endian) => 40 00 = 16384 = 128*128
Now, when we know how to edit header to make it fit new texture let me explain actual replacement process.
We will need a great tool, it's called "Game Graphic Studio".
1. Rip header of desired "TPL" file with hex editor.
2. Edit header to fix resolution and bit rate.
3. Save file with edited header.
4. Prepare texture with corresponding resolution and "8 bit" color rate, i was using "Paint.NET" and "PNG" textures.
5. Run "Game Graphic Studio".
6. Open original "TPL" with it.
7. Look at "Interlace" radio button menu, set proper "Interlace" method, for "f00a.tpl" it is "PS2".
8. Open new "TPL" with "Game Graphic Studio".
9. Open new texture.
10. In "Game Graphic Studio" drag-and-drop texture from right upper side to left bottom side and place it on "TPL" file.
11. Rename new "TPL" to original one name, so game can grab it.
12. Done.
It's a shame that no one respond to this thread so far, i guess it is because this game is old and not many people play it nowadays.
I will finish this thread with last explanation, it's about how to repack "DAT" files which contains "TPL's".
For all unpack and repack process we will need those tools below, i hope they are not hard to find, so i leave only their names here:
- RE4 DatExtract 1.0 by <St.Vampyre>
- RE4 DatRepack 1.0 by <St.Vampyre>
- RE4(PC) EFF Extractor + Repacker 2.0 by <St.Vampyre>
Also a note, those tools will work only with "Java™ SE Development Kit 7 Update 25" version.
All "DAT" files from "ss.dat", "em.dat", "etc.dat", "st1.dat", "st2.dat" etc. archives can be unpacked and repacked with those tools.
For example lets take "ada_ttl.dat" from "ss.dat" archive.
1. Use "RE4 DatExtract 1.0" to unpack "ada_ttl.dat" file.
2. Program will create folder "ada_ttl" and will put all contents of "ada_ttl.dat" file there.
3. Open "ada_ttl" folder, the next file we need is "000_ada_ttl.EFF".
4. Use "RE4(PC) EFF Extractor + Repacker 2.0" to unpack "000_ada_ttl.EFF" file.
5. Program will create folder "000_ada_ttl" and will put all contents of "000_ada_ttl.EFF" file there.
6. Open "000_ada_ttl" folder, the next file we need is "0005_000_ada_ttl.EF1".
7. Use "RE4(PC) EFF Extractor + Repacker 2.0" to further unpack "0005_000_ada_ttl.EF1" file.
8. Program will create folder "0005_000_ada_ttl" and will put all contents of "0005_000_ada_ttl.EF1" file there.
9. Open "0005_000_ada_ttl" folder, all files with ".EF1" extension it's actually single "TPL" files, there is 11 of them.
10. Use hex editor to edit "TPL" files headers, as described in instruction above.
11. Use "Game Graphic Studio" to make new "TPL's", as described in instruction above.
12. Use "RE4(PC) EFF Extractor + Repacker 2.0" to pack new files from "0005_000_ada_ttl" folder into "0005_000_ada_ttl.EF1" file.
13. Use "RE4(PC) EFF Extractor + Repacker 2.0" to pack new "0005_000_ada_ttl.EF1" file into "000_ada_ttl.EFF" file.
14. Use "RE4 DatRepack 1.0" to pack new "000_ada_ttl.EFF" into "ada_ttl.dat" file.
15. Put new "DAT" file to corresponding folder, so game can grab it.
16. Done.
Thanks for reading this, cheers^^
First of all i want to tell big thanks to people who is maintaining this great resource with many nice mods, and many great guides regardless modding Resident Evil games.
Now to subject, during my search for RE 4 HD mods i was not able to find any mod which will enhance textures from main menu, some items, treasures, and plenty of other minor textures which are located in, for example "ss.dat" file. Only one that i was able to find is working with "Texmod", and this is not actually the thing i wanted.
That "ss.dat" archive can be easily unpacked with "GCA" tool, but unlike "xfile.dat" or "xscr.dat" archives it don't contain unpacked textures, for example those in "TGA" format which can be easily replaced, it contain another "DAT" archives and "TPL" files.
Lets take single "TPL" files first, as i discover those are similar to "Mario Kart" ones. Similar but not same, let me explain what i was able to understand in those "TPL" textures, for example lets take "f00a.tpl" from "ss\eng\" folder:
If we open this file in hex editor we will find this header:
00 10 00 00 01 00 00 00 10 00 00 00 00 00 00 00
00 02 00 01 09 00 02 00 00 02 00 00 00 20 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
40 00 00 00 40 00 02 00 00 00 32 25 06 00 00 40
Lets disassemble it:
01 00 00 00
this 4 bytes if for textures quantity
00 02 00 01
this 4 bytes is for texture resolution in little-endian
Example for 512x256:
00 02 => (convert to big-endian) => 02 00 = 512
00 01 => (convert to big-endian) => 01 00 = 256
Example for 2048x1024:
00 08 => (convert to big-endian) => 08 00 = 2048
00 04 => (convert to big-endian) => 04 00 = 1024
09
this byte is for color rate, i'm not 100% sure yet, 08 = 4bit, 09 = 8bit
40 00 00 00
this 4 bytes is for texture data start offset
40 00 02 00
this 4 bytes is for texture data end offset in little-endian, and also start of some texture description section, size of that section for any 8bit texture always is "1024" bytes
40 is actually added header size to offset, if we subtract 40 from 40 00 02 00 we will receive multiplied resolution only
Example for 512x256:
40 00 02 00 - 40 = 00 00 02 00 => (convert to big-endian) => 00 02 00 00 = 131072 = 512*256
Example for 2048x1024:
40 00 20 00 - 40 = 00 00 20 00 => (convert to big-endian) => 00 20 00 00 = 2097152 = 2048*1024
I was able to replace this original texture 512x256 with 2048x1024 one, i was trying different combination of resolutions, for example 1920x1080, 2560x1440, they all get loaded but they have wrong position on screen, i guess if further dig this "TPL" texture header there is a possibility to fix texture position, but during my experiments i was not able to do so.
For now i can say that original texture must be replaced with one with same aspect ratio, like in described case it's "2:1". Also i was only able to work with "8 bit" textures, i don't know if this "TPL" is supporting "32 bit".
Also there is slightly different "TPL" files, those mostly used for numbers textures, for example lets take one of "TPL's" from "chap01.dat" from "ss\eng\" folder:
00 10 00 00 0C 00 00 00 10 00 00 00 00 00 00 00
10 00 10 00 09 00 00 00 20 00 00 00 10 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
50 02 00 00 50 03 00 00 00 80 30 11 05 00 00 40
10 00 10 00 09 00 00 00 20 00 00 00 10 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
50 07 00 00 50 08 00 00 00 80 30 11 05 00 00 40
10 00 10 00 09 00 00 00 20 00 00 00 10 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
50 0C 00 00 50 0D 00 00 00 80 30 11 05 00 00 40
10 00 10 00 09 00 00 00 20 00 00 00 10 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
50 11 00 00 50 12 00 00 00 80 30 11 05 00 00 40
10 00 10 00 09 00 00 00 20 00 00 00 10 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
50 16 00 00 50 17 00 00 00 80 30 11 05 00 00 40
10 00 10 00 09 00 00 00 20 00 00 00 10 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
50 1B 00 00 50 1C 00 00 00 80 30 11 05 00 00 40
10 00 10 00 09 00 00 00 20 00 00 00 10 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
50 20 00 00 50 21 00 00 00 80 30 11 05 00 00 40
10 00 10 00 09 00 00 00 20 00 00 00 10 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
50 25 00 00 50 26 00 00 00 80 30 11 05 00 00 40
10 00 10 00 09 00 00 00 20 00 00 00 10 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
50 2A 00 00 50 2B 00 00 00 80 30 11 05 00 00 40
10 00 10 00 09 00 00 00 20 00 00 00 10 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
50 2F 00 00 50 30 00 00 00 80 30 11 05 00 00 40
10 00 10 00 09 00 00 00 20 00 00 00 10 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
50 34 00 00 50 35 00 00 00 80 30 11 05 00 00 40
10 00 10 00 09 00 00 00 20 00 00 00 10 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
50 39 00 00 50 3A 00 00 00 80 30 11 05 00 00 40
As in first example this one have some similar values:
0C 00 00 00
this 4 bytes if for textures quantity
10 00 10 00
this 4 bytes is for texture resolution in little-endian
09
this byte is for color rate, 08 = 4bit, 09 = 8bit
50 02 00 00 - 50 39 00 00
all those yellow marked bytes, as in example above, is for texture data start offset
50 03 00 00 - 50 3A 00 00
all those blue marked bytes, as in example above, is for texture data end offset
50 03 00 00 - 50 07 00 00
free padding between first texture end and second texture start, and for second texture end and third texture start, and so on, is always "1024" bytes, it is reserved for texture description section, which i mention above
If we take first texture end value 50 03 00 00 and subtract first texture start value from it 50 02 00 00, we will receive multiplied resolution only
Example for 16x16:
50 03 00 00 - 50 02 00 00 = 00 01 => (convert to big-endian) => 01 00 = 256 = 16*16
Example for 128x128:
50 42 00 00 - 50 02 00 00 = 00 40 => (convert to big-endian) => 40 00 = 16384 = 128*128
Now, when we know how to edit header to make it fit new texture let me explain actual replacement process.
We will need a great tool, it's called "Game Graphic Studio".
1. Rip header of desired "TPL" file with hex editor.
2. Edit header to fix resolution and bit rate.
3. Save file with edited header.
4. Prepare texture with corresponding resolution and "8 bit" color rate, i was using "Paint.NET" and "PNG" textures.
5. Run "Game Graphic Studio".
6. Open original "TPL" with it.
7. Look at "Interlace" radio button menu, set proper "Interlace" method, for "f00a.tpl" it is "PS2".
8. Open new "TPL" with "Game Graphic Studio".
9. Open new texture.
10. In "Game Graphic Studio" drag-and-drop texture from right upper side to left bottom side and place it on "TPL" file.
11. Rename new "TPL" to original one name, so game can grab it.
12. Done.
It's a shame that no one respond to this thread so far, i guess it is because this game is old and not many people play it nowadays.
I will finish this thread with last explanation, it's about how to repack "DAT" files which contains "TPL's".
For all unpack and repack process we will need those tools below, i hope they are not hard to find, so i leave only their names here:
- RE4 DatExtract 1.0 by <St.Vampyre>
- RE4 DatRepack 1.0 by <St.Vampyre>
- RE4(PC) EFF Extractor + Repacker 2.0 by <St.Vampyre>
Also a note, those tools will work only with "Java™ SE Development Kit 7 Update 25" version.
All "DAT" files from "ss.dat", "em.dat", "etc.dat", "st1.dat", "st2.dat" etc. archives can be unpacked and repacked with those tools.
For example lets take "ada_ttl.dat" from "ss.dat" archive.
1. Use "RE4 DatExtract 1.0" to unpack "ada_ttl.dat" file.
2. Program will create folder "ada_ttl" and will put all contents of "ada_ttl.dat" file there.
3. Open "ada_ttl" folder, the next file we need is "000_ada_ttl.EFF".
4. Use "RE4(PC) EFF Extractor + Repacker 2.0" to unpack "000_ada_ttl.EFF" file.
5. Program will create folder "000_ada_ttl" and will put all contents of "000_ada_ttl.EFF" file there.
6. Open "000_ada_ttl" folder, the next file we need is "0005_000_ada_ttl.EF1".
7. Use "RE4(PC) EFF Extractor + Repacker 2.0" to further unpack "0005_000_ada_ttl.EF1" file.
8. Program will create folder "0005_000_ada_ttl" and will put all contents of "0005_000_ada_ttl.EF1" file there.
9. Open "0005_000_ada_ttl" folder, all files with ".EF1" extension it's actually single "TPL" files, there is 11 of them.
10. Use hex editor to edit "TPL" files headers, as described in instruction above.
11. Use "Game Graphic Studio" to make new "TPL's", as described in instruction above.
12. Use "RE4(PC) EFF Extractor + Repacker 2.0" to pack new files from "0005_000_ada_ttl" folder into "0005_000_ada_ttl.EF1" file.
13. Use "RE4(PC) EFF Extractor + Repacker 2.0" to pack new "0005_000_ada_ttl.EF1" file into "000_ada_ttl.EFF" file.
14. Use "RE4 DatRepack 1.0" to pack new "000_ada_ttl.EFF" into "ada_ttl.dat" file.
15. Put new "DAT" file to corresponding folder, so game can grab it.
16. Done.
Thanks for reading this, cheers^^