RE4 PS2 BIN Model Converter Tool
Feb 18, 2023 10:46:56 GMT 10
Sr. Belt, JADERLINK, and 4 more like this
Post by HardRain on Feb 18, 2023 10:46:56 GMT 10
Hi there, everyone.
As we know, there aren't many modders/programmers interested in editing PS2 version of RE4 game, if compared to UHD ones. So tools and resources are still very limited.
In early January, 2023, I met JADERLINK who is a very talented and persistent guy. I asked him for help about editing 3D .bin models for PS2 version, and since then we've been developing a tool for it, and today I'm gonna try to explain here how it works.
Some starting notes:
• So far we can already convert any custom 3D .obj model to .bin format, but it will only work 100% on models that does not contain bones, such as room models, inventory models, pickable items, examinable items, key items and etc. It does not have support for skeleton data yet, as it is in development stage;
• The project is Open Source, so if you have interest and programming skills in C#, you can contribute by creating a fork;
• The current amount of vertices PS2 can handle at once is unknown at the moment, feel free to explore, but keep in mind we're dealing with a quite old hardware.
Everything set, let's move.
First step - The Model:
As .bin format is not 100% documented yet, we simply reuse default header sections.
Choose a model with no bones for reference, I will be using a tree which I extracted from r101 room, you can download it here if you want.
Then now use the BIN decoder (with room .bat file) to convert the model to .obj format so we can see it and edit from any 3D editor (I will be using Blender). It will generate many debug txt files, but we are going to need only the .obj and .idxbin files.

----

Note that on the outliner exists a object called Material0, the amount of objects in the outliner represents how many textures the model uses, this is very important to note.
Now let's import a custom model to replace the tree, I will be using a Scooter motorcycle, you can download it here if you want.

Scale the model and center it accordingly to where the original model was, then enter on edit mode (Tab shortcut).
If you notice, the faces are made of squares (quads), but the game only render objects using triangles, so we have two choices: Ctrl + T to triangulate faces now, or checking the box to triangulate faces on .obj export. Choose only one of them.

Before exporting, make sure you selected the model you want to export by right clicking on it, and then on export settings check the "Selection Only" box, so only the selected objects will be exported.
Export it directly to the folder where the BIN Repacker is to fasten up the process.
Now we need the .idxbin file mentioned earlier, it is reponsible to create header sections, so move it to the BIN Repacker folder. Make sure your new .obj file has the same name of .idxbin file, then just double click Repack.bat, it will generate a new .bin file for our motorcycle which can already be imported to the game.

That's it for the model, now we need to create the textures on the second step.
As we know, there aren't many modders/programmers interested in editing PS2 version of RE4 game, if compared to UHD ones. So tools and resources are still very limited.
In early January, 2023, I met JADERLINK who is a very talented and persistent guy. I asked him for help about editing 3D .bin models for PS2 version, and since then we've been developing a tool for it, and today I'm gonna try to explain here how it works.
Some starting notes:
• So far we can already convert any custom 3D .obj model to .bin format, but it will only work 100% on models that does not contain bones, such as room models, inventory models, pickable items, examinable items, key items and etc. It does not have support for skeleton data yet, as it is in development stage;
• The project is Open Source, so if you have interest and programming skills in C#, you can contribute by creating a fork;
• The current amount of vertices PS2 can handle at once is unknown at the moment, feel free to explore, but keep in mind we're dealing with a quite old hardware.
→→→ TOOL DOWNLOAD LINK ←←←
Everything set, let's move.
First step - The Model:
As .bin format is not 100% documented yet, we simply reuse default header sections.
Choose a model with no bones for reference, I will be using a tree which I extracted from r101 room, you can download it here if you want.
Then now use the BIN decoder (with room .bat file) to convert the model to .obj format so we can see it and edit from any 3D editor (I will be using Blender). It will generate many debug txt files, but we are going to need only the .obj and .idxbin files.

----

Note that on the outliner exists a object called Material0, the amount of objects in the outliner represents how many textures the model uses, this is very important to note.
Now let's import a custom model to replace the tree, I will be using a Scooter motorcycle, you can download it here if you want.

Scale the model and center it accordingly to where the original model was, then enter on edit mode (Tab shortcut).
If you notice, the faces are made of squares (quads), but the game only render objects using triangles, so we have two choices: Ctrl + T to triangulate faces now, or checking the box to triangulate faces on .obj export. Choose only one of them.

Before exporting, make sure you selected the model you want to export by right clicking on it, and then on export settings check the "Selection Only" box, so only the selected objects will be exported.
Export it directly to the folder where the BIN Repacker is to fasten up the process.
Now we need the .idxbin file mentioned earlier, it is reponsible to create header sections, so move it to the BIN Repacker folder. Make sure your new .obj file has the same name of .idxbin file, then just double click Repack.bat, it will generate a new .bin file for our motorcycle which can already be imported to the game.

That's it for the model, now we need to create the textures on the second step.