Difference between revisions of "TERRAIN"

From UFOpaedia
Jump to navigation Jump to search
(→‎MCD: -- Cleaned up and removed HTML code)
Line 2: Line 2:
 
<br>
 
<br>
 
Each of the three files used for each tileset contains a variable amount of records. PCK files and their respective TAB files should always contain an equal amount of records.<br>
 
Each of the three files used for each tileset contains a variable amount of records. PCK files and their respective TAB files should always contain an equal amount of records.<br>
== MCD ==
+
==Structure==
 +
Files made up of a variable amount of records, each of 62 bytes.
  
Files made up of a variable amount of records, each of 62 bytes.<br>
+
Things to search for:
<br>
+
- Stun caused by explosion.
Things to search for:<br>
+
 
- Stun caused by explosion.<br>
+
'''0-7:''' Animation of the tile.
<br>
+
 
mcd[00]-[07]:<br>
+
The second four bytes always seems to be a copy of the first four bytes. This animation only works for doors when they are opened.
Animation of the tile.<br>
+
 
The second four bytes always seems to be a(n ignored?) copy of the first four bytes.
+
'''8-19:''' Loft of the tile. 12 values, each references into [[LOFTEMPS.DAT]] file.
This animation only works for doors when they are opened.<br>
+
 
<br>
+
Each record is a 16x16(?) grid. Used to create a 3D map of the tile, for LOS.
mcd[08]-[19]:<br>
+
 
Loft of the tile. 12 values, each referances into loftemps.dat file.<br>
+
'''20-21:''' Referance into [[SCANG.DAT]] file. [20] + [21] * 256 + 35 = offset. Used for top-down map.
Each record is a 16x16(?) grid. Used to create a 3D map of the tile, for LOS.<br>
+
 
<br>
+
'''22-29:'''
mcd[20]-[21]:<br>
+
 
Referance into scang.dat file. [20] + [21] * 256 + 35 = offset. Used for top down map.<br>
+
'''30:''' Boolean: Is sliding door?
<br>
+
 
mcd[22]-[29]:<br>
+
'''31:''' Boolean: Can't be seen through?
*UNKNOWN*<br>
+
 
<br>
+
'''32:''' Boolean: Can't be stood on?
mcd[30]: Sliding door?                   (0 for false, 1 for true?)<br>
+
 
mcd[31]: Can be seen through?           (1 for false, 0 for true?)<br>
+
'''33:''' Boolean: Is impassable? (Used for objects)
mcd[32]: Cannot be stood on?             (0 for false, 1 for true?)<br>
+
 
mcd[33]: Impassable? (Used for objects). (0 for false, 1 for true?)<br>
+
'''34:''' Boolean: Is a Grav lift?
mcd[34]: Grav lift?                     (0 for false, 1 for true?)<br>
+
 
mcd[35]: Hinged door?                   (0 for false, 1 for true?)<br>
+
'''35:''' Boolean: Is a hinged door?
mcd[36]: Blocks fire?                   (0 for false, 1 for true?)<br>
+
 
mcd[37]: Blocks smoke?                   (0 for false, 1 for true?)<br>
+
'''36:''' Boolean: Blocks fire?
mcd[38]: *UNKNOWN*<br>
+
 
mcd[39]: Time units used to walk across the tile. 255 means unpassable.<br>
+
'''37:''' Boolean: Blocks smoke?
mcd[40]: Time units used to fly across the tile. 255 means unpassable.<br>
+
 
mcd[41]: Time units used to slide across the tile. 255 means unpassable. (Used for some aliens. Tanks?)<br>
+
'''38:'''
<br>
+
 
mcd[42]: <br>
+
'''39:''' Time units used to walk across the tile. (255 means unpassable)
Armor of tile. Tile must take this amount of damage to be destroyed (in a single<br>
+
 
blast). Tile will then change to mcd[44]. Assume 255 is indestructable?<br>
+
'''40:''' Time units used to fly across the tile. (255 means unpassable)
I suppose you could make a gate out of this, by creating two tiles, each<br>
+
 
easily destroyed, which change to the other when hit. One could be walked<br>
+
'''41:''' Time units used to slide across the tile. (255 means unpassable) (Used for some aliens. Tanks?)
across, the other could not.<br>
+
 
<br>
+
'''42:''' Armor of tile. Tile must take this amount of damage to be destroyed (in a single
mcd[43]: Explosive blockage. Unsure of what different values do; blocks explosive effects.<br>
+
blast). Tile will then change to mcd[44]. (255 Indestructable!)
mcd[44]: Tile becomes a tile of this type when destroyed. See mcd[42].<br>
+
''Note:'' I suppose you could make a gate out of this, by creating two tiles, each
mcd[45]: The higher this is, the less likely the tile will be set on fire.<br>
+
easily destroyed, which change to the other when hit. One could be walked
mcd[46]: If the tile is a door, the tile will become this tile number when opened.<br>
+
across, the other could not.
mcd[47]: *UNKNOWN*<br>
+
 
mcd[48]: Signed value; add this to the y offset of units when on this tile.<br>
+
'''43:''' HE Blockage.
mcd[49]: Subtract this value from the y offset of the tile image.<br>
+
 
mcd[50]: *UNKNOWN*<br>
+
'''44:''' Tile becomes a tile of this type when destroyed.
mcd[51]: From 0 to 10, amount of light blocked by tile. (Not sure if 0 or 10 is 'transparent').<br>
+
 
mcd[52]: Footstep sound effect to use when walking (as opposed to flying or sliding) across tile.<br>
+
'''45:''' The higher this is, the less likely the tile will be set on fire.
<br>
+
 
mcd[53]:<br>
+
'''46:''' If the tile is a door, the tile will become this tile number when opened.
Tile type.<br>
+
 
0 - Floor<br>
+
'''47:'''
1 - West Wall<br>
+
 
2 - North Wall<br>
+
'''48:''' Signed value; add this to the y offset of units when on this tile.
3 - Object<br>
+
 
Always assume destroyed tiles and opened tiles match original tile types?<br>
+
'''49:''' Subtract this value from the y offset of the tile image.
<br>
+
 
mcd[54]: Explosive type. 0 for HE, 1 for smoke.<br>
+
'''50:'''
mcd[55]: Strength of explosion when tile is destroyed. 0 for none.<br>
+
 
mcd[56]: Could be amount of smoke blocked by tile?<br>
+
'''51:''' From 0 to 10, amount of light blocked by tile.
mcd[57]: The amount of turns this tile will burn for. (Used when tile is destroyed?)<br>
+
  0 Blocks no light.
mcd[58]: Brightness of tile. Amount of light produced.<br>
+
''... up to ...''
<br>
+
10 Blocks all light.
mcd[59]:<br>
+
 
Special properties of tile.<br>
+
'''52:''' Footstep sound effect.
1 - Starting Point<br>
+
 
(Other values unknown, check DiaShiva's viewer for the rest.)<br>
+
'''53:''' Tile type:
<br>
+
0 Floor
mcd[60]: *UNKNOWN*<br>
+
1 West Wall
mcd[61]: *UNKNOWN*<br>
+
2 North Wall
<br>
+
3 Object
 +
Always assume destroyed tiles and opened tiles match original tile types?
 +
 
 +
'''54:''' Explosive type:
 +
0 HE
 +
1 Smoke
 +
 
 +
'''55:''' Strength of explosion when tile is destroyed.
 +
 
 +
'''56:''' Smoke blockage.
 +
 
 +
'''57:''' The amount of turns this tile will burn for.
 +
 
 +
'''58:''' Brightness of tile. Amount of light produced.
 +
 
 +
'''59:''' Special properties of tile:
 +
  0 ''No Special Properties''
 +
  1 Starting Point
 +
  2 Power Supply
 +
  3 Destroy Objective
 +
  7 Alien Entertainment
 +
10 Alien Alloy
 +
12 Dead Tile
 +
13 End Point
 +
14 Alien Brain
 +
 
 +
'''60:'''
 +
 
 +
'''61:'''
  
 
== PCK / TAB ==
 
== PCK / TAB ==

Revision as of 13:08, 3 November 2005

This folder contains the information used for tiles in the battlescape view, both statistical and graphical.

Each of the three files used for each tileset contains a variable amount of records. PCK files and their respective TAB files should always contain an equal amount of records.

Structure

Files made up of a variable amount of records, each of 62 bytes.

Things to search for: - Stun caused by explosion.

0-7: Animation of the tile.

The second four bytes always seems to be a copy of the first four bytes. This animation only works for doors when they are opened.

8-19: Loft of the tile. 12 values, each references into LOFTEMPS.DAT file.

Each record is a 16x16(?) grid. Used to create a 3D map of the tile, for LOS.

20-21: Referance into SCANG.DAT file. [20] + [21] * 256 + 35 = offset. Used for top-down map.

22-29:

30: Boolean: Is sliding door?

31: Boolean: Can't be seen through?

32: Boolean: Can't be stood on?

33: Boolean: Is impassable? (Used for objects)

34: Boolean: Is a Grav lift?

35: Boolean: Is a hinged door?

36: Boolean: Blocks fire?

37: Boolean: Blocks smoke?

38:

39: Time units used to walk across the tile. (255 means unpassable)

40: Time units used to fly across the tile. (255 means unpassable)

41: Time units used to slide across the tile. (255 means unpassable) (Used for some aliens. Tanks?)

42: Armor of tile. Tile must take this amount of damage to be destroyed (in a single blast). Tile will then change to mcd[44]. (255 Indestructable!) Note: I suppose you could make a gate out of this, by creating two tiles, each easily destroyed, which change to the other when hit. One could be walked across, the other could not.

43: HE Blockage.

44: Tile becomes a tile of this type when destroyed.

45: The higher this is, the less likely the tile will be set on fire.

46: If the tile is a door, the tile will become this tile number when opened.

47:

48: Signed value; add this to the y offset of units when on this tile.

49: Subtract this value from the y offset of the tile image.

50:

51: From 0 to 10, amount of light blocked by tile.

 0 Blocks no light.
... up to ...
10 Blocks all light.

52: Footstep sound effect.

53: Tile type:

0 Floor
1 West Wall
2 North Wall
3 Object

Always assume destroyed tiles and opened tiles match original tile types?

54: Explosive type:

0 HE
1 Smoke

55: Strength of explosion when tile is destroyed.

56: Smoke blockage.

57: The amount of turns this tile will burn for.

58: Brightness of tile. Amount of light produced.

59: Special properties of tile:

 0 No Special Properties
 1 Starting Point
 2 Power Supply
 3 Destroy Objective
 7 Alien Entertainment
10 Alien Alloy
12 Dead Tile
13 End Point
14 Alien Brain

60:

61:

PCK / TAB

Graphical tile data. The TAB file is made up of two byte values, each stating the starting offset of the respective graphic in the PCK file.

PCK decoding is fairly simple: the first byte in the data stream tells you how many rows you should skip. Then you just draw each byte afterwards directly onto the screen (which should be using a 256 color palette).

Values 254/255 are not to be drawn. If you encounter a byte with a value of 254 (FE), then the next byte tells you how many pixils you should skip. If you encounter a byte with a value of 255 (FF), then you're done.

While simplistic, I've found that the best way to use PCK files is to store them 'as is', then decode them straight onto the screen as needed (as opposed to pre-rendering them and storing the completed graphics in memory). This makes lighting effects that much easier to implement.