From UFOpaedia
Jump to: navigation, search

SMOKEREF.DAT contains 400 records of 9 values of one byte each for a total of 3600 bytes.

There are a total of 12 sprites available for displaying smoke. Any given patch will animate through 4 consecutive sprites. The first sprite is (int)(smokeref[3] / 6 + 8) in SMOKE.PCK.

That is to say, if the smoke is due to last for less then six turns, smoke sprites 0 to 3 will be used. If the smoke is due to last less the twelve but more then five turns, sprites 1 to 4 will be used, and so forth.

This allows for nine different densities of displayable smoke. If the smoke is due to last fifty four or more turns, however, then rank badges will be included in the smoke animation. Values higher still will include bullet animations.

Smoke hinders vision according to a similar formula - (int)(smokeref[3] / 3). That is to say, take a cloud's "time to live", divide that by three and round the result down: This tells you how many tiles it chops off your effective range.

For example, say there are ten clouds with a TTL of 1 directly between you and your target. In this scenario, they won't affect your vision at all (1/3 rounded down = 0). But if they each have a TTL of 8, they'll each require you to move closer by two tiles (8/3 rounded down = 2) - removing 20 tiles from your visibility range!

Because the formula for what you see on the screen doesn't match the formula for how smoke obscures vision, it's impossible to tell a cloud's effect just by looking at it. For example, a cloud with a TTL of 7 will look the same as a cloud with a TTL of 10 - But the first cloud will only remove two tiles from your vision, whereas the second removes three.

Smoke clouds will drift around the battlescape and merge with others (effectively making them denser), though the rules for how are currently unknown. Summed up simply this means that smoke grenades are most likely more effective a few turns after they actually go off.


  • 0: Y position of smoke/fire.
  • 1: X position of smoke/fire.
  • 2: Z position of smoke/fire.
  • 3: Time smoke will last (also used as density). AKA "Intensity"
  • 4: Time fire will last. AKA "Age"
  • 5: Number of smoke patches overlapped (used only in runtime). Called "justspread"; 0=hasn't spread recently otherwise intensity of new spread.
  • 6: Fire or smoke?
    • 0 Empty
    • 1 Fire
    • 2 Smoke
    • 3-6 Gas (probably unused)
  • 7: Visibility flag. Note that smoke still won't be rendered unless the tile it's in is also visible.
  • 8: Animation frame offset. Set at random, to break tile pattern in cloud of smoke. Ranges from 0 to 3.

See Also