RE4 PS2 SCENARIO SMD TOOL by JADERLINK
Jan 3, 2024 3:27:00 GMT 10
christhehero07 and HardRain like this
Post by JADERLINK on Jan 3, 2024 3:27:00 GMT 10
Extract and repack RE4 PS2 scenario smd file into a single .obj file
Note: the topic is being translated by google translator, because I only know Portuguese Brazil.
SourceCode: github.com/JADERLINK/RE4-PS2-SCENARIO-SMD-TOOL
Download: github.com/JADERLINK/RE4-PS2-SCENARIO-SMD-TOOL/releases
The content below is a translation of the README.md file of the source code.
Programs designed to extract and repackage scenarios using only an .OBJ file
Update B.1.2.0.0
In this update, I redid the tool, now it is just a single executable. The way this tool works is similar to the UHD scenario tool, but this one is for the PS2 version.
Files from the previous version are NOT compatible with this version;
RE4_PS2_SCENARIO_SMD_TOOL.exe
Program designed to extract and repackage .SMD scene files from re4 PS2;
##Extract:
Use the bat: "RE4_PS2_SCENARIO_SMD_TOOL Extract all scenario SMD.bat"
In this example I will use the file: r100_004.SMD
When extracting, the following files will be generated:
* r100_004.scenario.idxps2scenario // important configuration file, for repack using .obj;
* r100_004.scenario.idxps2smd // important configuration file, for repack using .bin files;
* r100_004.scenario.obj // content of the entire scenario, this is the file you will edit;
* r100_004.scenario.mtl // file that accompanies the .obj;
* r100_004.scenario.idxmaterial // content of materials (alternative to using .mtl);
* r100_004.TPL // this is the TPL file that is inside the SMD, it is where the model textures are located;
* r100_004_BIN\ // folder containing .bin files;
* r100_004.scenario.DrawDistance.obj // informational file, but not used in the repack.
* r100_004.scenario.reference.smd // informational file, but not used in the repack.
##Repack:
There are two ways to repack.
* Using the .idxps2scenario file, the repack will be done using the .obj file;
* Using the .idxps2smd file, the repack will be done with the .bin files from the "r100_004_BIN" folder;
## Repack with .idxps2scenario
Use the bat: "RE4_PS2_SCENARIO_SMD_TOOL Repack all with idxps2scenario.bat"
In this example I will use the file: "r100_004.scenario.idxuhdscenario"
which will also request the files:
* r100_004.scenario.obj (required);
* r100_004.TPL (required);
* r100_004.scenario.mtl OR r100_004.scenario.idxmaterial;
When repacking, the following files will be generated:
* r100_004.SMD (this is the file to be placed in r100.dat);
* r100_004.scenario.Repack.idxmaterial
* r100_004.scenario.Repack.idxps2smd
* r100_004.scenario.Repack.reference.smd
* r100_004_BIN\ //folder containing the new .BIN files; (warning: it overwrites files);
## Repack with .idxps2smd
Use the bat: "RE4_PS2_SCENARIO_SMD_TOOL Repack all with idxps2smd.bat"
In this example I will use the file: "r100_004.scenario.idxps2smd"
Who will request the files:
-- the .BIN files from the "r100_004_BIN" folder;
-- and the TPL file named "r100_004.TPL";
When repacking, the following files will be generated:
-- r100_004.SMD (this is the file to be placed in r100.dat);
Note: this is the old method, in which bins are edited individually, however repacking with .idxps2scenario creates new modified bins, and a new .idxps2smd, which can be used to do this repack; this option is for if you want to place a .bin in the .smd that the program cannot create.
## About r100_004.scenario.obj
This file is where the entire scenario is, in it the BIN files are separated by groups, in which the nomenclature must be respected:
Example:
PS2SCENARIO#SMD_000#SMX_000#TYPE_09#BIN_129#COLOR#
PS2SCENARIO#SMD_077#SMX_060#TYPE_8C#BIN_140#NORMAL#
Being:
* The group name must begin with "PS2SCENARIO", and be divided by #
* The order of the fields cannot be changed;
* SMD_000 this is the ID of the Entry/Line position in the .SMD, the numbering is in decimal
* SMX_000 this is the SMX ID, see the .SMX file, the numbering is in decimal
* TYPE_08 I don't know what it is, the numbering is in hexadecimal.
* BIN_000 this is the id of the bin that will be used, for repeated bins, only the first will be considered, (the next one with the same id, the same model as the first will be used).
* COLOR/NORMAL this text defines the type of BIN, being:
+ COLOR: BIN will not have normals, but will have color per vertices;
+ NORMAL: BIN will have normals, and will not have color per vertices (this type takes up more space, as it also supports Bone weights);
* the group name must end with # (because, after saving the file, Blender puts more text at the end of the group name);
----> If you use another editor (3dsMax), the name of the objects/groups can also be:
PS2SCENARIO_SMD_000_SMX_000_TYPE_09_BIN_129_COLOR_
PS2SCENARIO_SMD_077_SMX_060_TYPE_8C_BIN_140_NORMAL_
----> About group checks:
* In Repack, if the text "The group name is wrong;" appears on the right side of the group name, it means that the group name is wrong, and your SMD file will be wrong;
* And if the right side says "Warning: Group not used;" this group is being ignored by my program, if, in fact, you would like to use it, you must fix the group name;
**Editing the .obj file in Blender**
In the .obj importer, check the "Split By Group" box on the right side of the screen.
With the imported file, each object represents a .BIN file
Note: if you have a problem with transparent textures turning black, use this plugin: github.com/JADERLINK/Blender_Transparency_Fix_Plugin
**When saving the file**
Check the "Triangulated Mesh" and "Object Groups" and "Colors" boxes.
in the .obj file, the group name will have "_Mesh" at the end of the name (so, in the editor, end the group name with # to avoid problems);
## About .idxps2scenario / .idxps2smd
Below is the list of most important commands present in the file:
* SmdAmount:283 // represents the amount of Entry/Line in .Smd (you can change it, but in some scenarios it may crash the game)
* SmdFileName:r100_004.SMD // this is the name of the Smd file that will be generated
* TplFile:r100_004.TPL // this is the name of the TPL file that will be placed inside the SMD;
* BinFolder:r100_004_BIN // this is the name of the folder where the .BIN files are saved;
UseIdxMaterial:false // if activated, the .idxmaterial file will be used instead of the .mtl to perform the repack (field only in idxps2scenario);
BinAmount:148 // number of bins files that will be placed in .smd (field only in idxps2smd);
* Other commands that start with numbers are self-descriptive (the number is the Smd ID)
* the "_position*" field is divided by 100, in relation to the original value;
* the "_objectStatus" field refers to the "TYPE" field in the .obj;
## Materials/Textures in MTL
Now, the MTL file is where the IDs (TPL indexes) of the textures used in the BIN file are defined;
Now, the texture name has to be just a number that is the texture ID;
The MTL file expects these textures to be in a folder with the same name as the BIN file that was extracted;
To extract the textures from the TPL file, use the program [RE4-PS2-TPL-TOOL] from version B.1.1. 0.0;
Use Bat: "RE4_PS2_TPL_EXTRACT_To_Scenario_TPL.bat", to extract the textures correctly;
Attention: remember to repack the TPL before repacking the SMD;
## DrawDistance
If your model is too far from the original position, it may start to appear and disappear, this is due to the values that define how far the models will be seen.
Change the values of "xxx_DrawDistanceNegative*" to -327670
And the values of "xxx_DrawDistancePositive*:" to 655340
This will ensure that the model is visible, but it may cause a bug in the lighting.
## Bugs and Info
When changing the original values of the fields "xxx_scale*", "xxx_angle*", "xxx_position*", "xxx_DrawDistanceNegative*" and "xxx_DrawDistancePositive*", it can cause a bug in the model's lighting, which I don't know how to resolve.
Note: The program changes the value of "xxx_position*" automatically, as I have to center the BIN files, so for all SMD entries with repeated BINs, you will have to recalculate the position of the object;
The new positions are in the file "r100_004.scenario.Repack.idxps2smd";
## Print:
By: JADERLINK
2024-01-02
Note: the topic is being translated by google translator, because I only know Portuguese Brazil.
SourceCode: github.com/JADERLINK/RE4-PS2-SCENARIO-SMD-TOOL
Download: github.com/JADERLINK/RE4-PS2-SCENARIO-SMD-TOOL/releases
The content below is a translation of the README.md file of the source code.
Programs designed to extract and repackage scenarios using only an .OBJ file
Update B.1.2.0.0
In this update, I redid the tool, now it is just a single executable. The way this tool works is similar to the UHD scenario tool, but this one is for the PS2 version.
Files from the previous version are NOT compatible with this version;
RE4_PS2_SCENARIO_SMD_TOOL.exe
Program designed to extract and repackage .SMD scene files from re4 PS2;
##Extract:
Use the bat: "RE4_PS2_SCENARIO_SMD_TOOL Extract all scenario SMD.bat"
In this example I will use the file: r100_004.SMD
When extracting, the following files will be generated:
* r100_004.scenario.idxps2scenario // important configuration file, for repack using .obj;
* r100_004.scenario.idxps2smd // important configuration file, for repack using .bin files;
* r100_004.scenario.obj // content of the entire scenario, this is the file you will edit;
* r100_004.scenario.mtl // file that accompanies the .obj;
* r100_004.scenario.idxmaterial // content of materials (alternative to using .mtl);
* r100_004.TPL // this is the TPL file that is inside the SMD, it is where the model textures are located;
* r100_004_BIN\ // folder containing .bin files;
* r100_004.scenario.DrawDistance.obj // informational file, but not used in the repack.
* r100_004.scenario.reference.smd // informational file, but not used in the repack.
##Repack:
There are two ways to repack.
* Using the .idxps2scenario file, the repack will be done using the .obj file;
* Using the .idxps2smd file, the repack will be done with the .bin files from the "r100_004_BIN" folder;
## Repack with .idxps2scenario
Use the bat: "RE4_PS2_SCENARIO_SMD_TOOL Repack all with idxps2scenario.bat"
In this example I will use the file: "r100_004.scenario.idxuhdscenario"
which will also request the files:
* r100_004.scenario.obj (required);
* r100_004.TPL (required);
* r100_004.scenario.mtl OR r100_004.scenario.idxmaterial;
When repacking, the following files will be generated:
* r100_004.SMD (this is the file to be placed in r100.dat);
* r100_004.scenario.Repack.idxmaterial
* r100_004.scenario.Repack.idxps2smd
* r100_004.scenario.Repack.reference.smd
* r100_004_BIN\ //folder containing the new .BIN files; (warning: it overwrites files);
## Repack with .idxps2smd
Use the bat: "RE4_PS2_SCENARIO_SMD_TOOL Repack all with idxps2smd.bat"
In this example I will use the file: "r100_004.scenario.idxps2smd"
Who will request the files:
-- the .BIN files from the "r100_004_BIN" folder;
-- and the TPL file named "r100_004.TPL";
When repacking, the following files will be generated:
-- r100_004.SMD (this is the file to be placed in r100.dat);
Note: this is the old method, in which bins are edited individually, however repacking with .idxps2scenario creates new modified bins, and a new .idxps2smd, which can be used to do this repack; this option is for if you want to place a .bin in the .smd that the program cannot create.
## About r100_004.scenario.obj
This file is where the entire scenario is, in it the BIN files are separated by groups, in which the nomenclature must be respected:
Example:
PS2SCENARIO#SMD_000#SMX_000#TYPE_09#BIN_129#COLOR#
PS2SCENARIO#SMD_077#SMX_060#TYPE_8C#BIN_140#NORMAL#
Being:
* The group name must begin with "PS2SCENARIO", and be divided by #
* The order of the fields cannot be changed;
* SMD_000 this is the ID of the Entry/Line position in the .SMD, the numbering is in decimal
* SMX_000 this is the SMX ID, see the .SMX file, the numbering is in decimal
* TYPE_08 I don't know what it is, the numbering is in hexadecimal.
* BIN_000 this is the id of the bin that will be used, for repeated bins, only the first will be considered, (the next one with the same id, the same model as the first will be used).
* COLOR/NORMAL this text defines the type of BIN, being:
+ COLOR: BIN will not have normals, but will have color per vertices;
+ NORMAL: BIN will have normals, and will not have color per vertices (this type takes up more space, as it also supports Bone weights);
* the group name must end with # (because, after saving the file, Blender puts more text at the end of the group name);
----> If you use another editor (3dsMax), the name of the objects/groups can also be:
PS2SCENARIO_SMD_000_SMX_000_TYPE_09_BIN_129_COLOR_
PS2SCENARIO_SMD_077_SMX_060_TYPE_8C_BIN_140_NORMAL_
----> About group checks:
* In Repack, if the text "The group name is wrong;" appears on the right side of the group name, it means that the group name is wrong, and your SMD file will be wrong;
* And if the right side says "Warning: Group not used;" this group is being ignored by my program, if, in fact, you would like to use it, you must fix the group name;
**Editing the .obj file in Blender**
In the .obj importer, check the "Split By Group" box on the right side of the screen.
With the imported file, each object represents a .BIN file
Note: if you have a problem with transparent textures turning black, use this plugin: github.com/JADERLINK/Blender_Transparency_Fix_Plugin
**When saving the file**
Check the "Triangulated Mesh" and "Object Groups" and "Colors" boxes.
in the .obj file, the group name will have "_Mesh" at the end of the name (so, in the editor, end the group name with # to avoid problems);
## About .idxps2scenario / .idxps2smd
Below is the list of most important commands present in the file:
* SmdAmount:283 // represents the amount of Entry/Line in .Smd (you can change it, but in some scenarios it may crash the game)
* SmdFileName:r100_004.SMD // this is the name of the Smd file that will be generated
* TplFile:r100_004.TPL // this is the name of the TPL file that will be placed inside the SMD;
* BinFolder:r100_004_BIN // this is the name of the folder where the .BIN files are saved;
UseIdxMaterial:false // if activated, the .idxmaterial file will be used instead of the .mtl to perform the repack (field only in idxps2scenario);
BinAmount:148 // number of bins files that will be placed in .smd (field only in idxps2smd);
* Other commands that start with numbers are self-descriptive (the number is the Smd ID)
* the "_position*" field is divided by 100, in relation to the original value;
* the "_objectStatus" field refers to the "TYPE" field in the .obj;
## Materials/Textures in MTL
Now, the MTL file is where the IDs (TPL indexes) of the textures used in the BIN file are defined;
Now, the texture name has to be just a number that is the texture ID;
The MTL file expects these textures to be in a folder with the same name as the BIN file that was extracted;
To extract the textures from the TPL file, use the program [RE4-PS2-TPL-TOOL] from version B.1.1. 0.0;
Use Bat: "RE4_PS2_TPL_EXTRACT_To_Scenario_TPL.bat", to extract the textures correctly;
Attention: remember to repack the TPL before repacking the SMD;
## DrawDistance
If your model is too far from the original position, it may start to appear and disappear, this is due to the values that define how far the models will be seen.
Change the values of "xxx_DrawDistanceNegative*" to -327670
And the values of "xxx_DrawDistancePositive*:" to 655340
This will ensure that the model is visible, but it may cause a bug in the lighting.
## Bugs and Info
When changing the original values of the fields "xxx_scale*", "xxx_angle*", "xxx_position*", "xxx_DrawDistanceNegative*" and "xxx_DrawDistancePositive*", it can cause a bug in the model's lighting, which I don't know how to resolve.
Note: The program changes the value of "xxx_position*" automatically, as I have to center the BIN files, so for all SMD entries with repeated BINs, you will have to recalculate the position of the object;
The new positions are in the file "r100_004.scenario.Repack.idxps2smd";
## Print:
By: JADERLINK
2024-01-02