AREA type

From Custom Mario Kart
Jump to navigation Jump to search

Introduction

The AREA type decides the function of the AREA element. There are 10 known types. The type is stored as a single byte at offset 0x01 in the AREA data:

AREA entry data structure (0x30 bytes)
Offset Type Description
0x00 Byte Area shape. 0 = box, 1 = cylinder.
0x01 Byte Area type. Values 0–A.
0x02 Byte Index of CAME if type = 0x00, 0xFF else.
0x03 Byte Priority value. A higher number means a higher priority to choose which area activates if multiple areas are intersected.
0x04 Float[3] A 3D position vector of the area.
0x10 Float[3] A 3D rotation vector of the area's rotation.
0x1C Float[3] A 3D scale vector of the area's scale.
0x28 UInt16 AREA setting 1. Used by AREA type 2, 3, 6, 8 and 9.
0x2A UInt16 AREA setting 2. Used by AREA type 6 and 3.
0x2C Byte Route ID used by AREA type 3.
0x2D Byte Enemy point ID. This value is used by AREA type 4.
0x2E UInt16 Padding? Always 0 in Nintendo tracks.

AREA type 0x00 (camera)

Type 0 is found in all tracks and arenas.

The related camera is enabled, when the player enters this area. This type is used for the finish camera and if waiting for the next online race.

AREA type 0x01 (EnvEffect)

With this AREA, you can define an area where EnvFire and EnvSnow is not used, and EnvKareha is used. If 0x28 is set to 1, EnvKarehaUp is used instead.

In T13, this defines the effect in the cave. In T41, this is used inside the ruins.

Type 1 is found in the tracks with ID T13, T33, T34, T41, T43 and T84.

AREA type 0x02 (BFG entry swapper)

This type of AREA controls which entry of posteffect.bfg is used.

In Bowser's Castle, both AREAs of this type use a post-effect setting of 1. While you are inside this AREA, the second entry of posteffect.bfg is used instead of the first. The fog returns to normal once you exit the AREA(s), rather than once you enter an AREA with a different setting.

It is possible that this doesn't always use the second entry, but it instead uses the post-effect setting. In this case, a setting of 0 would use the first entry, 1 would use the second, and so on.

Type 2 is found in the tracks with ID T23, T32 and T43.

AREA type 0x03 (moving road)

Type 3 causes moving road terrain in the KCL to move, and in some variants, links them to a route in the KMP which describes the path of the moving road.

Type 3 is found in the tracks with ID T32 and T52.

AREA type 0x04 (destination point)

This type of AREA is used as first destination for KCL Flag »Force Recalculation«. The position and the rotation vector are used.

Type 4 is found in the tracks with ID T22, T33, T34, T44, T63, A11 and A24. Exact these tracks use also Force Recalculation.

AREA type 0x05 (minimap control)

In the filesystem, type 5 is only used in old_mario_gc_b. It effects settings of the minimap such as culling and whether or not to appear. It is pretty much useless for normal tracks since those settings are also controlled in the BRRES, but it is also used in some tournaments to crop the minimap (if the tournament took place on a specific part, not the whole track), since tournaments cannot deliver a new minimap.

However, this can be used for Mission Mode in missions that take place on a specific part of the track.

To get this to work, open SketchUp with KMP3D and import the KCL and KMP files from the track you want to use this on. Add a "Minimap Control" AREA and scale it so that it covers the area of the minimap you want to show, Leave the settings at 0, set the camera type and route to "FF", and then export the file.

WARNING: When exporting a KMP file with KMP3D, it will sometimes have trouble labeling the objects and will set all of them to object ID "0", which is "NULL". Therefore, you will need to make a backup of your original KMP file. Once you have done this, open the exported KMP file from KMP3D in KMP Cloud and go to the AREA section. Copy the entry which has the AREA listed as "Type 5" and then copy it. Now open your original KMP file in KMP Cloud and go to the AREA section once again. Create a new entry, highlight it and then paste. The data should be copied over. Sometimes, it may add an additional AREA entry but just highlight the entry and then delete it. Then click save.

This can also be done in KMP Modifier, but it will detect the AREA type as "EnemyFall", since this AREA type does not exist within any of the playable tracks in the game.

AREA type 0x06 (music changer)

It changes the music in the tracks and add special music effects like in Mushroom Gorge's cave.

Type 6 is found in the tracks with ID T13, T32 and T34.

AREA type 0x07 (flying Boos)

Type 7 is found in the track with ID T53. This AREA type is only active, if b_teresa is defined and the file b_teresa.brres is included.

Firstly define an element in the AREA section of the KMP:

#AREA#
#------------------------------------------------------------------------------------
#       mode type    _____position/rotation/scale______   _________settings_________
#  idx  came unkn.         x           y           z         #1     #2     #3     #4
#------------------------------------------------------------------------------------
    0      0  0x7     31000.000   15000.000    7000.000       0      0 0xffff      0
 >        -1    0         0.000       0.000       0.000 
 >                        1.500       1.500       3.500
#------------------------------------------------------------------------------------

Secondly define a b_teresa object in the GOBJ section of the KMP:

#GOBJ#
#------------------------------------------------------------------------------------
#     obj-id ______position/rotation/scale______  _________settings_________   route
# idx /unknw        x           y           z     #1/#5  #2/#6  #3/#7  #4/#8 /p-flag
#------------------------------------------------------------------------------------
# o$b_teresa, S--------, no route, found in tracks
    0  0x18c   36000.000   15000.000   18000.000      0      0      0      0      -1
    >      0       0.000       0.000       0.000      0      0      0      0    0x3f
    >              1.000       1.000       1.000
#------------------------------------------------------------------------------------

And this is the result:

Flying Boos

AREA type 0x08

Alters the draw distance of objects within range.

Type 8 is found in the tracks with ID T31, T34, T41 and T43 (same tracks as type 9).

AREA type 0x09

Type 9 is found in the tracks with ID T31, T34, T41 and T43 (same tracks as type 8).

AREA type 0x0A (Fall Boundary)

Type 10 is used by Nintendo for tournaments. It adds new fall boundaries to the game without adding a new KCL file.

Conditional out of bounds makes use of this type, and uses the current key checkpoint region of a player to enable or disable it. Setting 2 defines in which key checkpoint region a player has to be to enable (S1 = 1) or disable (S1 = 2) this AREA.