AREA type
Introduction
The AREA type decides the function of the AREA element. Types 0–4 and types 6–9 are known. The type is stored as a single byte at offset 0x01 in the AREA data:
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 no effect is used.
In T13 this defines the second effect.
Type 1 is found in the tracks with ID T13, T33, T34, T41, T43 and T84.
AREA Type 0x02 (?)
Type 2 is found in the tracks with ID T23, T32 and T43.
AREA Type 0x03 (moving shallow water)
Type 3 causes moving shallow water terrain in the KCL to move, and links the KCL variant to a route in the KMP which describes the path of the water. It is now unknown whether or not this works for standard moving terrain like at Toad's Factory (not water).
Type 3 is found in the tracks with ID T32 and T52.
AREA Type 0x04 (EnvEffect on)
With this AREA you can define an area with an effect like EnvFire or EnvSnow.
Type 4 is found in the tracks with ID T22, T33, T34, T44 and T63.
AREA Type 0x05 (minimap control)
Type 5 is not found in any of Nintendos tracks. It effects settings of the minimap such as culling and whether or not to appear, but is pretty much useless since those settings are also controlled in the BRRES.
AREA Type 0x06 (?)
Type 6 is found in the tracks with ID T23, T32 and T43.
AREA Type 0x07 (flying boos)
Type 7 is found in the track with ID T53 (Ghost Valley 2). This area type is only active, if an object of type b_teresa is defined and the file b_teresa.brres is included.
First 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 #------------------------------------------------------------------------------------
Second 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 (watch out the boos/ghosts):
AREA Type 0x08 (?)
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).