Difference between revisions of "BGLOB.DAT"

From UFOpaedia
Jump to navigation Jump to search
Line 1: Line 1:
This file is only used by tactical saves.
+
This file is only used by tactical saves. It is always two bytes and describes the default light levels on the map.
  
Always two bytes, describes ambient light on map.
+
The first byte indicates overall level of ambient lighting. On night missions it is 16, on day missions 0, dusk and dawn uses values in the middle. The second byte is the ambient lighting of shadowed areas (below and inside Skyranger, inside UFOs), usually it is equal to the first byte plus four. On the end of each turn [[TERMP.DAT]] is recalculated using the appropriate value from BGLOB.DAT as the maximum. What determines which value of the two gets used is not yet known.
  
First byte indicates overall level of ambient lighting. On night missions it is 10h, on day missions 00h, dusk and dawn uses values in the middle. Second byte is ambient lighting of shadowed areas (below and inside Skyranger, inside UFOs), usually it is first byte+4. On the end of turn [[TERMP.DAT]] is recalculated using appropriate value from BGLOB.DAT as maximum. What determines which value of two is used is not known yet.
+
The values held in this file are determined by values in [[MISSION.DAT]]. For a UFO/Terror site, a value from this table (stored in the executable) will be used as the first BGLOB byte, according to MISSION[76/4C] (which is based on the time at the mission location):
  
The initial values held in this file seem to be determined by [[MISSION.DAT|Mission.Dat[74-76]]].
+
'''MISSION[76] Value:  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23'''
 +
BGLOB[0] Value:    16 16 16 16 16 16 16 16 16 16 12  8  4  2  0  0  0  0  0  0  0  0  0  0
  
:Offsets 74-75 looks like the 'local time' of the mission. It is translated into brightness by a 24 entries array of words (2 bytes) located at offset 0x6C99C. [[User:Seb76|Seb76]] 05:39, 21 June 2008 (PDT)
+
For example, if MISSION[76] is 11 BGLOB[0] will be 8 and BGLOB[1] will be 12.
  
So in decimal, the values are:
+
When defending an X-Com base, the table is ignored (as the map is underground and so time of day is irrelvant). Both BGLOB values will be set to 8.
  
16,16,16,16,16,16,16,16,16,16,12, 8, 4, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
+
The three other mission types (alien base assault, cydonia surface, cydonia underground base) set both BGLOB values to 16.  
 
 
Well, yeah, those seem like the sort of values you'd expect to see in BGLOB. However, the highest value I've seen stored at MISSION[74-75] is 15... I'm not sure how you could map that range to the 24 values here. Also it's not really a "night to day to night" cycle, it just goes from dark to light.
 
 
 
Any chance MISSION[74-75] isn't the time, but a value derived from the time? That makes a little more sense to me.
 
:The value is computed from offset 2 of LOC.DAT and the time of the day so I assumed it was local time. Well anyway, it is a time representation of some kind ;-) [[User:Seb76|Seb76]] 09:59, 21 June 2008 (PDT)
 
 
 
Note that MISSION[76] also as a purpose here, but I didn't tinker too much with it when I first found out about it (who knows how long ago)... I think I got the impression that the type of mission would affect the BGLOB lighting scheme?
 
:I could find the following usage for offset 76:
 
:* Power source explosion check during map creation
 
:* Clean up of LOC.DAT and CRAFT.DAT entries after a crash recovery mission
 
:* UFO CRASH RECOVERY/UFO GROUND ASSAULT message selection before a ground mission
 
:* I found it set to 1 only for crash sites
 
:Also the time is only used for mission types 0 and 1 (where dark zones use ambient level+4). Mission type 2 is hard coded to 8; and types 3,4,5 to 0x10 (for both normal and dark tiles).
 
:I could not find anything else. [[User:Seb76|Seb76]] 09:59, 21 June 2008 (PDT)
 
 
 
- [[User:Bomb Bloke|Bomb Bloke]] 06:03, 21 June 2008 (PDT)
 
  
 
==See Also==
 
==See Also==

Revision as of 10:39, 23 June 2008

This file is only used by tactical saves. It is always two bytes and describes the default light levels on the map.

The first byte indicates overall level of ambient lighting. On night missions it is 16, on day missions 0, dusk and dawn uses values in the middle. The second byte is the ambient lighting of shadowed areas (below and inside Skyranger, inside UFOs), usually it is equal to the first byte plus four. On the end of each turn TERMP.DAT is recalculated using the appropriate value from BGLOB.DAT as the maximum. What determines which value of the two gets used is not yet known.

The values held in this file are determined by values in MISSION.DAT. For a UFO/Terror site, a value from this table (stored in the executable) will be used as the first BGLOB byte, according to MISSION[76/4C] (which is based on the time at the mission location):

MISSION[76] Value:  0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
BGLOB[0] Value:    16 16 16 16 16 16 16 16 16 16 12  8  4  2  0  0  0  0  0  0  0  0  0  0

For example, if MISSION[76] is 11 BGLOB[0] will be 8 and BGLOB[1] will be 12.

When defending an X-Com base, the table is ignored (as the map is underground and so time of day is irrelvant). Both BGLOB values will be set to 8.

The three other mission types (alien base assault, cydonia surface, cydonia underground base) set both BGLOB values to 16.

See Also