Creating a BRRES with BrawlBox
This page is a part of the Custom Track Tutorial. Back to the main tutorial page.
This page describes how to create a Custom Track BRRES from scratch with BrawlBox. You will import the model from an exported DAE into MDL0, import the textures into TEX0 and edit some settings inside the MDL0 to make your model look right ingame. This page contains information that is useful even after your BRRES is created, even if it was made with another program.
Importing the DAE File
To create a BRRES in BrawlBox, you need to import a DAE file, preferably in the 3ds Max format. The default settings in the 3ds Max DAE exporter are usually correct. If you have SketchUp, the best option is to export the model as OBJ and import it in 3ds Max, then export as DAE; if you don't wish to do that, export the model as OBJ and convert it to a .FBX file with Autodesk FBX Converter 2010.2, then choose FBX201000 (Autodesk). If you have Blender, export the model in FBX format. After you have your FBX file convert it to a DAE file with the tool above.
First make a new BRRES (File → New → Brres Resource Pack). Then right-click the BRRES node and click Import → Model. Use the following settings:
The DAE will then be converted into a MDL0 file, which will be in the 3DModels(NW4R) folder inside the BRRES. If you're making the course model, make sure the MDL0's named "course". This applies to any other BRRES you might be replacing.
A ModelVersion different from 11 or other incorrect settings will make the game freeze. You might walk against some problems, most noticeably randomly moved faces/polygons and rotated models. This can be fixed by swapping the Axis Conversion setting when exporting the model, from Y-up to Z-up or vice versa. If that doesn't work instead try setting the pivots in 3ds Max. Set all pivots' positions to the origin (0,0,0) and rotate them -90 degrees on the X axis.
If you have imported it, you might wish to rename things (such as meshes or materials) for more readability.
Importing the Textures
You can import the textures by right clicking the root or using the Edit drop down menu and selecting Import → Texture (or Folder; in this case, put all your textures on a folder and select it). Make sure you set the texture format to a format supported by Mario Kart Wii. The following formats are supported/recommended:
You should use CMPR for most textures; textures with opacity (partially transparent) should be RGB5A3. The CI4 and CI8 textures need their palette names in their respective material references.
The textures will be imported as TEX0 files inside the Textures(NW4R) folder in the BRRES. The references which point to them are located in the Materials section of the MDL0. If any textures are missing or referenced incorrectly, the game will crash. You can rename the textures and references to fix this if needed.
You should set a number of mipmaps for each texture you import. Three is usually a good amount for normal sized textures. Large textures might use more and smaller ones might use less; you'll have to experiment with this.
At this point, before editing shaders or materials, you should test your model ingame to see if it'll load (even if you haven't made the KCL or KMP yet).
The default shader created by BrawlBox will work correctly in Mario Kart Wii. Navigate to the Shaders folder under the MDL0 to edit them; you might want to open Stage0 from Shader0, look for ColorScale and set it from "MultiplyBy4" to "MultiplyBy2" or "MultiplyBy1". This will set how bright your textures will be ingame. If you are not happy with any of the settings, you can experiment with the "Default Color" setting when importing the DAE.
Material settings are very important to make your track look good. Note that messing too much with the material settings will most likely result in definitions which are incorrect or unsupported by Mario Kart Wii. Navigate to the Materials folder under the MDL0 to edit them. Some of it is explained here:
Materials for Normal Textures
The settings for textures without transparency (fully opaque textures) are almost completely right after importing. The only changes they require are for the light channels. Under SCN0 References you should have all set to -1 except FogSet, which should be 0. Also make sure everything under "Z Mode" is set to True.
Materials for Textures With Opacity
To enable opacity on a mesh/polygon, browse to the mesh's material. The settings should be the same as the materials for the opaque textures, except for:
- EnableBlend = True
- XLU Material = True
- CompareBeforeTexture = False
You also have to browse to the mesh under the "Objects" section in the MDL0 file and set the Draw Pass to XLU (Transparent) for each mesh/polygon. This should prevent the Harry Potter effect. You can also make a material (more) transparent by setting Constant Alpha Enabled = true and the Value to the value of transparency (0 = opague, 255 = fully transparent). However, this setting doesn't ensure a model without the transparency settings above becoming transparent.
MipMaps are smaller versions of the textures, which are displayed when you're further away from the models, to improve the visuals of your track. Your textures will look smoother and you can heavily reduce moiré patterns. For mipmaps to be displayed, you must navigate to the texture reference under each material and set the MinFilter option to Linear_Mipmap_Linear. The textures must obiously actually contain mipmaps for this to work (explained above).
The CullMode setting is set to "Cull_Inside" by default. This will make the "inside" of the models invisible and the outside visible, which is the usual setting. Setting it to Cull_Outside will make the opposite side of the model visible (the blue side in SketchUp) and setting it to Cull_None will make all sides of the model visible. This should be used for models which can naturally be seen from both sides, such as fences.
Materials and Shaders
Materials have to be ordered by Shader references: Materials with reference to Shader1 should be UNDER Materials with reference to Shader0;
This is because, for a strange and unknown reason, BrawlBox orders the Shaders by the Materials' references: so, if you have
you will have, not apparently but in file level
You have therefore to order your Materials by Shaders' references to avoid this problem.
It is a good idea to test the scale of your model as soon as possible, so follow the Solidity tutorial to make your track solid. You will also need edit the KMP to put the start position over the track. You can see more stuff that can be done with BrawlBox in the BrawlBox Tricks page. Refer back to this tutorial as needed as you continue to refine your model.
Introduction – Textures – Scale – Modeling – BRRES: CTools – BRRES: BrawlBox
Minimap – Solidity – KCL: Wiimms Tools – KMP Editing – Object Editing
Cameras – Cannons – Post-effects – Videos