Difference between revisions of "SEEMAP.DAT"

From UFOpaedia
Jump to navigation Jump to search
m (→‎See Also: added category)
Line 1: Line 1:
This file is only used by tactical saves.<br>
+
This file is only used by tactical saves and has a length of [[WGLOB.DAT|wglob[2] times wglob[3] times wglob[4]]] bytes. It details which areas of the map have been explored.
<br>
+
 
Length of wglob[2]*wglob[3]*wglob[4] bytes.<br>
+
Each tile is detailed using three bits of an entire byte. The offset for any given byte is ''X Map Length'' * (''Map Level'' * ''Y Map Length'' + ''X'') + ''Y''.
<br>
+
 
Details which areas of the map have been explored.<br>
+
* Bit 1 (1): Has the west wall been seen?
Each tile is detailed in one byte. If the first bit<br>
+
* Bit 2 (2): Has the north wall been seen?
(1) of this byte is flagged, the west wall has been<br>
+
* Bit 3 (4): Has the ground/contents been seen?
seen. If the second bit (2) has been flagged, the <br>
+
 
north wall has been seen. The third bit (4) tells <br>
+
When the respective SEEMAP offset for a given tile has bit 3 active you can see all elements (walls, contents, etc) on the screen, otherwise nothing will be visible at all.  
whether the contents and ground has been seen. For<br>
+
 
example, a value of 7d would mean the entire tile<br>
+
For example, if a tile has a northern wall in it and a soldier standing further north looks at it, he'll see the wall (and bit 2 will flip to on) but the wall will still remain invisible on screen because he can't see past it into the rest of the tile.
is visible.<br>
+
 
 +
On the other hand, if he was standing to the south, he'd be able to see everything in the tile and so all three bits would flag and everything becomes visible.
 +
 
 +
That is to say, the first two bits are redundant. They're set and then ignored.
 +
 
 +
Not really sure why the programmers bothered with this, I guess they changed their mind on how the fog of war display would work at some point but didn't bother to simplify the backend to match.
  
 
==See Also==
 
==See Also==

Revision as of 07:06, 22 June 2008

This file is only used by tactical saves and has a length of wglob[2] times wglob[3] times wglob[4] bytes. It details which areas of the map have been explored.

Each tile is detailed using three bits of an entire byte. The offset for any given byte is X Map Length * (Map Level * Y Map Length + X) + Y.

  • Bit 1 (1): Has the west wall been seen?
  • Bit 2 (2): Has the north wall been seen?
  • Bit 3 (4): Has the ground/contents been seen?

When the respective SEEMAP offset for a given tile has bit 3 active you can see all elements (walls, contents, etc) on the screen, otherwise nothing will be visible at all.

For example, if a tile has a northern wall in it and a soldier standing further north looks at it, he'll see the wall (and bit 2 will flip to on) but the wall will still remain invisible on screen because he can't see past it into the rest of the tile.

On the other hand, if he was standing to the south, he'd be able to see everything in the tile and so all three bits would flag and everything becomes visible.

That is to say, the first two bits are redundant. They're set and then ignored.

Not really sure why the programmers bothered with this, I guess they changed their mind on how the fog of war display would work at some point but didn't bother to simplify the backend to match.

See Also