KCL flag

From Custom Mario Kart
Revision as of 01:03, 13 August 2011 by HelloImYourMind (Talk | contribs)

Jump to: navigation, search

This page describes the flags of KCL files.



Mario Kart Wii Collision Flags

In Mario Kart Wii the collision flag values are normally split. The 5 least significant bits determine the basic type of the flag. The next 11 bits determine the variation upon the type. The list below describes these types and their variants.

Collision Types (basic type)

Type Variant type What is it?
0x00 A Road
0x01 A Weak off road
0x02 A Very weak offroad with a dirt effect
0x03 A Offroad
0x04 A Heavy offroad with a sand effect
0x05 A Off road
0x06 unknown Boost
0x07 unknown Fast trick
0x08 unknown Trick ramp
0x09 unknown Out of bounds
0x0A unknown Solid fall
0x0B unknown Shallow Water (weak offroad, like on Shy Guy Beach)
0x0C unknown Wall
0x0D unknown Wall, but makes no sound effect when touched. Sparks still appear.
0x0E unknown Does nothing
0x0F unknown Normal wall
0x10 unknown Fall boundary
0x11 B Cannon Activator
0x12 unknown Does nothing
0x13 unknown Half-Pipe blue ramp (like the ones on DK Summit)
0x14 unknown Normal Wall
0x15 unknown (B??) Moving terrain
0x16 A Sticky Road
0x17 A Road, slightly different than 0x00
0x18 unknown Sound Trigger
0x19 unknown Does nothing
0x1A unknown Music channel activator???
0x1B unknown Does nothing
0x1C unknown Does nothing
0x1D A Gravelroad
0x1E unknown Spin-out when touched
0x1F unknown Wall

Variant types

Not all variant types are discovered and not of all flags is known which variant it uses. This are the types that are discovered yet:

Type A

Variant type A is split in 4 bit-groups. The first and last 2 groups are 3 bits each, and the second group is 2 bits.

Group W Group X Group Y Group Z
Amount of bits 3 2 3 3
Function Collision effect Intensity Shadow effect Basic effect

To write this structure down, you can write each group as an octal number, but be aware of the 2-bits group, calculating hex to octal won't work right. A good way to get the right variant in hex is this:

  • write down each group in octal (X can be max. 3)
  • convert each group to binary (X is 2 bits, others 3 bits)
  • write them in the order: wxyz, you'll get www|xx|yyy|zzz in binary, you can convert that number to hex.

Note: hex shows only W right, octal only Y and Z.

So, www in binary controls the collision effect, xx controls intensity, yyy controls shadow effect, and zzz controls the basic effect (such as grass vs. dirt). For example, www represents a binary number of three digits. This 3-digit number controls which effect is used. The same applies to yyy and zzz, except xx can only go up to 3 as there are only 2 binary digits. A complete string of binary numbers (wwwxxyyyzzz in that order) is converted as a whole to hex to get the variant that is entered into the SZS Modifier or CTools.

Another way is using the following formula: Variant (in hexadecimals) = 0x100W+0x40X+0x8Y+Z Of course is this formula basic on the theory stated above. MrKoeikoei has made a simple sheet for excel that is able to calculate those variants. This saves some time. You can download it here.

Functions:

Collision effect:

Bit Effect
0 0 = Not trickable
1 = Trickable
1 0 = Drivable
1 = Not drivable. Forces a player to change direction which makes the player unable to drive on that surface.
2 Value 1 is used for walls that don't make you bounce when colliding on them

Intensity:
Exact values unknown

Shadow effect:
All light effects pertain to the light IDs in posteffect.blight. These colors can be modified by hex editing it in the SZS file (./posteffect/posteffect.blight).

Basic effect:
Different for each basic flag

Type B

Variant type B refers to an ID in the kmp file, which section is different for each flag: "Triggers" means that it's variant refers to a group or point of the specified section.

Type (value) Triggers
Moving road (0x0B) AREA entry If the area has a route it makes the water follow the route, else it moves towards the area point.
Cannon activator (0x11) Cannon (CNPT entry)
Moving road (0x15) Object

Basic Effects (for type A variants)

Road (0x00)

Basic effect (Z, octal) What is it?
0 Normal Road
1 Dirt Road
2 Sand
3 Slippery Road
4 Wood Road
5 Snow Road
6 Metal Grid/Chain Link Road
7 Another Normal Road

Road (0x17)

Basic effect (Z, octal) What is it?
0 Normal road, little bit different than 0x00
1 Sand
2 Sand sound, with dirt effect
3 Glass road
4 Sand
5 Glass road with sound-effect
6 Sand
7 Dirt effect with no sound

Road (0x1D)

Basic effect (Z, octal) What is it?
0 Gravel
1 Dirt effect with no sound
2 Normal road (like 0x00)
3 Glass road with echo
4 Gravel, different sound
5 No sound effect
6 No sound effect
7 Normal Gravel

Sticky Road (0x16)

Basic effect (Z, octal) What is it?
0 Wood Road
1 Sand Road
2 Gravel
3 Dirt Road
4 Sand/Gravel
5 Nothing
6 "Normal Road" Road
7 _


Offroad (0x03)

Basic effect (Z, octal) What is it?
0 Dirt
1 Acts like Dirt Road
2 Mud
3 Water, no offroad effect.
4 Grass
5 Sand
6 Water, no offroad effect.
7 Gravel


Weak Offoad (0x01)

Basic effect (Z, octal) What is it?
0 Sand with spike sounds
1 Sand
2 unknown
3 unknown
4 unknown
5 Sand
6 unknown
7 unknown

Known Variants

Wall (0x0C)

ID What is it?
000 Normal Wall
001 Rock Wall
002 Metal Wall
003 Guard Rail
004 Short tree wall sound effect
005 Tree Wall
006 Tree Wall without leaf effect
007 Rubber Wall
008 Hollow Wall
009 Wall without being bumped
40x The "bump" depends on the angle you hit the wall.

Fall Boundary (0x10)

ID What is it?
000 Air fall
001 Water (activates pocha)