Difference between revisions of "Custom models"

From Pikmin Technical Knowledge Base
Jump to navigation Jump to search
m (→‎Process: added more information on importing a rigged model into blender)
 
(4 intermediate revisions by 3 users not shown)
Line 1: Line 1:
In ''Pikmin 2'', the model files are .BMD and usually come with a .BTK. These files can easily be viewed using J3DModelViewer or any other Nintendo 3D model viewer. The collision for the models isn't generated straight from the models, however. The collision files must be generated separately, these files include grid.bin and mapcode.bin.
+
In ''Pikmin 2'', the model files are .BMD. These files can easily be viewed using J3DModelViewer or any other Nintendo 3D model viewer. For Area models cave units, the collision is separate from the visual model and comes in the form of grid.bin and mapcode.bin.
 +
Currently WIP.
  
The following is a ''mostly complete'' guide.
+
== Area Models Guide ==
 
 
== Guide ==
 
 
=== Tools ===
 
=== Tools ===
First you'll need the appropriate tools in order to create your custom models.
+
First you'll need the appropriate tools in order to create your custom area models.
 
For the model:
 
For the model:
* ArcExtract/Pack (and yaz0fast if you want smaller ARC files)
+
* [https://www.romhacking.net/utilities/1024/ Lunaboy's RARC Tools] (or other Nintendo archive tools similar to it)
* BMDCubed[https://github.com/Sage-of-Mirrors/BMDCubed]
+
* [https://github.com/RenolY2/SuperBMD/releases SuperBMD]
* 3ds Max 2015[https://www.autodesk.com/education/free-software/3ds-max] (other versions may work, however BMDCubed was created for the 2015 edition which can still be officially downloaded; register as a student for a free licence)
+
* [https://www.blender.org/ Blender] or [https://www.autodesk.com/education/free-software/3ds-max 3ds Max] (register as a student for a free licence)
* J3DModelViewer[https://github.com/LordNed/J3D-Model-Viewer/releases] (other model viewers will not display anything or crash when you try to load your custom model)
+
* [https://github.com/LordNed/J3D-Model-Viewer/releases J3DModelViewer] (other model viewers will not display anything or crash when you try to load your custom model)
  
 
For the collision:
 
For the collision:
* ArcExtract/Pack (and yaz0fast if you want smaller ARC files)
+
* [https://www.romhacking.net/utilities/1024/ Lunaboy's RARC Tools]
* obj2grid[https://github.com/RenolY2/obj2grid]
+
* [https://github.com/RenolY2/obj2grid/releases obj2grid]
* Python 3.3[https://www.python.org/download/releases/3.3.0/]
+
* [https://www.python.org/downloads/ Python 3.6] or later
* 3D modelling program that can export .OBJ (3ds Max is fine, no need for multiple programs)[https://www.autodesk.com/education/free-software/3ds-max]
+
* 3D modelling program that can export .OBJ (Blender or 3ds Max are fine, no need for multiple programs)
  
 
=== Process ===
 
=== Process ===
 
# Extract the area model from the arc.szs using ArcExtract (located in tutorial, forest, yakushima or last - ignore anything in zukan). Make sure that you keep the .BTK and delete the .BMD, remembering the name (model.bmd).
 
# Extract the area model from the arc.szs using ArcExtract (located in tutorial, forest, yakushima or last - ignore anything in zukan). Make sure that you keep the .BTK and delete the .BMD, remembering the name (model.bmd).
# Open up 3ds Max and create/import your model.
+
# Open up your modeling program and create/import your model.
# Once you're satisfied with your model, you want to add textures. Make sure your texture's dimensions are to the power of 2 (64x64 works). ''Keep in mind that the textures you use will affect file size, anything around six megabytes or more will probably crash.''
+
# Once you're satisfied with your model, you want to add textures. Make sure your textures' dimensions are to the power of 2 (64x64 works). ''Keep in mind that the textures you use will affect file size, anything around six megabytes or more will probably crash.''
# Add editable poly to your model once you have attached all parts together, select the vertex option, select ALL points (Cntrl+A) and click the connect button to triangulate the faces.
+
# ('''3ds Max''') Add editable poly to your model once you have attached all parts together, select the vertex option, select ALL points (Ctrl + A) and click the connect button to triangulate the faces.
# Now we want to make sure that our pivot is centred, and so is the model. After you've done that, you will want to export your model as .OBJ (title it something simple like modelcol.obj) and export to wherever is easiest, it'll create multiple files but all we care about is the .OBJ.
+
#: ('''Blender''') In edit mode, select the whole model with the A key and press Ctrl + T to triangulate all selected faces.  
# Now back to 3ds Max, click the rotate tool (or right-click your model and click rotate). In the top-right, set your view to right (click and drag to change your view, and click the face on the cube that says 'RIGHT') and then you want to rotate the object -90 degrees on the x-axis. Then go to the utilities tab on the right, click X-form, and then 'x-form selected'. Go ahead and export the model again as a .DAE file and simply title it model.dae.
+
# Now we want to make sure that our pivot is centered, and so is the model (In Blender, this can be done by selecting the model in object mode, and applying transforms with Ctrl + A -> All Transforms). After you've done that, you will want to export your model as .OBJ (title it something simple like modelcol.obj) and export to wherever is easiest, it'll create multiple files but all we care about is the .OBJ.
# To create your BMD model, open the BMDCubed folder and there will be a .exe, if you did everything right; a simple drag and drop of your .DAE file should export a .BMD (model.bmd) in the same location as the .DAE. Now to quickly check your model to make sure everything worked, open up J3DModelViewer, and drag your .BMD file right onto the preview. Hold right-click and WASD to move around, if it looks good then you can just close J3D. To import your model, go back to an area folder or wherever in your Pikmin 2 files, find the arc folder and put back the model.bmd file.
+
# ('''3ds Max''') Now back to 3ds Max, click the rotate tool (or right-click your model and click rotate). In the top-right, set your view to right (click and drag to change your view, and click the face on the cube that says 'RIGHT') and then you want to rotate the object -90 degrees on the x-axis. Then go to the utilities tab on the right, click X-form, and then 'x-form selected'. Go ahead and export the model again as a .DAE file and simply title it model.dae.
# To create the collision of your model, you'll need to download obj2grid.py; a python script written by Yoshi2 which converts a .OBJ into grid.bin and mapcode.bin files which are necessary for custom area map collision. You'll also need to install Python 3.3 and to make things easy, just drop obj2grid.py into your Python33 folder in your C drive.
+
#: ('''Blender''') Select the whole model again in object mode and rotate it -90 degrees on the X axis (Press R key, then X key, then type -90, and hit enter). Once more, apply transforms (Ctrl + A -> All Transforms) and export the model as .FBX.
# Drop your modelcol.obj file into the Python33 folder as well, right-click inside the folder while holding shift and click 'run command window in this folder', command prompt should open up. Now all you need to type is <code>python obj2grid.py modelcol.obj</code> and then you wait for it to generate the files. During this process, avoid clicking in the black abyss of command prompt otherwise the process will just stop and you won't even realise it.
+
# To create your BMD model, open the SuperBMD folder and look for a .bat file named <q>superbmd_pikmin2_simpleshading.bat</q> (This gives it the proper in-game shading). If you did everything right, a simple drag and drop of your .DAE or .FBX file should export a .BMD (model.bmd) in the same location as the .DAE or .FBX. Now to quickly check your model to make sure everything worked, open up J3DModelViewer, and drag your .BMD file right onto the preview. Hold right-click and WASD to move around, if it looks good then you can just close J3D. To import your model, go back to an area folder or wherever in your Pikmin 2 files, find the arc folder and put back the model.bmd file.
# Repeat what you did for the model (replace the grid.bin and mapcode.bin files in the texts folder) IF your grid.bin file does NOT exceed about 1,300KB. The largest official in-game grid.bin is only 650kb, however as I've tested around 1,300 still works, any higher will crash the game. Using yaz0enc/yaz0fast will make the ARC smaller but it will not stop the game from crashing if the original grid file is too big.
+
# To create the collision of your model, you'll need to download obj2grid by Yoshi2 which converts a .OBJ into grid.bin and mapcode.bin files which are necessary for custom area map collision. You'll also need to install Python 3.6+.
# Use ArcPack to create your arc.arc and texts.arc files, use yaz0fast to make them smaller if you desire and then just rename the extension to .szs as opposed to .arc (or .arc.yaz0 if you compressed it). Now run GC-Rebuilder to rebuild your ISO and run it!
+
# Drag and drop your modelcol.OBJ file onto <q>make_collision.bat</q> and it will create your grid.bin and mapcode.bin.
 +
# Repeat what you did for the model (replace the grid.bin and mapcode.bin files in the texts folder) IF your grid.bin file does NOT exceed about 1,300KB. The largest official in-game grid.bin is only 650kb, however as I've tested around 1,300 still works, any higher will crash the game.  
 +
# Use Lunaboy's RARC Tools to create your arc.arc and texts.arc files, and then just rename the extension to .szs as opposed to .arc. Now run main.dol (or rebuild the ISO with GC-Rebuilder) and test it!
 +
 
 +
== Rigged Models Guide ==
 +
 
 +
Rigged models are any models that are animated in Pikmin 2. This include models like Olimar, Louie, the President, and the Pikmin themselves.  
 +
 
 +
=== Tools ===
 +
The tools you'll need for custom rigged models are the following:
 +
* [https://www.romhacking.net/utilities/1024/ Lunaboy's RARC Tools] (or other Nintendo archive tools similar to it)
 +
* [https://github.com/RenolY2/SuperBMD/releases SuperBMD]
 +
* [https://www.blender.org/ Blender] and [https://github.com/MeltyPlayer/FinModelUtility/releases FinModelUtility] (also download this drag and drop bat script [https://mega.nz/file/jAhDhBwa#IzHVSBXqp-4vIEl4VAHfUG5XTW4J88ccnOmthq75pOE here], and place it in the FinModelUtility folder) <br />Alternatively, there is [https://www.autodesk.com/education/free-software/3ds-max 3ds Max] (register as a student for a free licence) and [https://github.com/RenolY2/MaxBMD MaxBMD]
 +
* [https://github.com/LordNed/J3D-Model-Viewer/releases J3DModelViewer] (optional)
 +
 
 +
=== Process ===
 +
The process for 3dsMax can be found in [https://www.youtube.com/watch?v=ybcHOqj-_Ss this video]
 +
 
 +
(WIP)
 +
For Blender, the process is simplified because of the ability to transfer bone weights from one mesh to another.
 +
In this guide, we will be using the Olimar character model as an example, but these steps could apply to any rigged model.
 +
<br/>'''Steps for Blender:'''
 +
# Navigate to your model in the filesystem, and open the szs archive with Lunaboy's RARC tools (in our case, we'd go to <code>user\Kando\piki\pikis.szs\designer\orima_model\orima1.bmd</code>).
 +
# Open the folder containing FinModelUtility and drag the .BMD onto singleBMD.bat. It will create a new folder with the same name as the .BMD, and be in the same location as the .BMD. You can drag this new folder onto your desktop for convenience if you like.
 +
# Open Blender and create a new project. Go to File > Import > FBX (.fbx) and select the model you exported.

Latest revision as of 19:07, 29 September 2023

In Pikmin 2, the model files are .BMD. These files can easily be viewed using J3DModelViewer or any other Nintendo 3D model viewer. For Area models cave units, the collision is separate from the visual model and comes in the form of grid.bin and mapcode.bin. Currently WIP.

Area Models Guide[edit]

Tools[edit]

First you'll need the appropriate tools in order to create your custom area models. For the model:

For the collision:

Process[edit]

  1. Extract the area model from the arc.szs using ArcExtract (located in tutorial, forest, yakushima or last - ignore anything in zukan). Make sure that you keep the .BTK and delete the .BMD, remembering the name (model.bmd).
  2. Open up your modeling program and create/import your model.
  3. Once you're satisfied with your model, you want to add textures. Make sure your textures' dimensions are to the power of 2 (64x64 works). Keep in mind that the textures you use will affect file size, anything around six megabytes or more will probably crash.
  4. (3ds Max) Add editable poly to your model once you have attached all parts together, select the vertex option, select ALL points (Ctrl + A) and click the connect button to triangulate the faces.
    (Blender) In edit mode, select the whole model with the A key and press Ctrl + T to triangulate all selected faces.
  5. Now we want to make sure that our pivot is centered, and so is the model (In Blender, this can be done by selecting the model in object mode, and applying transforms with Ctrl + A -> All Transforms). After you've done that, you will want to export your model as .OBJ (title it something simple like modelcol.obj) and export to wherever is easiest, it'll create multiple files but all we care about is the .OBJ.
  6. (3ds Max) Now back to 3ds Max, click the rotate tool (or right-click your model and click rotate). In the top-right, set your view to right (click and drag to change your view, and click the face on the cube that says 'RIGHT') and then you want to rotate the object -90 degrees on the x-axis. Then go to the utilities tab on the right, click X-form, and then 'x-form selected'. Go ahead and export the model again as a .DAE file and simply title it model.dae.
    (Blender) Select the whole model again in object mode and rotate it -90 degrees on the X axis (Press R key, then X key, then type -90, and hit enter). Once more, apply transforms (Ctrl + A -> All Transforms) and export the model as .FBX.
  7. To create your BMD model, open the SuperBMD folder and look for a .bat file named superbmd_pikmin2_simpleshading.bat (This gives it the proper in-game shading). If you did everything right, a simple drag and drop of your .DAE or .FBX file should export a .BMD (model.bmd) in the same location as the .DAE or .FBX. Now to quickly check your model to make sure everything worked, open up J3DModelViewer, and drag your .BMD file right onto the preview. Hold right-click and WASD to move around, if it looks good then you can just close J3D. To import your model, go back to an area folder or wherever in your Pikmin 2 files, find the arc folder and put back the model.bmd file.
  8. To create the collision of your model, you'll need to download obj2grid by Yoshi2 which converts a .OBJ into grid.bin and mapcode.bin files which are necessary for custom area map collision. You'll also need to install Python 3.6+.
  9. Drag and drop your modelcol.OBJ file onto make_collision.bat and it will create your grid.bin and mapcode.bin.
  10. Repeat what you did for the model (replace the grid.bin and mapcode.bin files in the texts folder) IF your grid.bin file does NOT exceed about 1,300KB. The largest official in-game grid.bin is only 650kb, however as I've tested around 1,300 still works, any higher will crash the game.
  11. Use Lunaboy's RARC Tools to create your arc.arc and texts.arc files, and then just rename the extension to .szs as opposed to .arc. Now run main.dol (or rebuild the ISO with GC-Rebuilder) and test it!

Rigged Models Guide[edit]

Rigged models are any models that are animated in Pikmin 2. This include models like Olimar, Louie, the President, and the Pikmin themselves.

Tools[edit]

The tools you'll need for custom rigged models are the following:

Process[edit]

The process for 3dsMax can be found in this video

(WIP) For Blender, the process is simplified because of the ability to transfer bone weights from one mesh to another. In this guide, we will be using the Olimar character model as an example, but these steps could apply to any rigged model.
Steps for Blender:

  1. Navigate to your model in the filesystem, and open the szs archive with Lunaboy's RARC tools (in our case, we'd go to user\Kando\piki\pikis.szs\designer\orima_model\orima1.bmd).
  2. Open the folder containing FinModelUtility and drag the .BMD onto singleBMD.bat. It will create a new folder with the same name as the .BMD, and be in the same location as the .BMD. You can drag this new folder onto your desktop for convenience if you like.
  3. Open Blender and create a new project. Go to File > Import > FBX (.fbx) and select the model you exported.