KCL flag

From Custom Mario Kart
Revision as of 03:59, 24 July 2022 by Epik95 (talk | contribs)
Jump to navigation Jump to 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. The numerical relation is:

FLAG = TYPE | VARIANT << 5

Wiimm has made a statistical analysis about the usage of flags in all 32 tracks: kcl-types.txt

Collision Types (basic type)

Type What is it? Speed factor[1] Handling factor[1]
0x00 Road 1.0 0.7
0x01 Slippery Road 1 1.0 0.050 – 0.105
0x02 Weak Off-road 0.550 – 0.909 0.080 – 0.157
0x03 Off-road 0.325 – 0.712 0.050 – 0.105
0x04 Heavy Off-road 0.185 – 0.422 0.050 – 0.105
0x05 Slippery Road 2 0.881 – 0.999 0.030 – 0.074
0x06 Boost Pad 1.0 0.7
0x07 Boost Ramp 1.0 0.7
0x08 Jump Pad 1.0 0.7
0x09 Item Road 1.0 0.7
0x0A Solid Fall 0.1 0.7
0x0B Moving Water 1.0 0.7
0x0C Wall 1.0 0.7
0x0D Invisible Wall 1.0 0.7
0x0E Item Wall 1.0 0.7
0x0F Wall 3 1.0 0.7
0x10 Fall Boundary 1.0 0.7
0x11 Cannon Activator 1.0 0.7
0x12 Force Recalculation 1.0 0.7
0x13 Half-pipe Ramp 1.0 0.7
0x14 Wall 1.0 0.7
0x15 Moving Road 1.0 0.7
0x16 Sticky/Gravity Road 1.0 0.7
0x17 Road 1.0 0.7
0x18 Sound Trigger 1.0 0.7
0x19 Weak Wall 1.0 0.7
0x1A Effect Trigger 1.0 0.7
0x1B Item State Modifier 1.0 0.7
0x1C Half-pipe Invisible Wall 1.0 0.7
0x1D Moving Road 1.0 0.7
0x1E Special Walls 1.0 0.7
0x1F Wall 5 1.0 0.7
[1] : Notes for Speed factor
  • Each vehicle and driver combination has its own basic speed. The Speed factor is always ≤1.0 and defines the relative KCL type dependent speed.
  • The values are calculated after analyzing different Mario Kart Wii files. The ranges depends on the possible driver and vehicle combinations.
  • The different basic speed of the vehicles (75.00 – 85.07) and the driver modifications of the basic speed (add 0 – 0.53) are not part of these speed factor calculations.
  • Some values are senseless (e.g. walls, fall down, effects), but the values are available in the Mario Kart Wii tables.

Variants

The variant portion of the flag 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
Number of bits 3 2 3 3
Function Collision effect Intensity BLIGHT Index 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 will not 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 BLIGHT index, 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.

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 with them.
This is sometimes referred to as "barrel roll collision".

Intensity:
Exact values unknown.

BLIGHT Index:
Index of posteffect.blight to use. For drivable surfaces, this refers to the lighting that is applied to any character, vehicle or item that is touching it. For most non-drivable surfaces such as walls, it appears to have no effect. Some variants of 0x10 and 0x1A repurpose this bit group to index into the KMP.

Basic effect:
Different for each basic flag (see below).

Cheat Sheet

This image sums up the basic effects and variants for finding them more quickly.

KCL Cheat Sheet.png


Basic Effects

Road (0x00)

A type of road that is solid for both players and items.

Basic effect (Z, octal) What is it?
0 Normal
1 Dirt, GFX on slots 7.3 and 8.3
2 Dirt, no GFX
3 Smooth
4 Wood
5 Snow with GFX
6 Metal grate
7 Normal, but the sound cuts off and returns immediately when triggered

Slippery Road 1 (0x01)

A type of road that is slippery, but does not slow you down.

Basic effect (Z, octal) What is it?
0 White sand
1 Dirt[1]
2 Water (unused)
3 Snow (unused)
4 Grass (unused)
5 Yellow sand
6 Sand, no GFX (unused)
7 Dirt, no GFX (unused)
  1. GFX is a lighter color on slot 8.2.

Weak Off-road (0x02)

Basic effect (Z, octal) What is it?
0 Orange Sand
1 Dirt[1]
2 Water
3 Grass, darker GFX
4 Sand, lighter GFX
5 Carpet
6 Gravel[2][3]
7 Gravel, different impact SFX[2][3]
  1. GFX is red on slot 3.4.
  2. 2.0 2.1 GFX is orange on slot 3.1.
  3. 3.0 3.1 GFX does not include the rock particles on slot 3.4.

Off-road (0x03)

Basic effect (Z, octal) What is it?
0 Sand[1]
1 Dirt
2 Mud[1]
3 Water, no GFX (unused)
4 Grass[1]
5 Sand, lighter GFX
6 Gravel, different impact SFX
7 Carpet
  1. 1.0 1.1 1.2 GFX can be a different color on different slots.

Heavy Off-road (0x04)

Basic effect (Z, octal) What is it?
0 Sand
1 Dirt
2 Mud
3 Flowers
4 Grass
5 Snow
6 Sand
7 Dirt, no GFX

Slippery Road 2 (0x05)

A type of road that is slippery and slightly slows you down.

Basic effect (Z, octal) What is it?
0 Ice
1 Mud, no GFX (unused)
2-5 Water, no GFX (unused)
6-7 Normal road, different sound (unused)

Boost Panel (0x06)

Basic effect (Z, octal) What is it?
0 Default
1 If used in course.kcl and casino_roulette is nearby, the road slowly rotates everything around it counterclockwise. Used in Chain Chomp Wheel.
2-7 Unknown. Unused

Boost Ramp (0x07)

More flips mean longer airtime and more landing boost time.

If used in course.kcl and casino_roulette is nearby, the road slowly rotates everything around it counterclockwise.

Note that you should not use the collision effect "trickable" with this KCL flag, otherwise the trick type will be semi random.

Basic effect (Z, octal) What is it?
0 2 flips
1 1 flip
2-7 No flips, unused

Jump Pad (0x08)

Higher stages mean approximately longer air time and more distance.

Basic effect (Z, octal) What is it?
0 Stage 2, used in GBA Bowser Castle 3
1 Stage 3, used in SNES Ghost Valley 2
2 Stage 1, used in GBA Shy Guy Beach
3 Stage 4, used in Mushroom Gorge[1]
4 Stage 5, Bouncy mushroom[2]
5 Stage 4, used in Chain Chomp Wheel
6 Stage 2, used in DS Yoshi Falls and Funky Stadium
7 Stage 4, unused
  1. This flag causes the Off-Road Glitch.
  2. SFX always work on the kinoko_bend object, but requires slot 1.3 for the course model KCL.

Item Road (0x09)

A type of road that is solid for items only.

Basic effect (Z, octal) What is it?
0 Unknown
1 Unknown
2 Used on metal grates
3 Unknown. Used on wooden paths/grass/mushrooms
4 Unknown. Unused
5 Unknown. Used on grass/bushes
6-7 Unknown. Unused

Solid Fall (0x0A)

Basic effect (Z, octal) What is it?
0 Sand
1 Sand/Underwater
2 Unknown
3 Ice
4 Dirt
5 Grass
6 Wood
7 Dark sand with GFX

Moving Road (0x0B)

This is a kind of road that moves the player along a route. It is activated when entering an AREA type 0x3. For more information, see: Moving Terrain

Basic effect (Z, octal) What is it?
0 Moving water that follows a route, pulling the player downwards. Route settings:
  • 1 = speed
  • 2 = unknown
1 Moving water that follows a route and strongly pulls the player downwards, making it hard to drive. Route settings:
  • 1 = speed
  • 2 = unknown
2 Moving water that follows a route from the start of the path to the end of it. Route settings:
  • 1 = unknown
  • 2 = with value 1, the moving water direction rotates 90 degrees.

It also uses two settings in the AREA:

  • At 0x28 = acceleration/deceleration modifier
  • At 0x2A = route speed (speed at which the route pulls the player)
3 Moving water with no route. It pulls you down and you cannot move from it
4 Moving asphalt, unused. Functions the same as basic effect 0?
5 Moving asphalt, unused. Functions the same as basic effect 0?
6 Moving road, unused. Functions the same as basic effect 0?
7 Moving road, unused. Functions the same as basic effect 0?

Wall (0x0C)

A type of wall that is solid for both players and items.

Basic effect (Z, octal) What is it?
0 Normal
1 Rock
2 Metal
3 Wood
4 Ice
5 Bush (with GFX)
6 Rope
7 Rubber

Invisible Wall (0x0D)

A type of wall that is solid for players only.

Basic effect (Z, octal) What is it?
0 No spark and no character wall hit voice
1-2 Spark and character wall hit voice (unused)
3-7 Unknown. Same as 0? (unused)

Item Wall (0x0E)

A type of wall that is solid for items only.

Basic effect (Z, octal) What is it?
0 Unknown
1 Unknown. Used on rock walls
2 Unknown. Used on metal walls
3 Unknown
4 Unknown. Unused
5 Unknown. Used on grass/bushes
6-7 Unknown. Unused

Wall 3 (0x0F)

Basic effect (Z, octal) What is it?
0 Normal
1 Rock
2 Metal
3 Wood
4 Ice
5 Bush (no GFX, unused)
6 Rope
7 Rubber

Fall Boundary (0x10)

Non-solid out of bounds. For basic effects 1-3, the BLIGHT index is instead used to reference a pocha object in the KMP, which is used to determine the height of the splash effect. The BLIGHT index should match Setting 1 of the corresponding pocha object.

Basic effect (Z, octal) What is it?
0 Air fall
1 Water
2 Lava
3 Icy water, (ice on respawn)[1]
4 Lava, no GFX
5 Burning air fall
6 Quicksand (used in object quicksand)[2]
7 Short fall
  1. Requires slot 6.1.
  2. In rare cases with complex KCL geometry, this variant can activate, but not cause the player to respawn, resulting in intangibility and no control of the character. If this occurs somewhere on your track, an additional fall boundary may be needed to "catch" the victim and make them respawn.

Cannon Activator (0x11)

Basic effect refers to the CNPT index of the destination point.

Basic effect (Z, octal) What is it?
0 To point 0
1 To point 1
2 To point 2
3 To point 3 (unused)
4 To point 4 (unused)
5 To point 5 (unused)
6 To point 6 (unused)
7 To point 7 (unused)

Force Recalculation (0x12)

Forces an enemy/item route recalculation when triggered. It is activated when entering an AREA type 0x4.

Basic effect (Z, octal) What is it?
0 Default
1-7 Unknown. Unused

Half-pipe Ramp (0x13)

Best used with Invisible Wall (0x0D), although that is not needed for this flag to function.

Basic effect (Z, octal) What is it?
0 Default
1 Boost pad applied, Used in Bowser's Castle
2-7 Unknown. Unused

Wall (0x14)

Allows objects to pass through it like 0x0D, but with properties similar to 0x0C.

Basic effect (Z, octal) What is it?
0 Normal (unused)
1 Rock (unused)
2 Metal (unused)
3 Wood
4 Ice (unused)
5 Bush (unused)
6 Rope (unused)
7 No SFX/GFX

Moving Road (0x15)

Unlike moving water, moving road is not controlled by routes in the KMP, but rather by specific objects. The positioning of them works similar to an AREA point. For more information, see: Moving Terrain

Basic effect (Z, octal) What is it?
0 Moves west with BeltCrossing and escalator. The latter only works with escalator.kcl
1 Moves east with BeltCrossing and west with escalator. The latter only works with escalator.kcl
2 Moves east with BeltEasy
3 Moves west with BeltEasy
4 Rotates around BeltCurveA clockwise
5 Rotates around BeltCurveA counterclockwise
6-7 Unknown. Unused

Sticky/Gravity Road (0x16)

A type of road that applies a strong downward pull on players.

Basic effect (Z, octal) What is it?
0 Wood.
1 Gravel, different impact SFX.
2 Carpet.
3 Dirt, no GFX.
4 Sand, different impact and drift SFX, no GFX.
5 Normal road, SFX on slot 4.4.
6 Normal road.
7 Mud with GFX.

Road (0x17)

Basic effect (Z, octal) What is it?
0 Normal road, different sound
1 Carpet
2 Grass, GFX on 8.3
3 Normal road, used on green mushrooms
4 Grass
5 Glass road with SFX
6 Dirt (unused)
7 Normal road, SFX on slot 4.4

Sound Trigger (0x18)

Slot 1.1 (Luigi Circuit)

ID What is it?
0 No audience noise
1 Soft audience noise
2 Audience noise. The race starts with this sound
3 Loud audience noise
4 Unknown
5 Unknown
6 Unknown
7 Unknown

Slot 1.3 (Mushroom Gorge)

ID What is it?
0 Deactivate all.
1 Unknown
2 Unknown
3 Enable cave SFX + echo.

Slot 1.4 (Toad's Factory)

ID What is it?
0 Sounds off
1 Hydraulic press area
2 Shipping dock area
3 Moving belt area
4 Steam room
5 Restart music at beginning
6 Bulldozer area
7 Audience area

Slot 2.1 (Mario Circuit)

ID What is it?
0 Deactivates echo.
1 Weak echo.
2 Loud echo.

Slot 2.2 (Coconut Mall)

ID What is it?
0 Resets all sound triggers. Shopping mall ambience requires this to play
1 Weak shopping mall ambience + disables echo
2 Loud shopping mall ambience + strong echo
3 Resets all sound triggers and prevents shopping mall ambience from playing until 0 is hit again
4 Loud shopping mall ambience + disables echo
5 Same as 3?

Slot 2.3 (DK Summit)

ID What is it?
0 Deactivates cheering.
1 Weak cheering ambience.
2 Loud cheering ambience.
3 Loudest cheering ambience.
4 Enables cheering when going off half-pipe ramps.

Triggers 1, 2 and 3 all fade in when trigger 0 is toggled.

However, each one will be enabled starting louder if trigger 0 is not toggled.

Slot 2.4 (Wario's Gold Mine)

ID What is it?
0 Music change (outside)
1 Music change (cave) + gentle echo
2 Echo
3 Strong echo
4 Unknown
5 Unknown
6 Unknown
7 Unknown

Slot 3.1 (Daisy Circuit)

ID What is it?
0 Deactivate echo
1 Weak echo
2 Echo

Slot 3.2 (Koopa Cape)

ID What is it?
0 Music change (normal)
1 Music change (normal), echo.
2 Stronger echo.
3 Music change (underwater), water ambience enabled when entering from 0, 5 or 6, disabled otherwise.
4 Strongest echo, water ambience enabled.
5 Music change (normal), strongest echo, water ambience enabled when entering from 3.
6 Music change (riverside)

Slot 3.3 (Maple Treeway)

ID What is it?
0 Deactivate echo and wind ambience.
1 No effect.
2 Weak echo.
3 Loud echo.
4 Enables wind ambience, deactivates echo.

Slot 3.4 (Grumble Volcano)

ID What is it?
0 Deactivate echo.
1 Weak echo, toggles after two seconds.
2 Loud echo, toggles after one second.
3 Loud echo, toggles after two seconds.

Slot 4.1 (Dry Dry Ruins)

ID What is it?
0 Music change (normal)
1 Music change (indoors, where the bats come from the sides)
2 Music change (indoors, where the half-pipes are)
3 Music change (indoors, where the Pokeys are)
4 Unknown
5 Unknown
6 Unknown
7 Unknown

Slot 4.2 (Moonview Highway)

ID What is it?
0 Deactivate city ambience, default music.
1 Stage 2, weak city ambience, adds flute to music.
2 Stage 4, louder city ambience, disable echo.
3 Stage 5, loudest city ambience, disable echo.
4 Stage 3, loud city ambience, enable echo.
5 Stage 1, weakest city ambience, enable echo.

Slot 4.3 (Bowser's Castle)

ID What is it?
0 Disable one-time use sound trigger (like Bowser's howl)
1 Bowser's howl + echo. Put 7 at the end of a turn to be able to reuse Bowser's howl
2 Sound distortion + echo
3 Deactivate sound distortion + echo
4 Add drums + echo on music + koopaBall/koopaFigure SFX
5 Deactivate koopaBall/koopaFigure SFX
6 Add drums without echo
7 Back to normal. Allow reuse for one-time use sound trigger

In order to have Thwomp SFX, just disable every sound trigger (put 003 then 007).

Slot 4.4 (Rainbow Road)

ID What is it?
0 Deactivator
1 Gate sound 1 (add a deactivator before and after if you use only one gate)
2 Star ring sound 1
3 Star ring sound 2
4 Star ring sound 3
5 Star ring sound 4
6 Tunnel sound (add a deactivator to stop it)

Sound triggers are easy to use if you know how to use them.

Here's a good example:

  • 0 → 1 → 2 → 3 → 4 → 5 → 0
    • That's how the original Rainbow Road uses the triggers. All the triggers will play once and won't replay until you reach a deactivator.

Here's a way to play the first gate more than once:

  • 0 → 1 → 0 → 1 → etc.
  • Note that 0 → 2 won't play, and 1 → 1 will only play once. Every sound trigger must be one more time than the one before it, in order for it to work.

The tunnel trigger works similarly. Use a deactivator to stop it.

Slot 5.4 (N64 Mario Raceway)

ID What is it?
0 Deactivates cheering.
1 Loud cheering.
2 Louder cheering.
3 Weak cheering.

Trigger 1 fades in when trigger 0 is toggled

Slot 6.1 (N64 Sherbet Land)

ID What is it?
0 Deactivate all.
1 Cave echo.
2 Cave SFX.

Slot 6.3 (DS Delfino Square)

ID What is it?
0 Unknown. In a position such that a player may collide with this trigger if they complete the dock shortcut.
1 Very, very distant whistles, cheers and chatter from spectators.
2 Very distant whistles, cheers and chatter from spectators.
3 Distant whistles, cheers and chatter from spectators.
4 Whistles, cheers and chatter from spectators.
5 Single wind gust just before the dock section.
6 No spectator ambience.
7 The same as 6? Used between triggers of type 6.

Slot 7.3 (N64 DK's Jungle Parkway)

ID What is it?
0 No jungle ambience. Used near water sections.
1 Jungle ambience (bird squawks, insect hum, animal roar). Used as a buffer between types 0 and 2.
2 Intense jungle ambience, used in areas of deep forest.
3 Cave ambience.

Slot 7.4 (GCN Mario Circuit)

ID What is it?
0 No echo.
1 Weak echo.
2 Loud echo.

Slot 8.3 (GCN DK Mountain)

ID What is it?
0 Deactivate all.
1 Jungle SFX (animals).
2 Water + wind SFX.

Slot 8.4 (N64 Bowser's Castle)

ID What is it?
0 Disable one-time use sound trigger (like Bowser's howl)
1 Turns lava SFX off + disables echo
2 Bowser's howl. Put 0 at the end of a turn to be able to reuse this
3 Turns lava SFX off
4 Turns lava SFX off + echo
5 Echo
6 Strong echo

Weak Wall (0x19)

Nintendo uses this type in Wario's Gold Mine and Rainbow Road with variant values 0x400 and 0x410. It acts as a wall that pushes players away when driving at low speed, but it can easily be trespassed when accelerating. They seem to be originally used below flat road to prevent players from hanging on the edges.

Basic effect (Z, octal) What is it?
0 Default
1-7 Unknown. Unused

Effect Trigger (0x1A)

Nintendo uses this type in 21 different tracks with variant values 0x000, 0x001, 0x002, 0x004, 0x005, 0x006, 0x009, 0x00A, 0x011, 0x012, 0x019, 0x01C, 0x022 and 0x02A. In the case of the water splash effect, the Y-column (normally the BLIGHT index) references a pocha object in the KMP which is used to determine the height of the effect. On slots T4.2 and B2.5, index 5 is hardcoded to spawn a pochaLeaf or pochaLeafY (pochaMori) respectively. In all other cases, a pocha is used, even if the linked object is of a different type.

Basic effect (Z, octal) What is it?
0 Enable BLIGHT effect
1 Enable BLIGHT effect (different from 0?)
2 Water splash (pocha)[1]
3 starGate door activation
4 Half-pipe cancellation
5 Coin despawner
6 Smoke effect on the player when going through dark smoke (truckChimSmkW)
7 Unknown. Unused
  1. Reusable only if a fall boundary is triggered.

Item State Modifier (0x1B)

Nintendo uses this type only in Toad's Factory with variant value 0x008. It stops stationary items once leaving the curved conveyor belts.

Basic effect (Z, octal) What is it?
0 Default
1-7 Unknown. Unused

Half-Pipe Invisible Wall (0x1C)

Nintendo only uses this type in Bowser's Castle with variant value 0x020 and in Funky Stadium with variant value 0x000. It consists of an invisible wall used only while being in air after a half-pipe jump.

Basic effect (Z, octal) What is it?
0 Default
1-7 Unknown. Unused

Moving Road (0x1D)

If casino_roulette is present, the road slowly rotates everything around it counterclockwise. Without casino_roulette, it acts like ordinary road. For more information, see: Moving Terrain

Basic effect (Z, octal) What is it?
0 Carpet, different impact SFX
1 Normal road, different sound, different impact SFX (unused)
2 Normal road
3 Glass road
4 Carpet
5 No sound, star crash impact SFX (requires starGate for SFX) (unused)
6 Sand (unused)
7 Dirt (unused)

Special Wall (0x1E)

Basic effect (Z, octal) Visual Sound Effect
0 (cacti effect) Fast: spark (stars) Fast: nothing Fast: bump
Slow: spark (stars) Slow: nothing Slow: bump
1 Fast: nothing Fast: nothing Fast: bump (rubber wall)
Slow: nothing Slow: nothing Slow: nothing
2 (unused) Fast: spark Fast: hollow Fast: bump
Slow: nothing Slow: nothing Slow: many bumps (rubber wall)
3 Fast: nothing Fast: nothing Fast: bump
Slow: nothing Slow: nothing Slow: nothing
4, SFX on slot 4.4 Fast: spark Fast: nothing Fast: bump
Slow: nothing Slow: nothing Slow: nothing
5 Fast: spark Fast: cracking Fast: bump
Slow: nothing Slow: nothing Slow: nothing
6 Fast: spark Fast: metal Fast: bump
Slow: nothing Slow: nothing Slow: nothing
7 Fast: spark Fast: Star Ring crash (requires starGate) Fast: bump
Slow: nothing Slow: Star Ring crash (requires starGate) Slow: nothing

Wall 5 (0x1F)

Basic effect (Z, octal) Speed Visual Sound Effect
0
1-7 (unused)
Fast Nothing Nothing Bump (players cannot go through it, items can)
Slow Nothing Nothing Nothing (players cannot go through it, items can)