## NewGRF New Landscape Addition to NewGRF Specifications in JGR's Patchpack

This document describes the non-standard addition of the NewGRF new landscape feature to the Official OpenTTD NewGRF Specifications, as implemented in this patchpack.

This feature allows NewGRF custom graphics using Action 1/2/3 for landscape tiles. Currently this includes: rock tiles.

This feature may not necessarily match implementations of additional landscape graphics features in other patches, branches, etc.
This feature as implemented here MAY also be present in other patchpacks.

See the NewGRF additions document for background information on additions to the NewGRF specifications.

The functionality listed below is also supported in a fork of NML, see the associated NML new landscape and NML additions documents for more details.

NewGRFs which use this feature SHOULD use the feature testing mechanism to check whether the new landscape feature and/or feature ID mapping is supported.

NewGRFs which use this feature MUST use the feature ID mapping mechanism to map the non-standard NewGRF road stop feature to a local feature ID.

This feature is indicated by the feature name: new_landscape, version 1.
The feature name to use for feature ID mapping is new_landscape.
Features/properties/variables which require a higher version will indicate the required version. Unless indicated otherwise these will fall back to doing nothing on versions which do not support them.

### IDs:

The ID field for Actions 0 and 3 must be set to one of the IDs in the table below (further IDs may be allocated for other purposes in future).

ID | Landscape type
--- | ---
0 | Rocky tiles

### Actions:

- Action 0
- Action 2
- Variational Action 2
- Action 3

### Action 0 - New Landscape

See the Action 0 Specification for background information.

Properties:

Mappable name | Size in bytes | Description
--- | --- | ---
newlandscape_enable_recolour | 1 | Enable recolour
newlandscape_enable_draw_snowy_rocks | 1 | Enable drawing rocky tiles covered by snow

#### Enable recolouring for new landscape graphics (mappable property: newlandscape_enable_recolour)

When enabled, in addition to returning a sprite, register 0x100 may be set to the following:

Bits | Meaning
--- | ---
0 - 23 | Recolour sprite to use. Set to 0 for no recolouring.
24 - 31 | Reserved, set to zero.

The property length is 1 byte. 0 is disabled (default). 1 is enabled.

#### Enable drawing rocky tiles covered by snow (mappable property: newlandscape_enable_draw_snowy_rocks)

When enabled, drawing of rocky tiles covered by snow is enabled for this GRF.

The property length is 1 byte. 0 is disabled (default). 1 is enabled.
This requires new_landscape, version 2.

### Action 2 - New Landscape

See the Action 2 Specification for background information.

New landscape does not use the special sprite layout format.

### Variational Action 2 - New Landscape

See the Variational Action 2 Specification for background information.

Variables:

Number | Mappable name | Description
--- | --- | ---
40 | newlandscape_terrain_type | Terrain type
41 | newlandscape_tile_slope | Tile Slope
42 | newlandscape_tile_height | Tile Height
43 | newlandscape_tile_hash | Tile Hash
44 | newlandscape_landscape_type | Landscape Type
45 | newlandscape_ground_info | Ground info
60 | newlandscape_land_info_nearby_tiles | Land info of nearby tiles

#### Tile terrain type (40, or mappable variable: newlandscape_terrain_type)

This has the same value as bits 0 - 7 of object (feature F) variable 41.

Value | Meaning
--- | ---
0 | Normal
1 | Desert
2 | Rainforest
4 | On or above snowline

#### Tile slope (41, or mappable variable: newlandscape_tile_slope)

This has the same value as bits 0 - 7 of industry tile (feature 9) variable 60 for this tile.

#### Tile height (42, or mappable variable: newlandscape_tile_height)

The height of the lowest corner of the tile (in units of 1).

#### Tile hash (43, or mappable variable: newlandscape_tile_hash)

Hash value derived from the coordinates of the tile, suitable for pseudo-randomising graphics.

#### Landscape type (44, or mappable variable: newlandscape_landscape_type)

The landscape type, this currently only has the value 0: rocky tiles.

#### Ground info (45, or mappable variable: newlandscape_ground_info)

Miscellaneous ground info

Bits | Values | Meaning
--- | --- | ---
0 - 3 | 0..3 | Ground density (if snow is present, this is the snow density)
4 | 0 or 1 | Snow is present on this tile, at any density

The remaining bits are reserved for future use and should be masked.
This requires new_landscape, version 2.

#### Land info of nearby tile (60, or mappable variable: newlandscape_land_info_nearby_tiles)

This has the same value as industry tile (feature 9) variable 60.

### Action 3 - New Landscape

See the Action 3 Specification for background information.

Note that this is not a generic callback, the sprite group must be assigned to an ID in the IDs table.

Action 3 ID | Expected number of sprites | Landscape type
--- | --- | ---
0 | 19 | Rocky tiles

Cargo type definitions are not used. Only the default set ID is used.

This is indicated by the feature name: new_landscape, version 1