1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-10 09:32:29 +01:00

Formatting, remove broken links

Margen67
2021-04-20 15:20:00 -10:00
parent f555739251
commit 54e1b59b70

170
Maps.md

@@ -3,121 +3,111 @@ Every tile on the current map is made up of `TileElement`. There can be multiple
# TileElement Structure
Each `TileElement` is made up of 8 bytes. There are 8 different types of tile element and they all have the same structure for the first 4 bytes:
| Byte | Offset Name | Notes
|-----|-------------|------
| 0 | Type | `0bXXYY_YYRR` where Y is the type (see table below), X is specific to type see below, R is the rotation
| 1 | Flags | See table below
| 2 | Base Height | The lowest point of the tile. Multiply by 8 to get real units.
| 3 | Clearance Height | The highest point of the tile. Multiply by 8 to get real units.
Byte | Offset Name | Notes
---- | ----------- | -----
0 | Type | `0bXXYY_YYRR` where Y is the type (see table below), X is specific to type see below, R is the rotation
1 | Flags | See table below
2 | Base Height | The lowest point of the tile. Multiply by 8 to get real units.
3 | Clearance Height | The highest point of the tile. Multiply by 8 to get real units.
The other 4 bytes differ per type.
### Type Table
Index | Type
------|-----
0 | Surface
1 | Path
2 | Track
3 | Scenery Small (Single Tile)
4 | Entrance
5 | Wall
6 | Scenery Large (Multiple Tile)
7 | Banner
8-15 | Not Used. Can cause odd issues if used
Index | Type
----- | ----
0 | Surface
1 | Path
2 | Track
3 | Scenery Small (Single Tile)
4 | Entrance
5 | Wall
6 | Scenery Large (Multiple Tile)
7 | Banner
8-15 | Unused; Can cause odd issues if used.
### Flags Table
Index | Description
------|---------
----- | -----------
0 - 3 | Collision Detection. Each bit represents a quarter of the tile 1 == top right, 8 == top left. If set vehicles that are off rails will collide.
4 | Ghost (Tile drawn white to indicate where construction will go)
5 | Broken (Used to indicate benches, bins, etc. are broken)
6 | For tracks this indicates they cannot be removed.
7 | Last Tile at coordinate
4 | Ghost (Tile drawn white to indicate where construction will go)
5 | Broken (Used to indicate benches, bins, etc. are broken)
6 | For tracks this indicates they cannot be removed.
7 | Last Tile at coordinate.
## Surface Elements (`SurfaceElement` struct)
| Byte | Offset Name | Notes
|-----|-------------|------
| 0 | Type | `0bE?YY_YY?T` where E is vertical edge style (extra bit), T is terrain style (extra bit)
| 4 | Slope | `0bEEES_SSSS` where E is the vertical edge style, S is slope. The 4 least significant bits represent one corner each, and the most significant bit tells when a slope is very steep. For steep slopes, three of the least significant bits need to be set.
| 5 | Terrain | `0bTTTW_WWWW` where T is terrain style, W is water height.
| 6 | Grass Length | 0 to 6 (0 = Mowed, 1 = Clear, 4 = Clumped, 6 = Heavily clumped)
| 7 | Ownership | `0bOOOO_FFFF` where O is ownership flags and F are park fence direction flags.
Byte | Offset Name | Notes
---- | ----------- | -----
0 | Type | `0bE?YY_YY?T` where E is vertical edge style (extra bit), T is terrain style (extra bit)
4 | Slope | `0bEEES_SSSS` where E is the vertical edge style, S is slope. The 4 least significant bits represent one corner each, and the most significant bit tells when a slope is very steep. For steep slopes, three of the least significant bits need to be set.
5 | Terrain | `0bTTTW_WWWW` where T is terrain style, W is water height.
6 | Grass Length | 0 to 6 (0 = Mowed, 1 = Clear, 4 = Clumped, 6 = Heavily clumped)
7 | Ownership | `0bOOOO_FFFF` where O is ownership flags and F are park fence direction flags.
## Path Elements (`PathElement` struct)
Depending on if the path is a queue or not modifies the structure.
| Byte | Offset Name | Notes
|-----|-------------|------
| 0 | Type | `0b??YY_YY2Q` where Q is set if it is a queue, 2 is set when the path is 2+ sections wide (stops peeps from thinking its a junction)
| 4 | Path Type | `0bTTTT_QSDD` where T is the type of path (0-15 from the paths available in the scenario), Q is set when it's the last path-element in a queue (the one with a banner), S is set if the path is sloped, and D stores the direction of the path. See [[Path Object]]
| 5 | Additions | Path additions are scenery that can be placed on paths (benches, bins, lamps). `0bG?SS_AAAA` where G is set for when the addition is a ghost, A is the type of addition (See rct_path_bit_scenery_entry), and S is the station number (rides can have up to 4 sets of stations).
| 6 | Edges | `0bCCCC_SSSS` where C are bits indicating if the corners are connected and S are bits indicating whether the edges are connected.
| 7 | Additions Status | For each of the 4 edges there are 2 bits to indicate if seat occupied (1 for occupied) / bin fullness (0 for full, 3 for empty).
| 7 | Ride Index | Index of the ride that the queue is connected to 0xFF for nothing.
Byte | Offset Name | Notes
---- |------------ | -----
0 | Type | `0b??YY_YY2Q` where Q is set if it is a queue, 2 is set when the path is 2+ sections wide (stops peeps from thinking its a junction)
4 | Path Type | `0bTTTT_QSDD` where T is the type of path (0-15 from the paths available in the scenario), Q is set when it's the last path-element in a queue (the one with a banner), S is set if the path is sloped, and D stores the direction of the path.
5 | Additions | Path additions are scenery that can be placed on paths (benches, bins, lamps). `0bG?SS_AAAA` where G is set for when the addition is a ghost, A is the type of addition (See rct_path_bit_scenery_entry), and S is the station number (rides can have up to 4 sets of stations).
6 | Edges | `0bCCCC_SSSS` where C are bits indicating if the corners are connected and S are bits indicating whether the edges are connected.
7 | Additions Status | For each of the 4 edges there are 2 bits to indicate if seat occupied (1 for occupied) / bin fullness (0 for full, 3 for empty).
7 | Ride Index | Index of the ride that the queue is connected to 0xFF for nothing.
## Track Elements (`TrackElement` struct)
The track element structure has two different forms depending on if its a maze or a regular ride.
| Byte | Offset Name | Notes
|-----|-------------|------
| 0 | Type | `0bC?YY_YYRR` where C is set if it is a chain lift
| 4 | Type | Each track element has a different track element type. See [[Track Data]]
| 5 | Sequence | `0bPPPP_SSSS` where S is the sequence index for the track piece (A curve for example is made up of multiple tiles each tile increments the sequence number). P is an extra parameter, for example brakes store the speed in this parameter.
| 6 | Colour | `0bSSSS_LICC` where C are bits indicating the colour scheme of the track piece. S stores seat rotation. I stores whether this piece is inverted (Multi-dim, Flying, Lay-down). L stores whether this piece contains a cable lift (Giga Coaster, not to be confused with chain lift).
| 5 - 6 | Maze Entry | See [[Maze]].
| 7 | Ride Index | Index of the ride that the track is connected to 0xFF for nothing.
Byte | Offset Name | Notes
---- | ----------- | -----
0 | Type | `0bC?YY_YYRR` where C is set if it is a chain lift
4 | Type | Each track element has a different track element type. See [[Track Data]]
5 | Sequence | `0bPPPP_SSSS` where S is the sequence index for the track piece (A curve for example is made up of multiple tiles each tile increments the sequence number). P is an extra parameter, for example brakes store the speed in this parameter.
6 | Colour | `0bSSSS_LICC` where C are bits indicating the colour scheme of the track piece. S stores seat rotation. I stores whether this piece is inverted (Multi-dim, Flying, Lay-down). L stores whether this piece contains a cable lift (Giga Coaster, not to be confused with chain lift).
5 - 6 | Maze Entry |
7 | Ride Index | Index of the ride that the track is connected to 0xFF for nothing.
## Scenery Small (Single Tile) Elements (`SmallSceneryElement` struct)
| Byte | Offset Name | Notes
|-----|-------------|------
| 0 | Type | `0bQQTT_TTRR` where Q is the quadrant used by small tiles that take up a single quadrant.
| 1 | Flags | `0bFFFF_XXXX` where X is ???
| 4 | Type | Index of the .DAT file that element represents. (Note 255 max small scenery). See [[Small Scenery Object]]
| 5 | Age | Used to show ageing of flowers.
| 6 | Colour 1 | `0b???C_CCCC` where C is colour 1
| 7 | Colour 2 | `0b???C_CCCC` where C is colour 2
Byte | Offset Name | Notes
---- | ----------- | -----
0 | Type | `0bQQTT_TTRR` where Q is the quadrant used by small tiles that take up a single quadrant.
1 | Flags | `0bFFFF_XXXX` where X is ???
4 | Type | Index of the .DAT file that element represents. (Note 255 max small scenery).
5 | Age | Used to show ageing of flowers.
6 | Colour 1 | `0b???C_CCCC` where C is colour 1
7 | Colour 2 | `0b???C_CCCC` where C is colour 2
## Entrance Elements (`EntranceElement` struct)
| Byte | Offset Name | Notes
|-----|-------------|------
| 4 | Type | There are 3 different types of entrance: PARK, RIDE_ENTRANCE, RIDE_EXIT
| 5 | Index | `0bSSRR_IIII` where I is the Index for which tile of the park entrance is shown. Park entrances are 3x1 middle tile is 0, left is 1, right is 2. R is the entrance or exit index for rides. S is the station number that the entrance/exit is connected to.
| 6 | Path Type | The type of path that is used in the park entrance.
| 7 | Ride Index | The ride index for the entrance/exit.
Byte | Offset Name | Notes
---- | ----------- | -----
4 | Type | There are 3 different types of entrance: PARK, RIDE_ENTRANCE, RIDE_EXIT
5 | Index | `0bSSRR_IIII` where I is the Index for which tile of the park entrance is shown. Park entrances are 3x1 middle tile is 0, left is 1, right is 2. R is the entrance or exit index for rides. S is the station number that the entrance/exit is connected to.
6 | Path Type | The type of path that is used in the park entrance.
7 | Ride Index | The ride index for the entrance/exit.
## Wall Elements (`WallElement` struct)
| Byte | Offset Name | Notes
|-----|-------------|------
| 0 | Type | `0bXXYY_YYRR` Where XX stores the slope (0 = flat, 1 and 2 are sloped)
| 2 | Flags | `0bL?BG_SS??` S is top 2 bits of secondary colour.
| 4 | Type | Type of wall, used to index into the loaded .DAT files. See [[Wall Object]]
| 5 | Tertiary Colour | Tertiary Colour
| 5 | Banner Index | If the wall has a banner.
| 6 | Primary Colour | `0bSSSP_PPPP` where P is primary colour and S is secondary colour (Note top 2 bits are in flags).
| 7 | Animation?? | `0bLHHH_HLLL` where L is ?? and H is ??.
Byte | Offset Name | Notes
---- | ----------- | -----
0 | Type | `0bXXYY_YYRR` Where XX stores the slope (0 = flat, 1 and 2 are sloped)
2 | Flags | `0bL?BG_SS??` S is top 2 bits of secondary colour.
4 | Type | Type of wall, used to index into the loaded .DAT files.
5 | Tertiary Colour | Tertiary Colour
5 | Banner Index | If the wall has a banner.
6 | Primary Colour | `0bSSSP_PPPP` where P is primary colour and S is secondary colour (Note top 2 bits are in flags).
7 | Animation?? | `0bLHHH_HLLL` where L is ?? and H is ??.
## Scenery Large (Multiple Tile) Elements (`LargeSceneryElement` struct)
| Byte | Offset Name | Notes
|-----|-------------|------
| 0 | Type | `0bBBTT_TTRR` B is for 2 highest bits of banner index (if used).
| 4 - 5 | Type | `0bIIII_IITT_TTTT_TTTT` Type of large scenery, used to index into the loaded .DAT files. See [[Large Scenery Object]] (Has space to go above the 128 maximum??). I is for Index of the multiple tile. I.e. 0 is for bottom left and counts up.
| 6 | Primary Colour | `0bBBBP_PPPP` where P is primary colour and B is middle 3 bits of banner index (if used).
| 7 | Secondary Colour | `0bBBBS_SSSS` where S is secondary colour and B is first 3 bits of banner index (if used).
Byte | Offset Name | Notes
---- | ----------- | -----
0 | Type | `0bBBTT_TTRR` B is for 2 highest bits of banner index (if used).
4 - 5 | Type | `0bIIII_IITT_TTTT_TTTT` Type of large scenery, used to index into the loaded .DAT files. (Has space to go above the 128 maximum??). I is for Index of the multiple tile. I.e. 0 is for bottom left and counts up.
6 | Primary Colour | `0bBBBP_PPPP` where P is primary colour and B is middle 3 bits of banner index (if used).
7 | Secondary Colour | `0bBBBS_SSSS` where S is secondary colour and B is first 3 bits of banner index (if used).
## Banner Elements (`BannerElement` struct)
| Byte | Offset Name | Notes
|-----|-------------|------
| 4 | Index | Banner Index. Used to index into the gBanners array to get more information about the banner. See [[Banner Object]] for more information.
| 5 | Position | Position on the path that the banner is used across.
| 6 | Flags | `0bXXXX_NNNN` Where N is an edge that is able to be entered when set and no entry when unset.
| 7 | Unused | Not used
Byte | Offset Name | Notes
---- | ----------- | -----
4 | Index | Banner Index. Used to index into the gBanners array to get more information about the banner.
5 | Position | Position on the path that the banner is used across.
6 | Flags | `0bXXXX_NNNN` Where N is an edge that is able to be entered when set and no entry when unset.
7 | Unused | Not used.