Difference between revisions of "LOFTEMPS.DAT"

From UFOpaedia
Jump to navigation Jump to search
Line 1: Line 1:
 
{{tocright}}
 
{{tocright}}
  
LOFTEMPS.DAT is found in GEODATA and contains "3D" information on the map objects.   
+
LOFTEMPS.DAT is found in GEODATA and contains "Line of Fire Templates", used to create 3D representations of the creatures and objects within the battlescape.   
  
There are 112 entries (114 for for TFTD), each of which are 32 bytes long. It is 3,584 bytes long (3,648 in the sequel).
+
The file is made up of multiple 16x16 bitmaps (32 bytes each, one bit per pixel, where 1 is solid and 0 is empty). These are then double layered using the 12 LOF references for each and every tile defined in the [[TERRAIN#MCD|MCD files]], to create a 16x16x24 3D object.
  
TFTD stores the LOFTEMPS tables in the [[TERRAIN]] folder, but also keeps a copy of UFO's version in it's original location (unused).
+
Units are represented by a single LOF template, usually a round one, which is defined by offset 48 of the [[UNITREF.DAT]] record for that unit. This is stacked according to the unit's [[height]] (offset 49 or 50, depending on whether the unit is standing or kneeling), to create a cylinder shape. Note that "large" units, which cover four tiles, are made up of four such cylinders.
 +
 
 +
In UFO there are 112 entries, 3,584 bytes in total (or, in TFTD, 114 entries spanning 3,648 bytes). TFTD stores the LOFTEMPS tables in the [[TERRAIN]] folder, but also keeps a copy of UFO's version in it's original location - though this old version is unused.
 +
 
 +
 
 +
==Template Usage==
 +
[[image:Loftemps_Example.png|right|thumb|150px|An example of a 3D tree made up of stacked LOF templates. Click for a larger view.]]
 +
Both UFO and TFTD are presented as 2D games, that is to say, all the images on the screen are made up of sprites. In the battlescape, everything is shown from an isometric perspective.
 +
 
 +
However, the games are only ''presented'' in 2D - much of the actual processing is done on 3D objects (albeit primitive ones). These are defined by stacking the LOF templates stored on this file on top of each other.
 +
 
 +
When a soldier crouches next to a short wall, for example, he may no longer be able to see over it if his head is now below the top. Likewise, he may or may not be able to see through the slats of a picket fence, depending on what angle he views it from.
 +
 
 +
Likewise, these 3D objects also come into play when bullets fly though the air. If a unit is hiding behind a tree, the thick foliage will likely protect his head from a bullet aimed high - but a low flying shot may easily go past the thin trunk and get him in the legs.
 +
 
 +
A soldier's head is positioned slightly higher then the barrel of his gun. For this reason, it is possible for him to be able to ''see'' an alien (that is, he has a valid "line of sight"), but not ''shoot'' it (because he has a blocked "line of fire").
 +
 
 +
 
 +
==Template Oddities==
 +
''I'll write more here later; I intend to cover how it is possible to both see and shoot through these 3D objects on a diagonal angle, plus show example images of some of the more blatant LOFTemp errors in the MCD files - such as the floating wall of the Lightning, the big hole under the Triton's wing, the gap in the floor of the Supply Ship, etc...''
  
The file creates 16x16 bitmaps (one bit per pixel, where 1 is solid and 0 is empty). These are then double layered using the 12 loft references in the MCD files to create a 16x16x24 3D object.
 
  
 
==Additional Information==
 
==Additional Information==

Revision as of 07:25, 23 June 2010

LOFTEMPS.DAT is found in GEODATA and contains "Line of Fire Templates", used to create 3D representations of the creatures and objects within the battlescape.

The file is made up of multiple 16x16 bitmaps (32 bytes each, one bit per pixel, where 1 is solid and 0 is empty). These are then double layered using the 12 LOF references for each and every tile defined in the MCD files, to create a 16x16x24 3D object.

Units are represented by a single LOF template, usually a round one, which is defined by offset 48 of the UNITREF.DAT record for that unit. This is stacked according to the unit's height (offset 49 or 50, depending on whether the unit is standing or kneeling), to create a cylinder shape. Note that "large" units, which cover four tiles, are made up of four such cylinders.

In UFO there are 112 entries, 3,584 bytes in total (or, in TFTD, 114 entries spanning 3,648 bytes). TFTD stores the LOFTEMPS tables in the TERRAIN folder, but also keeps a copy of UFO's version in it's original location - though this old version is unused.


Template Usage

An example of a 3D tree made up of stacked LOF templates. Click for a larger view.

Both UFO and TFTD are presented as 2D games, that is to say, all the images on the screen are made up of sprites. In the battlescape, everything is shown from an isometric perspective.

However, the games are only presented in 2D - much of the actual processing is done on 3D objects (albeit primitive ones). These are defined by stacking the LOF templates stored on this file on top of each other.

When a soldier crouches next to a short wall, for example, he may no longer be able to see over it if his head is now below the top. Likewise, he may or may not be able to see through the slats of a picket fence, depending on what angle he views it from.

Likewise, these 3D objects also come into play when bullets fly though the air. If a unit is hiding behind a tree, the thick foliage will likely protect his head from a bullet aimed high - but a low flying shot may easily go past the thin trunk and get him in the legs.

A soldier's head is positioned slightly higher then the barrel of his gun. For this reason, it is possible for him to be able to see an alien (that is, he has a valid "line of sight"), but not shoot it (because he has a blocked "line of fire").


Template Oddities

I'll write more here later; I intend to cover how it is possible to both see and shoot through these 3D objects on a diagonal angle, plus show example images of some of the more blatant LOFTemp errors in the MCD files - such as the floating wall of the Lightning, the big hole under the Triton's wing, the gap in the floor of the Supply Ship, etc...


Additional Information

BladeFireLight has written detailed information of the MCD files and the LOFTEMPS.DAT, which can be found on this link: Map Control Data (MCD)

Images

UFO

Here are the 112, 16x16 bitmaps (white is solid):

Loftemps.png

TFTD

Here are the 114, 16x16 bitmaps (white is solid):

Loftemps TFTD.png