Beruflich Dokumente
Kultur Dokumente
One thing to note about this version of the BIN tool is that after repacking there is no ability to HEX
edit the luminosity or transperancy of the BIN file as we were once able to do. The extra blocks of
data that were normally used for this data have been removed to preserve space. This being said
there are still methods at our disposal to change BIN model luminosity/trasnperancy.
When we extract a BIN file we need to have the right TPL in the folder with the tools for it to read
the correct texture data from the TPL. This makes sure that the correct texture numsbers are
dispalyed in the generated MTL file.
When we repack the BIN model using the SMD and MTL files, the tools create a new TPL file that
will list all the new textures we are using. If we simply edit a model without adding new textures or
materials there is no need to use a newly generated TPL file.
Ususally every BIN file has a TPL that lists which textures it uses but we dont always know which
TPL file is used when we are extracting. The easiest way to make sure all textures come out right
in our generated MTL files when extracting is to place all the BIN & TPL files in the same folder
and extract them at once. While the BIN tool will extract any BIN file with any TPL (or even without
a TPL at all), the MTL file that is generated will not always reflect the correct textures unless the
right TPL is used.
08 00 00 01 00 00 00 00
08 00 00 01 01 00 00 00
08 00 00 01 02 00 00 00
08 00 00 01 03 00 00 00
08 00 00 01 04 00 00 00
08 00 00 01 05 00 00 00
08 00 00 01 06 00 00 00
08 00 00 01 07 00 00 00
08 00 00 01 08 00 00 00
08 00 00 01 is the pack file number in Little Endian order. This means all the byte order is reversed
(kind of).. you can google what Little Endian order means but simply put it looks like these
examples:
08 00 00 01 = 1000008
05 00 00 02 = 2000005
00, 01,02,03,04, etc are the texture numbers in the pack file. These numbers always come right
after the pack file number and are HEX values which need to be translated into DECIMAL values.
For example look at this TPL:
33 00 00 00 21 02 00 44
34 00 00 00 21 02 00 44
35 00 00 00 21 02 00 44
36 00 00 00 21 02 00 44
37 00 00 00 00 00 00 00
33 = 51
34 = 52
35 = 53
36 = 54 and so on...
The decimal values are actually the texture numbers inside the pack file (in the example above
our .pack file is 44000221. pack All pack file numbers of the textures inside the pack file are from
0000,0001,0002, 0003,0004, and on and on.. so...
08 00 00 01 00 00 00 00
08 00 00 01 01 00 00 00
08 00 00 01 02 00 00 00
08 00 00 01 03 00 00 00
08 00 00 01 04 00 00 00
08 00 00 01 05 00 00 00
08 00 00 01 06 00 00 00
08 00 00 01 07 00 00 00
08 00 00 01 08 00 00 00
Now we can look at textures 0000.dds through 0008.dds and compare them to the model. Do they
look like the ones this model is supposed to use? As stated above, if we use the wrong TPL the
model(s) will still get converted but the MTL file (and tcs) will have wrong texture entries.. (this is ok
if you are making a new model as you will be creating a new MTL).
FILE EXTRACTION
1 - place all BIN & TPL files of the model you wish to convert to SMD/OBJ in same folder as
RE4UHD_BIN_Tool_2018.exe & .bat files
2 - run BIN_Extract.bat to extract the files.
3 - Three new files are created upon extraction:
1 - SMD file (model with skeleton)
2 - MTL file (list of materials & textures that the TPL will use)
3 - OBJ file (we dont use this really, but it is created during the process of creating an MTL file)
NOTE* this tool will actually extract models wihtout a TPL (but the textures in the MTL will be
wrong)
EDITING MODELS
Now that we have an SMD file we can edit it in the preffered 3D application. If we want to add new
textures to the model that dont already exist in the .pack file for the model we are workign with we
will need to number the new textutre files in sequntial order, starting at the number of the last
texture number used. Example:
our 01000008 pack file has 30 textures starting at 0000.dds through to 0029.dds. If we want to add
new textures/materials to our model we must name them 0030.dds, 0031,dds and so on. Now we
make sure to repack our .pack file using the YZ2 toolset. We must make sure now that the
textures in the 3d application use these newly renumerated textures before we export the SMD
model to be converted to BIN. So once we have finsihed editing the model and added the new
textures to the .pack file we are ready to export our model.
EXPORTING MODELS
Once our textures are prepared & assigned to our meshes we are ready export our model. Here
are the steps for exporting the model:
1 - Export our model as SMD from our 3d app project to our working directory.
2 - Export the same model as OBJ to the same direcotry in order to create an MTL file. This MTL
file is used to tell the TPL file which textures we are using for the SMD).
3 - After exporting the model in OBJ format a new MTL file is created with it, which contains a list of
our materials & textures assocaited with them. Here is an example of what a MTL file will look like
after exporting from Milkshape 3D:
#
# pl08_000.mtl
#
newmtl new-shirt
illum 2
Kd 0.800000 0.800000 0.800000
Ka 0.200000 0.200000 0.200000
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
Ns 0.000000
map_Kd 0010.dds
map_D 0011.tga
Note that the entires with # are not read by the tool and can be used for perosnal notes.
Now lets take a moment to understand how the MTL file is responible for telling the game engine
which texture types are assigned to meshes:
note * Since SMD format can not support bump/specular/opacity(transparency) maps, Son of
Persia used an extra MTL file for that type of textures. Thus if you like to have any kind of
specular/bump and/or opacity(transparency) maps, first assign ALL of them to your model and
then export the model to OBJ/MTL format in order to get the required material MTL file. Otherwise
we can manually assign these in the MTL file. like so:
newmtl material_1
Ka 1.000000 1.000000 1.000000
Kd 0.800000 0.800000 0.800000
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
Ns 0.000000
map_Kd 0001.dds
map_Ks 0002.tga
map_Bump 0002.tga
The lines above in red have been added manually by simply thyping these values in the MTL
before repacking.
4 - Before repacking we should make sure all the entries in the MTL file must have the Materials
organized in ascending sequential order. (More on this below in the Working with the TCS file).
The materials in the MTL file should be organized so that the texuture numsbers are in ascending
sequential order like in the example below:
newmtl jacket
illum 2
Kd 0.800000 0.800000 0.800000
Ka 0.200000 0.200000 0.200000
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
Ns 0.000000
map_Kd 0024.dds
newmtl pants
illum 2
Kd 0.800000 0.800000 0.800000
Ka 0.200000 0.200000 0.200000
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
Ns 0.000000
map_Kd 0025.dds
map_D 0026.dds
newmtl arms
illum 2
Kd 0.800000 0.800000 0.800000
Ka 0.200000 0.200000 0.200000
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
Ns 0.000000
map_Kd 0027.dds
newmtl legs
illum 2
Kd 0.800000 0.800000 0.800000
Ka 0.200000 0.200000 0.200000
Ks 0.000000 0.000000 0.000000
Ke 0.000000 0.000000 0.000000
Ns 0.000000
map_Kd 0028.dds
In my experience, making sure all our material entires are in ascending sequential order by texture
number in the MTL file is the best way to make sure that our TCS file outputs correctly and that the
TPL order is perfect.
Now that we have and SMD and MTL file we are ready to repack using the
RE4UHD_BIN_Tool_2018.exe
FILE REPACKING
After we have edited the SMD file in our desired 3d program (like 3ds Max, Milkshape or Blender),
we must export the SMD file with the vertex weights as the BIN tools will crash if there are no
bones assigned to the exported meshes.
So first, before we repack the model we need to edit the contents of the BIN_Repack.bat file.
First, right click the BIN_Repack.bat file and click 'edit' (be sure to open with notepad or any other
txt editor). We shold see something like this:
This tells the BIN tool to -p (repack) the pl08_000.smd model using the pl08_000.mtl material file
and that all our textures will be placed in the 10000008 .pack file. (A previous version of this tool
required that we enter the first custom texture number after the pack file number but this is no
longer necessary).
Once the BIN_Repack.bat file has the correct information, we then save the file and close. Next
we double click on the BIN_Repack.bat file and the magic happens. 3 new files are created: our
new BIN, TPL and TCS files.
SPECIAL NOTE* the TPL file will be named according to the name of the SMD and needs to be
manually renamed. For example, in the above scenario the files that are generated upon
reapacking are are:
pl08_000.BIN
pl08_000.TPL
pl08_000.tcs
the file pl08_000.TPL needs to be renamed to pl08_001.TPL (or whatever the original TPL was
named), This is why it is important to know what the original TPL file is. Now before we simply
place these new BIN & TPL files into the UDAS (or other archive) for repacking we need to observe
the TCS/TPL files to make sure all the texture IDs were generated into the TPL file in correct order.
To do so we can simply open the TPL file and look at the texuture entries at the end of the file or
we can observe the contents of the TCS file
file 24 = 0024.dds
file 25 = 0025.dds
file 26 = 0026.dds
file 27 = 0027.dds
file 28 = 0028.dds
in the example above all the textures are mapped correctly. If your file looks out of order it might
look something like this:
file 24 = 0026.dds
file 25 = 0025.dds
file 26 = 0027.dds
file 27 = 0024.dds
file 27 = 0028.dds
If we dont correct the issue above then the game will load the wrong textures when the game is
loaded.
Option 1 -Eedit the MTL file entries so that all the materials are placed in ascending numerical
order by their texuture name as described above in step 4 of Exporting Models (remmeber we
would need to repack the file again after any changes to the MTL are made)
Option 2 - we can simply rename our texture files to what they are assigned in the TCS file (we
would rename file 0024.dds to 0025.dds, and rename file 0025.dds to 0024.dds etc). This method
does not require that we repack the model, but could lead to other problems with other models that
use these renamed texture files. I strongly suggest using Option 1 to avoid this.
If have chosen Option1 after repacking once again we look at the TCS file. If everthing looks to be
in the correct order, we simply place these newly generated BIN & TPL files to their relative
desinations (usually an UDAS archive or whatever archive they were extracted from). Repack that
archive and test in game!
The answer is simple. We have to add all the MTL entires for the models that share the TPL to
the MTL file for our edited model. To do this we can simply copy/paste the MTL entries from
these other models into the MTL file of our model we are working on, remembering though to keep
all the MTL entires in ascending numerical order.
So... what is the process of how we do this? To make sure all models point to the same TPL and
that they have the correct textures we have to:
1- Extract all models that share a TPL file using the BIN tools (so extract all hand models) using the
same shared TPL.
2- Create/edit our new/custom model and export it to SMD/MTL formats (as explained above)
3- Open original extracted MTL file(s) of (other) model(s) that share the TPL file with our custom
model in a text editor and copy/paste all of their content (if all of the original extracted MTL files are
the same, copy the content of one of them, otherwise you must copy the content of all of them) to
the end of MTL file of our custom model (the MTL file you exported after editing/creating your
custom model).
4- Generate your custom model's BIN & TPL files using BIN Tools (as explained above)
If all the MTL entires from the other models that share the TPL were added to the main MTL file
then the newly generated TPL should contain all the entries it requires to load the right textures for
all models using the shared TPL.
There is an archived turorial from Son of Persia on this topic of shared TPL files that I
reposted to the Resident Evil Modding Forums that you can see here:
http://residentevilmodding.boards.net/thread/7707/editing-models-shared-persias-tutorial
Please note that his tutorial was writen for the older version of the BIN tools, so things might be a
little different when repacking (see step 4 that the BIN_Generate.bat file entries are slightly
different), but the main concepts are almost identical. I simply chose to write a different tutorial
based on my methods and experiences.
If anyone is adimant about editing luminosity via BIN hex edit I can provide you with an older
version of the tools if needed. Please message me at the links below.