1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-21 06:43:04 +01:00

Updated Track Data (markdown)

Kevin Burke
2014-04-30 07:34:51 -07:00
parent 45cbf70d67
commit 09b282588c

@@ -327,6 +327,53 @@ More data about each track piece lives in a few different places in the game. Fi
## Height/Direction Change Data
Data about the height and direction change of track pieces is stored in 11-byte structs, beginning at 0x994e34. However, the structs here **do not** map 1:1 with track pieces. Instead, use the lookup table beginning at `0x994a38` to determine which struct corresponds to your given track piece.
Data about the height and direction change of track pieces is stored in 11-byte
structs, beginning at `0x994e34`. However, the structs here **do not** map 1:1
with track pieces. Instead, use the lookup table beginning at `0x994a38` to
determine which struct corresponds to your given track piece.
There are two lookup tables, one at `0x994a38` and one at `0x994632`. I am not sure yet which one is used in which situations, though it depends on whether a flag is set at bit 20 of the ride struct beginning at `0x97CF40`.
There are two lookup tables, one at `0x994a38` and one at `0x994632`. I am not
sure yet which one is used in which situations, though it depends on whether a
flag is set at bit 20 of the ride struct beginning at `0x97CF40`.
Here's the breakdown of those 11 byte structs
##### bytes 0-4
all empty, as far as I can tell
##### byte 5
contains flags relating to helixes and loops
##### byte 6
255 if a loop piece that ends going downward, else 0
##### byte 7
These seem to track the height change required by the piece. 16 represents a
height change of 1 unit, but there are also 8 and 12 represented. check byte 8
for the direction.
Some of this is confusing; a helix up piece should have at least some height
change but instead is 0 in the code. Bit 3 set means "helix down"
##### byte 8
bit 0: always set (?)
bit 1: 0 if track piece starts diagonal, 1 if track piece starts orthogonal
bit 2: if 0, right turn
bit 3: if 0, left turn
bit 4 or 5: if either is 1, track starts or finishes downhill
bit 6 or 7: if either is 1, track starts or finishes uphill
So a flat track piece with no turns would be 15.
##### byte 9
4 if the track piece starts or ends at a 90 degree angle. 0 otherwise.
##### byte 10
is either 1 or 255, 1 if a turn?