Difference between revisions of "SMOKREF.DAT"

From UFOpaedia
Jump to navigation Jump to search
(Smoke Vs Vision)
m (→‎See Also: added links)
Line 41: Line 41:
 
* [[Saved_Game_Files#Battlescape_Files|Battlescape Files]]
 
* [[Saved_Game_Files#Battlescape_Files|Battlescape Files]]
 
* [[Smoke and Fire]]
 
* [[Smoke and Fire]]
 +
* [[Smoke Grenade]]
 +
* [[SMOKBIT.DAT]]
 
[[Category:Game Files]]
 
[[Category:Game Files]]

Revision as of 15:27, 12 April 2008

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.

Structure

0: Y position of smoke/fire.

1: X position of smoke/fire.

2: Z position of smoke/fire.

3: Time smoke will last.

4: Time fire will last.

5: Un-used? Never seen it flag.

6: Fire or smoke?

0 Record unused
1 Fire
2 Smoke

7: Flags 1 sometimes. Smoke will not render if set to 0. Possibly something to do with smoke spreading around.

8: Animation frame offset. Set at random, to break tile pattern in cloud of smoke. Ranges from 0 to 3.

See Also