39
edits
(Updated actor section) |
(→Grid Section: added info) |
||
Line 135: | Line 135: | ||
The second 4 bytes indicate what the purpose of the parameter is. There are only 3 observed values so far: | The second 4 bytes indicate what the purpose of the parameter is. There are only 3 observed values so far: | ||
* | *0, which indicates the parameter is not used? | ||
* | *2, unknown purpose. Observable on the small key in Lv04AnglersTunnel_06A among other rooms, but the parameters appear to not do anything. | ||
* | *3, which indicates that the parameter is an integer parameter, taken as just the value of the first u32. | ||
* | *4, which indicates that the parameter is a string parameter specified in the names section. The value in the previous u32 is the offset in the names section for this parameter. | ||
Unused parameters are entered as offsets to a null byte in the names section, as a type 4 parameter. | |||
|- | |- | ||
|0x78 | |0x78 | ||
Line 190: | Line 190: | ||
|} | |} | ||
====Grid Section==== | ====Grid Section==== | ||
This section is a child FixedHash which appears to define collision properties of the room. It has two or three entries: <code>data</code>, sometimes <code>chain</code>, and <code>info</code>. | |||
The data in the <code>data</code> section contains | |||
The data in the <code>data</code> section contains blocks 0x10 bytes each which define some properties for every tile on the screen, for a total of 0x500 bytes for top-down rooms and 0x140 bytes for sidescroller rooms. The format of these is not fully understood yet. | |||
{| class="wikitable" | |||
|+ | |||
!Offset | |||
!Type | |||
!Description | |||
|- | |||
|0x0 | |||
|u32? | |||
|Unknown. The most significant byte appears to always be 0x80. | |||
|- | |||
|0x4 | |||
|u32? | |||
|Unknown, seems to always be identical to the value at 0x0. | |||
|- | |||
|0x8 | |||
|u32 | |||
|'''Chain index'''. Defines which chain to use as an index into the sequence of chains. If the tile doesn't refer to a chain tile, or there is no chain table defined, this will be 0xFFFFFFFF. | |||
|- | |||
|0xC | |||
|float | |||
|'''Elevation'''. Specifies the height of the surface that Link walks on over this tile. It is still unclear what causes tiles' elevations to be gradient (a ramp) or a sudden increase or decrease (a wall). | |||
|} | |||
The chain section is used for when there needs to be a higher walkable surface directly above a lower one. This is common in sidescroller rooms, but is also used in some overworld areas; mainly in Tal Tal Mountains where there are some walkable surfaces inside cliff faces which can be reached with out of bounds methods. Chain entries can still index to other chains. | |||
The info block is always 0x10 bytes and holds some essentially metadata about the room, probably to be used alongside the other data here to determine collision. | |||
{| class="wikitable" | |||
|+ | |||
!Offset | |||
!Type | |||
!Description | |||
|- | |||
|0x0 | |||
|u16 | |||
|How many tiles tall the room is. Will always be 0x8 for top-down rooms and 0x2 for sidescroller rooms. | |||
|- | |||
|0x2 | |||
|u16 | |||
|How many tiles wide the room is. Seems to always be 0xA (10) | |||
|- | |||
|0x4 | |||
|float | |||
|The size of 1 tile in units. Seems to always be 1.5. | |||
|- | |||
|0x8 | |||
|float | |||
|X co-ordinate of the left edge of the room. | |||
|- | |||
|0xC | |||
|float | |||
|Y co-ordinate of the top edge of the room. For sidescroller rooms this seems to always be -1.5. | |||
|} | |||
===Names Section=== | ===Names Section=== |
edits