home *** CD-ROM | disk | FTP | other *** search
/ Tactical Operations 1 / TACTICAL.BIN / command / hint / format.txt < prev    next >
Encoding:
Text File  |  1996-07-08  |  8.9 KB  |  278 lines

  1. This document is an attempt to put what I have learn of the
  2. various data structures used in the Command and Conquer file
  3. 'game.dat' so that other people can create editors for this
  4. game as well.
  5.  
  6. The areas I focussed on when creating my editor (ccedit) were:
  7. buildings, infantry and vehicles. I found out after I started
  8. that there were 2 (at least) classes of vehicles: aircraft
  9. and land vehicles. This means that there are at least 4 different
  10. data structures used that I have some knowledge about (there
  11. are undoubtably lots more used, but I don't know what they are).
  12.  
  13. I will use the terminology 'entry' to describe the fields in
  14. the data structures, simply because I don't have a complete account
  15. of the entire data structures used, so I will be using one entry
  16. as a landmark to point to others.
  17.  
  18. PART 1: DETERMINING THE ENTRY SIZE
  19. ----------------------------------
  20. One thing that makes editing these data structures difficult is that
  21. they can be of different sizes within the file. There is a way to
  22. work out the size of an entry however. It will only ever be either
  23. a 1 byte value or a 4 byte value. The way to find out which it will
  24. be is to look at the byte directly before it. If the value is 0x6a,
  25. then the next entry will be a single byte. If the value is 0x68, then
  26. the next entry will be 4 bytes long.
  27.  
  28. The values stored here are signed values.
  29.  
  30. The differences in entry size usually occur in entries dealing with
  31. hit points, and occasionally cost. Most of the time when dealing with
  32. vehicles, the hit points are stored as a 4 byte value, but for some of
  33. them, they are stored as a single byte value (which is why I classified
  34. things as being light and heavy in my editor).
  35.  
  36. I may be possible to change the size of the game.dat file to convert a
  37. single byte value to a 4 byte value, but as this file is an executable
  38. file, I don't know what effect this would have (its probably not worth
  39. the bother).
  40.  
  41. PART 2: REACHING THE END OF A STRUCTURE
  42. ---------------------------------------
  43. You can tell when you reach the end of one complete structure when you
  44. come across the value 0x81 then 0xc4. I think the value after these
  45. two reflects what type of data structure it is (whether aircraft, vehicle,
  46. etc).
  47.  
  48. PART 3: AIRCRAFT STRUCTURE
  49. --------------------------
  50. There are 5 apparent aircraft. They are (in order of their appearance in
  51. the game.dat file): A-10, Chinook, Apache, Orca, and (I think) the
  52. transport plane.
  53.  
  54. To give you a hint, the speed for the A-10 is at offset 0x667c8 (in the
  55. 1.18p English version of Command and Conquer).
  56.  
  57. The aircraft data stucture is:
  58. entry        use
  59. ----------------
  60. 1            ?
  61. 2            ?
  62. 3            speed
  63. 4            armour
  64. 5            secondary weapon
  65. 6            primary weapon
  66. 7            owner
  67. 8            ?
  68. 9            ?
  69. 10           ?
  70. 11           cost
  71. 12           visual radius
  72. 13           hit points
  73. 14           number of shots
  74. 15           ?
  75. 16           ?
  76. 17           ?
  77. 18           ?
  78. 19           invulnerability
  79. 20           ?
  80. 21           ?
  81. 22           ?
  82. 23           ?
  83. 24           ?
  84. 25           ?
  85. 26           ?
  86. 27           gives it a set of rotor blades
  87. 28           no wait between attacks; but can't fly (for orcas). Obviously             used for the A-10's
  88. 29           transport ability (stuffs up graphics for apaches)
  89. 30           ?
  90. 31           ?
  91.  
  92. There are a couple of other after this. One of the unknown entries between
  93. 14 and 31 has to do with giving that unit an additional rotor blade (which
  94. turns around in the opposite direction). The rotor blade is actually just
  95. a little animation that the aircraft can access (they are like the turrets
  96. on the tanks).
  97.  
  98. PART 4: BUILDING STRUCTURE
  99. --------------------------
  100. There are a number of structures in the file, but I never bothered with the
  101. ones you cannot build. The others would undoubtably have the same format
  102. (roughly) as these.
  103.  
  104. To give you a hint, the power required for the Temple of Nod is at offset
  105. 0x6defa (in the 1.18p English version of Command and Conquer).
  106.  
  107. The building data structure is:
  108. entry        use
  109. ----------------
  110. 1            ?
  111. 2            ?
  112. 3            ?
  113. 4            ?
  114. 5            power required
  115. 6            power produced
  116. 7            ?
  117. 8            ?
  118. 9            ?
  119. 10           secondary weapon
  120. 11           primary weapon
  121. 12           owner
  122. 13           ?
  123. 14           ?
  124. 15           ?
  125. 16           cost
  126. 17           visual radius (I think)
  127. 18           hit points
  128. 19           ?
  129. 20           what this structure can build (8 = construction yard; 6 =
  130.              helicopters; 4 = vehicles [may need to set an extra entry to
  131.              get this to work properly]; 2 = infantry)
  132. 21           ?
  133. 22           ?
  134. 23           ?
  135. 24           ?
  136. 25           fires weapons twice
  137. 26           ? (may have to do with the SAM site's pop-up graphics)
  138. 27           graphics for that building are not shown (not cloaked, just
  139.              not drawn)
  140. 28           invulnerability
  141. 29           ?
  142. 30           ?
  143. 31           ?
  144. 32           ?
  145. 33           ?
  146. 34           ?
  147. 35           ?
  148. 36           ?
  149. 37           ? (couldn't deploy it anywhere)
  150. 38           ?
  151. 39           ?
  152. 40           ?
  153.  
  154. There are some others after this.
  155.  
  156. PART 5: VEHICLE STRUCTURE
  157. -------------------------
  158. The order of the vehicles in this section of the file is: viceroid, flame
  159. tank, stealth tank, light tank, medium tank, mammoth tank, hovercraft,
  160. mobile HQ, SSM, artillery, harvester, MCV, humm-vee, buggy, bike, rocket
  161. launcher, APC, boat, triceratops, t-rex, 'raptor, and stegasaurus.
  162.  
  163. To give you a hint, the armour for the viceroid is at offset 0xde22e (in
  164. the 1.18p English version of Command and Conquer).
  165.  
  166. The vehicles structure is:
  167. entry        use
  168. ----------------
  169. 1            ?
  170. 2            ?
  171. 3            ?
  172. 4            speed
  173. 5            ?
  174. 6            ?
  175. 7            secondary weapon
  176. 8            primary weapon
  177. 9            owner
  178. 10           ?
  179. 11           ?
  180. 12           ?
  181. 13           cost
  182. 14           visual radius
  183. 15           hit points
  184. 16           ?
  185. 17           cycles through all that units graphics (used for the viceroid)
  186. 18           stealth
  187. 19           ? got rid of the turret on the medium tank
  188. 20           ?
  189. 21           ?
  190. 22           ?
  191. 23           ?
  192. 24           (what I was talking about in the aircraft section - this gives
  193.              a tank 2 turrets rotating in opposite directions)
  194. 25           ?
  195. 26           ?
  196. 27           ?
  197. 28           fires its weapons twice
  198. 29           ?
  199. 30           invulnerability
  200. 31           ?
  201. 32           ?
  202. 33           ?
  203. 34           ?
  204. 35           can harvest tiberium (can't go into the refinery is this
  205.              is set by itself)
  206. 36           ?
  207. 37           ?
  208. 38           transport (but can't carry infantry if set by itself)
  209. 39           ?
  210. 40           doesn't display the graphics for that unit (set to ON by
  211.              default for the dinosaurs)
  212. 41           ?
  213. 42           ?
  214. 43           ?
  215.  
  216. There are some other entries after these.
  217.  
  218. PART 6: INFANTRY STRUCTURE
  219. --------------------------
  220. This section is definitely the hardest. I have almost no knowledge about
  221. what this data structure is. It was just luck that  found this in the
  222. first place.
  223.  
  224. To give you a hint, the weapon for the mnigunner is at offset 0x96fac (in
  225. the 1.18p English version of Command and Conquer).
  226.  
  227. entry        use
  228. ----------------
  229. 1            ?
  230. 2            secondary weapon
  231. 3            primary weapon
  232. 4            owner
  233. 5            ?
  234. 6            ?
  235. 7            ?
  236. 8            cost
  237. 9            visual radius
  238. 10           HP
  239.  
  240. There are many more entries after this one, but I have no idea what
  241. they do.
  242.  
  243. I tried looking for things like invulnerability, but couldn't find it.
  244.  
  245. Andrew Griffin
  246.  
  247. ========================================================================
  248. ======================= end of document ================================
  249. ========================================================================
  250.  
  251. This next section is an extremly brief note about how to work out the
  252. addresses on the internal files in the .mix files used in Command and
  253. Conquer.
  254.  
  255. The first part of the file contains the information you need to be able
  256. to work out how many internal files there are, where they are, and how
  257. large they are.
  258.  
  259. The format of this header information is:
  260. short int    number of internal files (I'll refer to this as N)
  261. long int     size of file - modifier
  262.  
  263. [modifier = N*12 + 6]
  264. Then for each of the N internal files, you have the following entry
  265. information:
  266. short int    ?? unknown ??
  267. short int    ?? unknown ??
  268. long int     offset in file - modifier
  269. long int     length of internal file
  270.  
  271. [this information is thanks to Jens Mueller]
  272.  
  273. With regard to the general.mix file (that is the file which contains all
  274. the mission information, you can tell which internal files are the map
  275. entries by their size. Each map has a size of 0x2000.
  276.  
  277. Andrew Griffin
  278.