User:Krank

Mario Kart: Double Dash!! connoisseur and tryhard custom course creator.

BCA files



 * BCA (File Format) animation files can be opened with the j3d-animation-editor.
 * In order to install the j3d-animation-editor, you have to download the source code and then run.
 * Open bash or a terminal and write.

BCO files



 * See file specification at BCO.
 * See custom tutorial at Custom_Track_Tutorial/BCO.
 * A BCO model represents the areas in a track the player can drive on, throw items on, receive boosts and fall off-track.
 * These areas are represented with triangles, which together form a mesh.
 * Each triangle has a material, which sets specific rules for how the carts and items behave.
 * Each material has multiple flags, which describe the road type (road, offroad, deadzone), sound type (steel, concrete), camera position (default, steep) and additional flags (rough road, display falling animation, etc).
 * The BCO files are a Gamecube specific file-format which not many 3d programs can open.
 * First, we have to transpile the BCO files into  files. For that we use mkdd-collision.
 * When importing the resulting  file into a 3d program (like Blender), we can see the collision model (see image).
 * Each material is named by a naming scheme:.
 * These flags in the material name can be transpiled back into a BCO file, which in turn gets processed by the game.

Camera
Focal Length:   16mm Rotation X:     70° Camera Distance: 380 units (between cart center and camera if projected onto a flat plane) Camera Height:  315 units (distance from camera to flat ground)
 * When creating a custom track, it is useful to mimick the camera settings ingame.
 * This way, you can save a few iteration steps (compiling the game and testing it) if you want to check the looks.
 * Here is an approximation for the ingame camera:
 * Note: This approximation was done with the original 4:3 aspect ratio. If you use a widescreen hack (16:9), the effective values might deviate a little.
 * Note: A  describes a single unit when extracting tracks or driver models and importing them into a 3d program. For example, a cart has about the size of 145 units (width) x 160 units (height) x 200 units (length).

Custom Track File Specification
Adapted from mkdd-track-patcher.

ARC File Overview
ARC files are actually archive files and are used for every track.

Track Geometry Tips

 * Using tracks as inspiration
 * Extract and unpack the ARC of your favorite track with Lunaboy's RARC Tools.
 * Now convert the track model from the BMD to  and the track collision BCO to   with SuperBMD and mkdd-collision.
 * Import both files into your favorite 3d modelling program (in this case, mine is Blender). Save the file so you don't have to reimport.
 * Now you can always look at your favorite track for inspiration when modelling, take measurements and copy geometry.
 * Stairs
 * Bowser's Castle uses some stairs in the late part of the track.
 * In the visual model one step of stairs is 90 units in height and 300 units in length.
 * In the collision model, the stairs are represented as a ramp with flat sections. Each ramp segment is 90 units in height and each flat section is 93 units in length.
 * This gives the player the illusion of a bumpy ride when driving down a set of stairs. In reality, making the collision follow the stairs 100% would make the ride way too rough.
 * Item boxes
 * When placing item boxes when editing the BOL, make sure that their center is exactly at height 0 at the current track spot.
 * Usually the item boxes have an offset of 135 as internal parameter, so now they have the correct height.
 * Vertices limits
 * The BMD of an official track usually has about 20,000 vertices.
 * The MKDD engine has a theoretical vertex limit of 216&minus;1 (65,535) vertices.
 * Start out with the main track and make sure the track is fun to drive before adding more details.

Vertex colors

 * Vertex colors are used extensively in MKDD to get simple shadows.
 * Each vertex in a mesh can optionally store a RGB color value, and/or (?) a vertex alpha value.
 * When MKDD renders the track, each pixel then is multiplied by the vertex color.
 * Vertex colors with alpha value are also used to blend two textures together.
 * Example: In Bowser's Castle, after jumping over the last ramp, the dirt road texture slowly blends in over the brick texture, making a nice track transition.
 * When creating a custom track, by default each texture is rendered as unlit.
 * Using vertex colors for shading makes the track look prettier and easier to navigate.

Setup in Blender

 * 1) By default, Blender only shows vertex colors when in view mode "Solid". We also want to see the texture AND vertex color.
 * 2) For that, we need a custom shader. Click on the material and open the Shader Editor (Shift + F3).
 * 3) There should be three nodes: An Image Texture node, a Principled BSDF node and the Material Output node.
 * 4) Now let's create a new node Color Attribute. The Color Attribute represents the vertex colors.
 * 5) Add a Mix Color node and set mode to "Multiply".
 * 6) Node setup for vertex shader:
 * 7) Next we have to add vertex color to the object properties (otherwise there are no vertex colors).
 * 8) In the Properties panel, click on the tab "Object Data Properties" (green upside-down triangle).
 * 9) Open section "Color Attributes" and click on the plus button.
 * 10) Add Color Attribute with domain = "Face Corner" and data type = "Byte Color". Also set color to white, otherwise the whole material gets turned completely black.
 * 11) Click on "OK" to add color attributes (vertex colors).
 * 12) Now you are ready to paint. Select object with the material, go to edit mode and select the faces you want to paint.
 * 13) Switch mode into "Vertex Paint" mode. Switch view mode to "Material Preview" by pressing Z.
 * 14) Now you can paint the faces at the individual vertices. Any color near white is invisible and any color near black is visible.

Exporting in Blender

 * 1) We have to export the painted mesh as   since   does not retain vertex colors.
 * 2) Open a new instance of Blender by clicking the Blender shortcut.
 * 3) Copy and paste the mesh you want to export.
 * 4) We have to change the node setup for the material back to it's initial state. Otherwise only the vertex data but not the texture gets exported.
 * 5) Change the Image Texture node, so its color output feeds directly into the Principled BSDF node.
 * 6) Node setup for exporting vertex colors:
 * 7) Now we can't see the vertex colors anymore in Blender. But don't worry, they are still there and will show up after the export.
 * 8) Go to "File" &rarr; "Export" &rarr; "Collada (.dae)" and export the mesh.
 * 9) Convert the   to BMD with SuperBMD (you should run the CLI command with the   parameter).
 * 10) Go to https://noclip.website/, drag and drop the BMD file onto the site and now you should be able to see vertex color + texture.

Helpful Links

 * waifu2x – program to upscale and denoise images and illustrations
 * The Spriters Resource – Mario Kart Double Dash – ripped sprites from the game, good as inspiration for designing track intro images and minimaps; also includes subpages for textures, sounds and models for MKDD.
 * Double Dash Font – not perfect but pretty good MKDD font file