Difference between revisions of "NML:List of tile slopes"

From GRFSpecs
Jump to navigationJump to search
m (reuse image of NewGRF specs)
m (Changed from table to sortable.)
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
  +
{{NMLNavAdditionalreferences}}
  +
 
Tiles in TTD can have various slopes. The slope is a bitmask that may contain the following bits:
 
Tiles in TTD can have various slopes. The slope is a bitmask that may contain the following bits:
   
Line 25: Line 27:
 
Sprites for slopes are always in the same order in TTD. For example, <code style="color:darkgreen">GROUND_SPRITE_NORMAL</code> is the sprite number of a flat grass tile. It is followed by 18 other sprites, that display a flat grass tile for each possible slope. The order of these sprites is given in the last column of the table. The [[NML:Builtin functions|builtin function]] <code style="color:darkgreen">slope_to_sprite_offset(''slope'')</code> can be used to determine the sprite offset of a given slope.
 
Sprites for slopes are always in the same order in TTD. For example, <code style="color:darkgreen">GROUND_SPRITE_NORMAL</code> is the sprite number of a flat grass tile. It is followed by 18 other sprites, that display a flat grass tile for each possible slope. The order of these sprites is given in the last column of the table. The [[NML:Builtin functions|builtin function]] <code style="color:darkgreen">slope_to_sprite_offset(''slope'')</code> can be used to determine the sprite offset of a given slope.
   
{| class="t"
+
{| class="wikitable sortable"
  +
! Sprite
 
! Named constant
 
! Named constant
 
! Equivalent bitmask
 
! Equivalent bitmask
Line 31: Line 34:
 
! Sprite offset
 
! Sprite offset
 
|-
 
|-
  +
| [[Image:Sprite3981.png]]
 
| SLOPE_FLAT
 
| SLOPE_FLAT
 
| <code style="color:darkgreen">bitmask()</code>
 
| <code style="color:darkgreen">bitmask()</code>
Line 36: Line 40:
 
| 0
 
| 0
 
|-
 
|-
  +
| [[Image:Sprite3982.png]]
 
| SLOPE_W
 
| SLOPE_W
 
| <code style="color:darkgreen">bitmask(CORNER_W)</code>
 
| <code style="color:darkgreen">bitmask(CORNER_W)</code>
Line 41: Line 46:
 
| 1
 
| 1
 
|-
 
|-
  +
| [[Image:Sprite3983.png]]
 
| SLOPE_S
 
| SLOPE_S
 
| <code style="color:darkgreen">bitmask(CORNER_S)</code>
 
| <code style="color:darkgreen">bitmask(CORNER_S)</code>
Line 46: Line 52:
 
| 2
 
| 2
 
|-
 
|-
  +
| [[Image:Sprite3985.png]]
 
| SLOPE_E
 
| SLOPE_E
 
| <code style="color:darkgreen">bitmask(CORNER_E)</code>
 
| <code style="color:darkgreen">bitmask(CORNER_E)</code>
Line 51: Line 58:
 
| 4
 
| 4
 
|-
 
|-
  +
| [[Image:Sprite3989.png]]
 
| SLOPE_N
 
| SLOPE_N
 
| <code style="color:darkgreen">bitmask(CORNER_N)</code>
 
| <code style="color:darkgreen">bitmask(CORNER_N)</code>
Line 56: Line 64:
 
| 8
 
| 8
 
|-
 
|-
  +
| [[Image:Sprite3990.png]]
 
| SLOPE_NW
 
| SLOPE_NW
 
| <code style="color:darkgreen">bitmask(CORNER_N, CORNER_W)</code>
 
| <code style="color:darkgreen">bitmask(CORNER_N, CORNER_W)</code>
Line 61: Line 70:
 
| 9
 
| 9
 
|-
 
|-
  +
| [[Image:Sprite3984.png]]
 
| SLOPE_SW
 
| SLOPE_SW
 
| <code style="color:darkgreen">bitmask(CORNER_S, CORNER_W)</code>
 
| <code style="color:darkgreen">bitmask(CORNER_S, CORNER_W)</code>
Line 66: Line 76:
 
| 3
 
| 3
 
|-
 
|-
  +
| [[Image:Sprite3987.png]]
 
| SLOPE_SE
 
| SLOPE_SE
 
| <code style="color:darkgreen">bitmask(CORNER_S, CORNER_E)</code>
 
| <code style="color:darkgreen">bitmask(CORNER_S, CORNER_E)</code>
Line 71: Line 82:
 
| 6
 
| 6
 
|-
 
|-
  +
| [[Image:Sprite3993.png]]
 
| SLOPE_NE
 
| SLOPE_NE
 
| <code style="color:darkgreen">bitmask(CORNER_N, CORNER_E)</code>
 
| <code style="color:darkgreen">bitmask(CORNER_N, CORNER_E)</code>
Line 76: Line 88:
 
| 12
 
| 12
 
|-
 
|-
  +
| [[Image:Sprite3986.png]]
 
| SLOPE_EW
 
| SLOPE_EW
 
| <code style="color:darkgreen">bitmask(CORNER_E, CORNER_W)</code>
 
| <code style="color:darkgreen">bitmask(CORNER_E, CORNER_W)</code>
Line 81: Line 94:
 
| 5
 
| 5
 
|-
 
|-
  +
| [[Image:Sprite3991.png]]
 
| SLOPE_NS
 
| SLOPE_NS
 
| <code style="color:darkgreen">bitmask(CORNER_N, CORNER_S)</code>
 
| <code style="color:darkgreen">bitmask(CORNER_N, CORNER_S)</code>
Line 86: Line 100:
 
| 10
 
| 10
 
|-
 
|-
  +
| [[Image:Sprite3992.png]]
 
| SLOPE_NWS
 
| SLOPE_NWS
 
| <code style="color:darkgreen">bitmask(CORNER_N, CORNER_W, CORNER_S)</code>
 
| <code style="color:darkgreen">bitmask(CORNER_N, CORNER_W, CORNER_S)</code>
Line 91: Line 106:
 
| 11
 
| 11
 
|-
 
|-
  +
| [[Image:Sprite3988.png]]
 
| SLOPE_WSE
 
| SLOPE_WSE
 
| <code style="color:darkgreen">bitmask(CORNER_W, CORNER_S, CORNER_E)</code>
 
| <code style="color:darkgreen">bitmask(CORNER_W, CORNER_S, CORNER_E)</code>
Line 96: Line 112:
 
| 7
 
| 7
 
|-
 
|-
  +
| [[Image:Sprite3995.png]]
 
| SLOPE_SEN
 
| SLOPE_SEN
 
| <code style="color:darkgreen">bitmask(CORNER_S, CORNER_E, CORNER_N)</code>
 
| <code style="color:darkgreen">bitmask(CORNER_S, CORNER_E, CORNER_N)</code>
Line 101: Line 118:
 
| 14
 
| 14
 
|-
 
|-
  +
| [[Image:Sprite3994.png]]
 
| SLOPE_ENW
 
| SLOPE_ENW
 
| <code style="color:darkgreen">bitmask(CORNER_E, CORNER_N, CORNER_W)</code>
 
| <code style="color:darkgreen">bitmask(CORNER_E, CORNER_N, CORNER_W)</code>
Line 106: Line 124:
 
| 13
 
| 13
 
|-
 
|-
  +
| [[Image:Sprite3998.png]]
 
| SLOPE_STEEP_W
 
| SLOPE_STEEP_W
 
| <code style="color:darkgreen">bitmask(CORNER_N, CORNER_W, CORNER_S, IS_STEEP_SLOPE)</code>
 
| <code style="color:darkgreen">bitmask(CORNER_N, CORNER_W, CORNER_S, IS_STEEP_SLOPE)</code>
Line 111: Line 130:
 
| 17
 
| 17
 
|-
 
|-
  +
| [[Image:Sprite3997.png]]
 
| SLOPE_STEEP_S
 
| SLOPE_STEEP_S
 
| <code style="color:darkgreen">bitmask(CORNER_W, CORNER_S, CORNER_E, IS_STEEP_SLOPE)</code>
 
| <code style="color:darkgreen">bitmask(CORNER_W, CORNER_S, CORNER_E, IS_STEEP_SLOPE)</code>
Line 116: Line 136:
 
| 16
 
| 16
 
|-
 
|-
  +
| [[Image:Sprite3999.png]]
 
| SLOPE_STEEP_E
 
| SLOPE_STEEP_E
 
| <code style="color:darkgreen">bitmask(CORNER_S, CORNER_E, CORNER_N, IS_STEEP_SLOPE)</code>
 
| <code style="color:darkgreen">bitmask(CORNER_S, CORNER_E, CORNER_N, IS_STEEP_SLOPE)</code>
Line 121: Line 142:
 
| 18
 
| 18
 
|-
 
|-
  +
| [[Image:Sprite3996.png]]
 
| SLOPE_STEEP_N
 
| SLOPE_STEEP_N
 
| <code style="color:darkgreen">bitmask(CORNER_E, CORNER_N, CORNER_W, IS_STEEP_SLOPE)</code>
 
| <code style="color:darkgreen">bitmask(CORNER_E, CORNER_N, CORNER_W, IS_STEEP_SLOPE)</code>

Latest revision as of 21:03, 30 August 2022

Additional References

Tiles in TTD can have various slopes. The slope is a bitmask that may contain the following bits:

bit flag meaning
CORNER_W west corner is above the lowest corner.
CORNER_S south corner is above the lowest corner.
CORNER_E east corner is above the lowest corner.
CORNER_N north corner is above the lowest corner.
IS_STEEP_SLOPE this tile is a steep slope (the corner opposite to the lowest corner is 2 units higher).

The resulting, possible values of this bitmask are given in the following table. The image below that illustrates them graphically. See also the builtin function num_corners_raised(slope).

Sprites for slopes are always in the same order in TTD. For example, GROUND_SPRITE_NORMAL is the sprite number of a flat grass tile. It is followed by 18 other sprites, that display a flat grass tile for each possible slope. The order of these sprites is given in the last column of the table. The builtin function slope_to_sprite_offset(slope) can be used to determine the sprite offset of a given slope.

Sprite Named constant Equivalent bitmask Numerical value Sprite offset
Sprite3981.png SLOPE_FLAT bitmask() 0 0
Sprite3982.png SLOPE_W bitmask(CORNER_W) 1 1
Sprite3983.png SLOPE_S bitmask(CORNER_S) 2 2
Sprite3985.png SLOPE_E bitmask(CORNER_E) 4 4
Sprite3989.png SLOPE_N bitmask(CORNER_N) 8 8
Sprite3990.png SLOPE_NW bitmask(CORNER_N, CORNER_W) 9 9
Sprite3984.png SLOPE_SW bitmask(CORNER_S, CORNER_W) 3 3
Sprite3987.png SLOPE_SE bitmask(CORNER_S, CORNER_E) 6 6
Sprite3993.png SLOPE_NE bitmask(CORNER_N, CORNER_E) 12 12
Sprite3986.png SLOPE_EW bitmask(CORNER_E, CORNER_W) 5 5
Sprite3991.png SLOPE_NS bitmask(CORNER_N, CORNER_S) 10 10
Sprite3992.png SLOPE_NWS bitmask(CORNER_N, CORNER_W, CORNER_S) 11 11
Sprite3988.png SLOPE_WSE bitmask(CORNER_W, CORNER_S, CORNER_E) 7 7
Sprite3995.png SLOPE_SEN bitmask(CORNER_S, CORNER_E, CORNER_N) 14 14
Sprite3994.png SLOPE_ENW bitmask(CORNER_E, CORNER_N, CORNER_W) 13 13
Sprite3998.png SLOPE_STEEP_W bitmask(CORNER_N, CORNER_W, CORNER_S, IS_STEEP_SLOPE) 27 17
Sprite3997.png SLOPE_STEEP_S bitmask(CORNER_W, CORNER_S, CORNER_E, IS_STEEP_SLOPE) 23 16
Sprite3999.png SLOPE_STEEP_E bitmask(CORNER_S, CORNER_E, CORNER_N, IS_STEEP_SLOPE) 30 18
Sprite3996.png SLOPE_STEEP_N bitmask(CORNER_E, CORNER_N, CORNER_W, IS_STEEP_SLOPE) 29 15


tile slopes