TUTORIAL How to edit skins and textures (PS2)
Aug 6, 2021 7:24:49 GMT 10
Biohazard4X and Cᴏɴᴅ3ᴍɴᴇᴅ24 like this
Post by HardRain on Aug 6, 2021 7:24:49 GMT 10
Hi there, guys.
If you are a RE4 modder of the PlayStation 2 version and tried to change some game textures, you maybe noticed that most of them simply doesn't work very well after changing, they become dispersed and every pixels goes to random places, just like this:
And you can't see a thing through Game Graphic Studio as well:
I was kinda upset with this, but finally I found a solution.
With this workaround it is now possible to increase the resolution and the colors so we can edit it easily through GGS.
Many thanks to Biohazard4X again for sending me tool to make this possible.
Tools you will need:
GIF 2 TPL Tool (Link updated in 18, january, 2022)
Game Graphic Studio
Any image editor you like, I use Photoshop + Paint.NET
First of all, extract GifTpl to a empty folder.
This tool, made by St.Vampyre, makes the conversion of .gif images to .tpl files in just a click.
At this point I suggest that you download (or create) your new texture that you want to insert at Leon's clothes, I will be using Navy Seal skin to replace pl09 (Leon with bulletproof).
You can download it here.
Now let's move our new images to the GifTpl folder and choose which one we are gonna import first. In my case I will be using the second image, related to his chest.
Before anything we need to see what resolution is our image, in my case it is 512x256. But this resolution is 2x bigger than the original file in the pl09, so for us to make some tests first, we should import the image with the same original resolution.
You can use Game Graphic Studio to see the correct resolution:
So use an online editor or your desirable image editor to resize the image to 256x128 and save it as GIF format.
After resizing, rename it to input.gif and move it to the GifTpl folder, double click on RUN bat file, this will create your new .tpl file, which will be automatically named to output.tpl.
Open this output.tpl with HxD, then extract the pl09.dat and open the first .tpl you see, this will contain all the textures you need.
With both .tpl opened in HxD, we need to change the old data to the new data, so firstly we need to understand what is what.
Every texture header contains 30 bytes of lenght:
With these informations we can already replace our images, so let's do it.
Press CTRL + E and put the offsets that are in the pointers, they are always big endian, so type it inversed:
00 00 00 40 is the start of the texture data
00 00 80 40 is the start of the palette data
If you did it correctly, the program will auto select all the bytes betwenn those offsets, but notice that it selected a single byte in the last row, we must unselect this byte since this is the start of the palette data.
Press CTRL + C to copy all 8000 selected bytes and paste it at the end of the original pl09 tpl file.
Now I'd highly suggest that you open notepad to type the new offset the texture and palette datas will start.
Now we need to return to our output.tpl and copy the rest of the bytes below, which belongs to the palette data, they are smaller so you just click and slide down to select them.
(I think they all have 400 bytes lenght).
After returning to pl09 tpl file, press CTRL + S to save so the numbers stops being red and you can see where you will insert the new palette data.
Paste the 400 bytes at the end of the file and write the offset of where it starts.
Now that we have inserted all the data, we must update the pointers and some other values in the header of the correspondent texture.
As we seen before in the navy pack, the chest image is the second texture for leon so we need to change the values at our second texture header, look at the pic where I explained the size and bytes of the texture header.
If you followed all the steps, we won't need to update the resolution bytes, but only these ones:
Now save the file, repack the pl09.dat and test it out in the game (you can import it into pl00 if you don't have a save file). Be warned that as we are importing a file with better textures, you will need to reserve more space in the AFS, so maybe you will need to rebuild it.
And if you did everything correctly it should show like this:
Yeah it is a total mess and looks like crocodile skin, but there are ways to fix it:
Open the pl09.dat at Game Graphic Studio, we can now see the second texture correctly placed there so you wonder why it still didn't work.
Steps to do: You must always remember that all textures from this version of the game are inverted, if compared to the ones we find at xfile on PC version.
So open your image editor and invert the image vertically:
Now go back to Game Graphic Studio and import the new inverted image, and remember to select PS2 as the interlace mode, since in the texture header the interlace value is 02.
Test it out in the game and it should work amazingly.
Since we have modified just one texture, only one part of the costume will be changed, so do some training by changing the rest of the textures.
As this method is simple and easy to do, I have seen some very little visual bugs occuring during gameplay, so that means we need to learn more about the purpose of some bytes inside the texture header.
And if we use these same steps with original pl00 Leon with jacket, it shows a lot of visual bugs, I am looking for a way to fix this ASAP.
If you are willing to help on this, I will be very grateful.
I hope this tutorial helped you, but if you have any doubt about anything, just ask here.
Stay cool.
If you are a RE4 modder of the PlayStation 2 version and tried to change some game textures, you maybe noticed that most of them simply doesn't work very well after changing, they become dispersed and every pixels goes to random places, just like this:
And you can't see a thing through Game Graphic Studio as well:
I was kinda upset with this, but finally I found a solution.
With this workaround it is now possible to increase the resolution and the colors so we can edit it easily through GGS.
Many thanks to Biohazard4X again for sending me tool to make this possible.
Tools you will need:
GIF 2 TPL Tool (Link updated in 18, january, 2022)
Game Graphic Studio
Any image editor you like, I use Photoshop + Paint.NET
First of all, extract GifTpl to a empty folder.
This tool, made by St.Vampyre, makes the conversion of .gif images to .tpl files in just a click.
At this point I suggest that you download (or create) your new texture that you want to insert at Leon's clothes, I will be using Navy Seal skin to replace pl09 (Leon with bulletproof).
You can download it here.
Now let's move our new images to the GifTpl folder and choose which one we are gonna import first. In my case I will be using the second image, related to his chest.
Before anything we need to see what resolution is our image, in my case it is 512x256. But this resolution is 2x bigger than the original file in the pl09, so for us to make some tests first, we should import the image with the same original resolution.
You can use Game Graphic Studio to see the correct resolution:
So use an online editor or your desirable image editor to resize the image to 256x128 and save it as GIF format.
After resizing, rename it to input.gif and move it to the GifTpl folder, double click on RUN bat file, this will create your new .tpl file, which will be automatically named to output.tpl.
Open this output.tpl with HxD, then extract the pl09.dat and open the first .tpl you see, this will contain all the textures you need.
With both .tpl opened in HxD, we need to change the old data to the new data, so firstly we need to understand what is what.
Every texture header contains 30 bytes of lenght:
With these informations we can already replace our images, so let's do it.
Press CTRL + E and put the offsets that are in the pointers, they are always big endian, so type it inversed:
00 00 00 40 is the start of the texture data
00 00 80 40 is the start of the palette data
If you did it correctly, the program will auto select all the bytes betwenn those offsets, but notice that it selected a single byte in the last row, we must unselect this byte since this is the start of the palette data.
Press CTRL + C to copy all 8000 selected bytes and paste it at the end of the original pl09 tpl file.
Now I'd highly suggest that you open notepad to type the new offset the texture and palette datas will start.
Now we need to return to our output.tpl and copy the rest of the bytes below, which belongs to the palette data, they are smaller so you just click and slide down to select them.
(I think they all have 400 bytes lenght).
After returning to pl09 tpl file, press CTRL + S to save so the numbers stops being red and you can see where you will insert the new palette data.
Paste the 400 bytes at the end of the file and write the offset of where it starts.
Now that we have inserted all the data, we must update the pointers and some other values in the header of the correspondent texture.
As we seen before in the navy pack, the chest image is the second texture for leon so we need to change the values at our second texture header, look at the pic where I explained the size and bytes of the texture header.
If you followed all the steps, we won't need to update the resolution bytes, but only these ones:
Now save the file, repack the pl09.dat and test it out in the game (you can import it into pl00 if you don't have a save file). Be warned that as we are importing a file with better textures, you will need to reserve more space in the AFS, so maybe you will need to rebuild it.
And if you did everything correctly it should show like this:
Yeah it is a total mess and looks like crocodile skin, but there are ways to fix it:
Open the pl09.dat at Game Graphic Studio, we can now see the second texture correctly placed there so you wonder why it still didn't work.
Steps to do: You must always remember that all textures from this version of the game are inverted, if compared to the ones we find at xfile on PC version.
So open your image editor and invert the image vertically:
Now go back to Game Graphic Studio and import the new inverted image, and remember to select PS2 as the interlace mode, since in the texture header the interlace value is 02.
Test it out in the game and it should work amazingly.
Since we have modified just one texture, only one part of the costume will be changed, so do some training by changing the rest of the textures.
As this method is simple and easy to do, I have seen some very little visual bugs occuring during gameplay, so that means we need to learn more about the purpose of some bytes inside the texture header.
And if we use these same steps with original pl00 Leon with jacket, it shows a lot of visual bugs, I am looking for a way to fix this ASAP.
If you are willing to help on this, I will be very grateful.
I hope this tutorial helped you, but if you have any doubt about anything, just ask here.
Stay cool.