MKWii Custom Character with perfect shading tutorial

Mar 10th, 2016
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.66 KB | None | 0 0
  1. This is a tutorial that shows how to make Custom Characters with perfect shading for Mario Kart Wii. This tutorial assumes you know basic modeling, and it won't explain how to create a model.
  3. Requirements:
  4. — 3ds Max (I use 3ds Max 2015, any version after 2010 should work fine).
  5. — BrawlBox.
  6. — Any Hex Editor.
  7. — A 3D model of the character you want to import. Can be from any other game, made by yourself, or whatever.
  9. • Step 1 - Exporting an original character model from BrawlBox
  10. It is necessary to export the original character model you want your model to rig over. Please note that this does not mean that your character is replacing this original character, since you can actually use a character's rigging over any other character slot from the same weight class (e.g. you can rig a character over Mario and put it over Peach, but not over Bowser).
  12. Simply open the original character file and export the model as DAE (by right clicking the MDL0 file and then choosing Export). Please note that you need to reset the bone scale values before exporting. This is the case of Bowser, who has a bigger scale value for his hands. Just expand the MDL0, go to bones, and find the ones that do not have a scale value of (1, 1, 1), and change them to that same value. Now you are ready to import your model in 3ds Max!
  15. • Step 2: Importing the model in 3ds Max
  16. Since your model was exported from BrawlBox as a DAE file, it must be imported in 3ds Max with a different scale rule than default. After selecting your model to import in 3ds Max, the FBX Importer window will open, you'll need to set Advanced Options → Units → Centimeters. After that, press OK.
  19. • Step 3: Removing original skin attributes and bones
  20. If your model has any bones, you must select all them, right click and delete.
  22. If you exported the model with bones from BrawlBox as DAE, you'll probably get an error when importing (, but don't worry, everything is correct. The model and its bones should appear correctly in the program. Now, you must delete all the bones.
  24. After this, you'll need to remove each "Skin" modifier from each object. Select them, go to the modifiers table and right click "Skin", then delete.
  27. • Step 4: Model reducing and optimizing
  28. This is probably the hardest part to make a good model. First of all, toggle the display polygon/vertex counter by pressing 7. I also use the "Shaded" lighting option from the viewport (might not be in newer versions of 3ds Max):
  30. Now, you'll want to reduce polygon count. The simplest way to do this is by selecting all the objects and using the "ProOptimizer" modifier. After that, select these options:
  33. RED arrow → You need to check this (or else you will get a solid color model).
  34. GREEN arrow → Optional: if textures are messed up with reduction (, select this, and it will be slightly fixed. This has some disadvantages, because it can take the double of polygon count (, and it could even need a more precise and accurate UV map fix; abusing of this (reducing a lot with this feature) will make your polygons look like meshes reduced to a single vertex (
  35. BLUE arrow → This is optional, but helps leaving unified vertices and faces. It takes only a little more of polygon count.
  38. Now, select your reduce value percentage. Your model should not exceed 1500 polygons (maximum recommended for MKWii characters), although the size is actually determined by the BRRES size (driver_model.brres is recommended to be 250 KB or smaller), so you can also help by reducing the textures, the LOD model, animations, removing vertex colors, etc.
  40. After reducing, your model could look like it has some errors, which will require a manual fix. When you finish the optimization, right click the modifier and click on "Collapse All", if a window pops up, click "Yes".
  43. Nowadays, I don't use the ProOptimizer method anymore because it's not exactly precise. If you want a perfectly reduced model, consider using more advanced methods, like vertex welding and mirroring. This means more time to spend but for a much better result.
  45. To perform a manual fix, you need patience. Moving polygons looks easy, but the adjustement is tricky sometimes. First of all, locate the incorrect objects which are out of the model's boundaries ( Fixing them will require adding vertices.
  47. In my case, I'll move the eyes manually (, add missing vertices to the feet (, and fix UV maps for the legs ( It could take some time, but with experience it becomes something easier and faster each time to perform.
  50. When you are done with model fixing, it's convenient to attach all the objects with the same material into a single object. This prevents large file size and multiple model nodes ( press CTRL+click to add an object to selection). You might also want to use the Vertex Weld modifier with the minimum threshold value to unify all the split vertices that are in the same position.
  53. • Step 5: Setting up your model for the game
  54. Now that you have finished fixing your model, it's time to import the original MKWii model you want its bones over. In my case, I used ma_mii_f's (Medium Female Mii) bone structure.
  57. Import the MKWii character model (exported from BrawlBox as DAE), with the same attributes (Advanced Options → Units → Centimeters) in 3ds Max. Now, fit your custom character model with the MKWii model ( If your model does not fit correctly (longer arms/legs, bigger feet/hands, etc.), it's recommended to adjust them. Select from the Editable Mesh modifier the vertices you want to adjust, and scale, rotate or move as much as you need ( After that, remove the original MKWii model (except the bones) and apply a Skin modifier to your custom character. Then, click on "Add" and select all the bones. Now select skl_root, click on "Edit Envelopes" and select all the models' vertices. Go to "Abs. Effect" and set it to 1. Then, your model should turn all red.
  60. • Step 6: BrawlBox "model patching"
  61. This is a trick I discovered and I use to perform better model lighting and normal fix. Before rigging the rest of the bones, first export the entire model as DAE, with Advanced Options → Units → Inches. When you get your DAE, import it in BrawlBox (v0.77 preferably). Use the following settings when importing your DAE: Also, you can import the textures now for a better preview.
  64. After importing, check this setting:
  68. And then, apply the original material and shader settings to the model. To do this, you can either copy the values from existing models, or export and replace them. When replacing a material, make sure you delete all texture references it has, else it might become corrupted. Export the shaders and materials when finished. If you save the BRRES and open it again with BrawlBox, you'll notice it has incorrect lighting ( To fix this, export the model as DAE and import it again in 3ds Max, with the Centimeters scaling rule. Remove again the Skin modifiers from your model (Step 2).
  71. • Step 7: High-performance editing
  72. If you want perfect shading/lighting for your model in MKWii, you'll need to apply vertex colors and fix the normals, which is optional but prefered. Select all objects (not the bones) and use the "Edit Normals" modifier. Now select all the normals (CTRL+A), and they'll turn red. Check the "Use Threshold" box and press the "Selected" button. If your model looks weird when doing this, check "Unify/Break to Average" and press on "Unify". Then, right click the modifier and press "Collapse All". This will unify split normals, which will usually fix a model's polygon roughness, making it smooth. Although this method is useful, sometimes you will prefer to split some normals (for example, on shoe soles), so some polygons won't be smooth with the rest of polygons. To do this, uncheck "Unify/Break to Average", select the normals you want to split, and click on "Break". If you want to unify them back, make sure you check "Unify/Break to Average" again and then press "Unify".
  75. Next you do is applying vertex colors. Use the "VertexPaint" modifier for this. A window will pop up, then, you will need to select all vertices. Next, click on the following buttons: and then, right click on the modifier and Collapse All. Make sure you select the full white color (0xFFFFFF, R:255, G:255, B:255). You can also add some shadows by painting some vertices gray, or add color to determined parts if you want to have better lighting effects.
  78. If your model looks fine for now, you can go to the next step. If there are one or some polygons with wrong lighting (like this:, the Edit Normals modifier should be enough to fix it, else, try choosing the "Edit Poly" modifier, select all the models' faces and press the "Auto Smooth" button.
  81. • Step 8: Rigging bones
  82. Since rigging is a complex modeling feature, I can't explain it very well. You must use the "Skin" modifier and add all bones to the list again. Then press on "Edit Envelopes", select all vertices and apply 1.0 in "Abs. Effect" for the skl_root bone.
  84. For the rest of bones, I recommend applying the rigging in the bone tree order. I do like this:
  85. — Select the spin bone and apply to the top half of the body.
  86. — Select the face bone and apply to the head and the vertices that connect it to the neck, if any.
  87. — If there's a mouth bone and your model has a 3D mouth (separated polygons for the jaws), apply to the bottom jaw. If it doesn't have it, skip this bone.
  88. — If there's a tonge bone and your model has a 3D tonge, apply to the whole tonge except the vertices that connect it to the mouth. It might have more than one bone for the tonge, if so, rig it from parent to child, being the parent tonge_1, and the last child being applied to the tip of the tonge.
  89. — If there are hair bones, apply them to the mane/ponytail if any, else, skip.
  90. — Select the arm_l1 bone and apply to the whole left arm, from the shoulder to the fingers/hand. Don't include the armpit bones.
  91. — Select the arm_l2 bone and apply from the left elbow to the fingers/hand.
  92. — Select the wrist_l1 bone and apply to the whole left hand.
  93. — Repeat the last three steps for arm_r1, arm_r2 and wrist_r1, but for the right arm instead.
  94. — If there are tail bones and your model has a 3D tail, apply them to the whole tail from parent to child, excluding the vertices that connect to the butt or wherever the tail is connected to.
  95. — Select the leg_l1 bone and apply to the whole left leg until the left foot. Pick some vertices from the pelvis if needed. If your model has no legs (like Toad), skip.
  96. — Select the leg_l2 bone and apply from the left knee to the left foot.
  97. — Select the ankle_l1 bone and apply to the left foot/shoe. Even if the name suggest the ankle, sometimes it's better to leave the ankle rigged to the leg_l2 bone instead. If your model has no legs (like Toad), rig the whole foot/shoe to this bone, and if it has no feet, skip.
  98. — Repeat the last three steps for leg_r1, leg_r2 and ankle_r1, but for the right leg instead.
  100. Make sure "Abs. Effect" is set to 1.0 when the vertices only affect one bone. If it affects two bones, you can divide the value in the proportions you want for each bone (0.5 for each, or 0.25 for one and 0.75 for the other, etc. This step could take some time, depending on how complex your model is. You need a lot of patience to do this, and I can tell that it won't always work fine at the first try. Testing your model's rigging by moving the bones is necessary, but be careful and remember to reset the bones to their original position after doing this (you can use CTRL+Z to undo).
  103. • Step 9: Importing your rigged and fixed model
  104. Finally, you need to export the 3ds Max scene as DAE, and import in BrawlBox with the same properties as in Step 5. Now, replace Shader0 and the materials with the ones you exported before. Remember you must delete any texture reference found into the imported material before replacing, else the game might crash when using it.
  106. Last step is fixing color nodes. Open the MDL0 and look for a folder named "Colors". They should look like this:
  108. Now, you must change any of the colors' alpha value to a value that is not 255 (I use 254, on the first color). Do this for all color nodes (each color file found into the folder, not each color value), and export them. In a Hex Editor, you must find the alpha value (if you put 254, it will be 0xFE), and replace it with 0xFF (255). Save the file and reimport it in BrawlBox.
  111. Before finishing, you can now check if the animations work fine in BrawlBox's previewer. You might also want to edit the texture pattern and SRT animations that control the eyes, if you also included multiple eye textures.
  113. Now that you're done, save your BRRES and open it again in BrawlBox. If your model looks like this check in the materials' texture references that lm_0 and lm_1 have the "HasTextureMatrix" property set to "True", when possible.
  115. Your model should now look perfect!
  118. Tutorial written by AtlasOmegaAlpha.
  119. YouTube Channel →
  120. Twitter →
  121. Discord → Atlas#5057
Add Comment
Please, Sign In to add comment