# HG changeset patch # User belugas # Date 1172723059 0 # Node ID b8e2ab2eaeff07664be5a287776692cc72de6071 # Parent abcb0580d976f53cc7b11cadb04c5b4cfda41936 (svn r8951) -Cleanup: Another bunch of re-formating and re-ordering. Among which, tiles area now read m1..m6, while the bits are always enumerated from 7 to 0 Hoping it will stay that way... diff -r abcb0580d976 -r b8e2ab2eaeff docs/landscape.html --- a/docs/landscape.html Thu Mar 01 01:24:44 2007 +0000 +++ b/docs/landscape.html Thu Mar 01 04:24:19 2007 +0000 @@ -24,7 +24,7 @@ Landscape grid page.

-

The owner of a tile, as frequently associated with attribute m1, + The owner of a tile, as frequently associated with attribute m1, can be either players (human or AI) or "Game entities". They are identified using: @@ -34,316 +34,1108 @@ -
10  nobody owns the tile
11  "water" owns the tile
FF  spectator in MP or in scenario editor

+

OTTD's class-specific periodic tile processing routine is called once every +256 ticks for each tile.

- - + + + + + + + - + + + + + - + - - - - - + + + + + + + + + + + + + + + + + + +
ClassMeaning & details of encoding
ClassMeaning & details of encoding
0  Ground +
0  
    -
  • m5 bits 4..0: tile type: - - - - - - - - - - - - - - -
    00  bare land
    01  1/3 grass
    02  2/3 grass
    03  full grass
    07  rough land
    0B  rocks
    0F  fields; type of fields in m3 bits 3..0 (legal values: 0 through 9)
    - m2: Index into the array of industries (farms), INVALID_INDUSTRY (0xFFFF) if farm has been removed
    10  1/4 snow
    11  2/4 snow
    12  3/4 snow
    13  full snow
    15  partial desert
    17  full desert
    -
  • +
  • m1: owner of the tile (normally 10)
  • +
  • m4 bits 7..5: type of hedge on the SW border of the tile (1 through 6, or 0=none)
  • +
  • m4 bits 4..2: same as 7..5, but for the SE border
  • m5 bits 7..5: update counter, incremented on every periodic processing for tile types, other than 03, 07, 0B, 10 and above.
    on wraparound, the tile is updated (for fields, the type of fields in m3 is increased, for other types the tile type in m5 is increased).
    - For snow and desert, these bits are not used, tile is updated on every periodic processing. + For snow and desert, these bits are not used, tile is updated on every periodic processing.
  • +
  • m5 bits 4..0: tile type: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    00  bare land
    01  1/3 grass
    02  2/3 grass
    03  full grass
    07  rough land
    0B  rocks
    0F  fields; type of fields in m3 bits 3..0 (legal values: 0 through 9)
    + m2: Index into the array of industries (farms), INVALID_INDUSTRY (0xFFFF) if farm has been removed
    10  1/4 snow
    11  2/4 snow
    12  3/4 snow
    13  full snow
    15  partial desert
    17  full desert
  • -
  • m1: owner of the tile (normally 10)
  • -
  • m4 bits 7..5: type of hedge on the SW border of the tile (1 through 6, or 0=none); bits 4..2: same for the SE border
1Railway tracks
1  
  • m5 bit 7 clear: railway track
      -
    • m5 bits 0..5: track layout: bit set = track present: +
    • m1: owner of the track
    • +
    • m3 bits 3..0 = track type: - - - - - - + + + + + + + + + + + + + + + + + + +
      bit 0: in the X direction
      bit 1: in the Y direction
      bit 2: in the north corner (direction W-E)
      bit 3: in the south corner (direction W-E)
      bit 4: in the west corner (direction N-S)
      bit 5: in the east corner (direction N-S)
      0  conventional railway
      1  electrified railway
      2  monorail
      3  maglev
    • -
    • m5 bit 6 set = with signals: -
        -
      • m3 bits 7..4: bit set = signal present: -
          -
        • For track in the X direction: - - - -
          bit 6: signal in the SW direction
          bit 7: signal in the NE direction
          -
        • -
        • For track in the Y direction: - - - -
          bit 6: signal in the NW direction
          bit 7: signal in the SE direction
          -
        • -
        • For tracks in the W-E direction: - - - - - -
          bit 4: signal in the W direction on the track in the S corner
          bit 5: signal in the E direction on the track in the S corner
          bit 6: signal in the W direction on the track in the N corner
          bit 7: signal in the E direction on the track in the N corner
          -
        • -
        • For tracks in the N-S direction: - - - - - -
          bit 4: signal in the S direction on the track in the E corner
          bit 5: signal in the N direction on the track in the E corner
          bit 6: signal in the S direction on the track in the W corner
          bit 7: signal in the N direction on the track in the W corner
          -
        • -
        -
      • -
      • m2 bits 7..4: bit clear = signal shows red; same bits as in m3
      • -
      • OpenTTD bits in m2: - - - - - - - -
        bits 1..0: type of signal:
        00: normal signals
        01: pre-signals
        10: exit-signals
        11: combo-signals
        bit 2: set = semaphore signals, clear = light signals
        -
      • -
      -
    • -
    • m1: owner of the track
    • -
    • m4 bits 0..3: +
    • m4 bits 3..0: - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      0  on bare land
      1  on grass, no fences
      2  fence on the NW side
      3  fence on the SE side
      4  fences on the NW and SE sides
      5  fence on the NE side
      6  fence on the SW side
      7  fences on the NE and SW sides
      8  fence on the E side (track in the W corner)
      9  fence on the W side (track in the E corner)
      A  fence on the S side (track in the N corner)
      B  fence on the N side (track in the S corner)
      C  on snow or desert
      0  on bare land
      1  on grass, no fences
      2  fence on the NW side
      3  fence on the SE side
      4  fences on the NW and SE sides
      5  fence on the NE side
      6  fence on the SW side
      7  fences on the NE and SW sides
      8  fence on the E side (track in the W corner)
      9  fence on the W side (track in the E corner)
      A  fence on the S side (track in the N corner)
      B  fence on the N side (track in the S corner)
      C  on snow or desert
    • -
    • m3 bits 0..3 = track type: +
    • m5 bits 5..0: track layout: bit set = track present: - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      0  conventional railway
      1  electrified railway
      2  monorail
      3  maglev
      bit 0: in the X direction
      bit 1: in the Y direction
      bit 2: in the north corner (direction W-E)
      bit 3: in the south corner (direction W-E)
      bit 4: in the west corner (direction N-S)
      bit 5: in the east corner (direction N-S)
  • m5 bit 7 set: railway depot / checkpoints
      +
    • m1: owner of the depot / checkpoint
    • +
    • m2: For waypoints, index into the array of waypoints.
    • +
    • m3 bits 3..0 = track type
    • +
    • m4 bits 3..0 = ground type, as per m4 bits 3..0 for railway tiles.
    • m5 value C0..C3: railway depot - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + +
      m5 bits 1..0
      direction: exit towards:
      00  NE
      01  SE
      02  SW
      03  NW
      m5 bits 1..0
      direction: exit towards:
      00  NE
      01  SE
      02  SW
      03  NW
    • m5 value 80..81: checkpoint - - - + + + + + + + + + + + + +
      bit 0
      clearin X direction
      setin Y direction
      bit 0
      clearin X direction
      setin Y direction
    • -
    • m1: owner of the depot / checkpoint
    • -
    • m2: For waypoints, index into the array of waypoints.
    • -
    • m3 bits 0..3 = track type
    • -
    • m4 bits 0..3 = ground type, as per m4 bits 0..3 for railway tiles.
    -
  • -
-
2 -
    -
  • m5 bits 7..4 clear: road +
  • +
  • m5 bit 6 set = with signals:
      -
    • m5 bits 3..0: road layout: bit set = road piece present: - - - - - -
      bit 0: NW piece
      bit 1: SW piece
      bit 2: SE piece
      bit 3: NE piece
      -
    • -
    • m1: owner of the road
    • -
    • m2: Index into the array of towns, 0 for non-town roads
    • -
    • m3 bits 0..3: counter for the roadworks
    • -
    • m3 bits 4..6: +
    • m2 bits 7..4: bit clear = signal shows red; same bits as in m3
    • +
    • m2 bit 2: set = semaphore signals, clear = light signals
    • +
    • m2 bits 1..0 : type of signal - - - - - - - -
      0  on bare land
      1  on grass
      2  paved
      3  with streetlights
      5  tree-lined
      6  on grass with road works
      7  paved with road works
      -
    • -
    • m3 bit 7 set = on snow or desert
    • -
    -
  • -
  • m5 bit 4 set, bits 7..5 clear: level crossing -
      -
    • m5 bit 3: clear - road in the X direction, set - road in the Y direction (railway track always perpendicular)
    • -
    • m5 bit 2: set if crossing lights are on
    • -
    • m1: owner of the railway track
    • -
    • m2: Index into the array of towns, 0 for non-town roads
    • -
    • m4 bits 0..7: owner of the road
    • -
    • m3 bits 3..0: track type
    • -
    • m3 bits 4..6: 0 - on bare land, 1 - on grass, 2 or higher - paved
    • -
    • m3 bit 7 set = on snow or desert
    • -
    -
  • -
  • m5 bit 5 set: road depot -
      -
    • m5 bits 3..0 - direction: exit towards: 0 = NE, 1 = SE, 2 = SW, 3 = NW
    • -
    • m1: owner of the depot
    • -
    • m3 bit 7 set = on snow or desert (not displayed, but set internally)
    • +
00: normal signals
01: pre-signals
10: exit-signals
11: combo-signals
+ + +
  • m3 bits 7..4: bit set = signal present: + +
  • + + 2 + Roads + - 3 - Town building +   + + + + + + + 3 + Town building + + +   +