Using mkdd-collision

This article describes how to use mkdd-collision by Yoshi2, a program that can convert between BCO and .obj.

This tool requires Python to be installed. Additionally, all the files found in the .zip should be in the same directory.

Conversion .bco -> .obj

At the most basic level, converting .bco to .obj is:

  1. Drag the .bco file onto bco2obj.py

The output should be

  • <input file name>.obj file (for the actual model)
  • <input file name>_sound.txt file (information relating to collision sounds)

The full command line options are

bco2obj.py <input file> <output file name>

The Soundfile

The soundfile contains information about the sounds that the game will generated when driven over / crashed into.

For each collision flag, there are three hex values:

  • The sound id - 2 bytes
    • There is currently no documentation for the various sounds ids.
  • Unknown - 8 bytes - 0x0 for collision files without particles
  • Unknown - 8 bytes - 0x0 for collision files without particles

Conversion .obj -> .bco

At the most basic level, converting .obj to .bco is:

  1. Drag the .obj file onto BCOnvert.py

The output should be a .bco file with the same filename as the .obj file.

To specify a soundfile and output file:

BCOnvert.py <input file> <output file> --soundfile sound_file_name.txt

The full command line options:

  • input - the input file. Always the first argument given
  • output - the output file name. Should be the second argument given, if used
  • --cell_size
    • Size of a single cell in the grid. Bigger cell size results in smaller grid size but higher amount of triangles in a single cell.
    • Increasing this value can reduce file size for physically larger .bco files at the cost of potential lag.
    • Default of 1000 (vanilla)
  • --quadtree_depth
    • Depth of the quadtree structure that's used for optimizing collision detection. Quadtrees are used to subdivide cells in the grid further when a cell has too many triangles.
    • Default of 2
  • --max_tri_count
    • The maximum amount of triangles a cell or a leaf of a quadtree is allowed to have before it is subdivided further.
    • Default of 20
  • --soundfile - explained above
  • --steep_faces_as_walls
    • If set, steep faces that have no collision type asigned to them will become walls.
  • --steep_face_angle
    • Minimum angle from the horizontal in degrees a face needs to have to count as a steep face. Value needs to be a float between 0 and 90.
    • Default of 89.5