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).
IDLandscape type
0Rocky tiles

Actions:

Action 0 - New Landscape

See the Action 0 Specification for background information.

Properties:
Mappable nameSize in bytesDescription
newlandscape_enable_recolour1Enable recolour
newlandscape_enable_draw_snowy_rocks1Enable 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:

BitsMeaning
0 - 23Recolour sprite to use. Set to 0 for no recolouring.
24 - 31Reserved, 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:
NumberMappable nameDescription
40newlandscape_terrain_typeTerrain type
41newlandscape_tile_slopeTile Slope
42newlandscape_tile_heightTile Height
43newlandscape_tile_hashTile Hash
44newlandscape_landscape_typeLandscape Type
45newlandscape_ground_infoGround info
60newlandscape_land_info_nearby_tilesLand 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.

ValueMeaning
0Normal
1Desert
2Rainforest
4On 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

BitsValuesMeaning
0 - 30..3Ground density (if snow is present, this is the snow density)
40 or 1Snow 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 IDExpected number of spritesLandscape type
019Rocky 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