BPROD.DAT

From UFOpaedia
Revision as of 21:46, 15 January 2007 by Pi Masta (talk | contribs) (Initial Draft)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The BPROD.DAT file holds information on the current progress of what is being manufactured. It is a whopping (compared to other dat files) 2800 bytes. Essentially it holds information for each of your bases and for each item that can be produced. Each item gets 10 bytes (8 bases * 35 producible items * 10 bytes = 2800), however the format of this file seems a bit sideways (to me atleast). The best 'line width' to come up with is 350, 1 line for each base.

Inside of those 350 bytes it is divided into to 4 sections:

  • Hours Stored (Long Integer 4 Bytes)- always lower (possibly equal see below) than the engineering hours needed to make one. It is the remainder when the amount of hours spent does not evenly divide into the time it takes to make the product. However setting this value to 0 will remove the production and place it back into the new production list, be see note below.
  • Engineers Allocated (Integer 2 Bytes) - how many engineers are allocated to making this product
  • Total to Produce (Integer 2 Bytes) - the number of these items to make
  • Units Produced (Integer 2 Bytes) - the number of these itesm to make.

NOTE: Normally when a project is complete all the values for it are set to 0. Only the 'Hours Stored' controls if it is shown as being produced or available for a new production. If a production is hacked to 0, before it is done, the engineers are still allocated to it. You will be unable to get these engineers back until you create the same project they were working on again, note that they still take up space in the workshop, so you might not be able to create that project again.

The amount of hours stored can equal the amount required, as is the case when you start a new project (along with the total to produce set 1 higher). This is why you can sometimes see 0/0 Days/Hours Left if you meet it exactly. The next hour should increment and allow the project to be finished.

Each of these 4 sections list all of the items that can be produced before going on to the next section. The order they are place corresponds to the record in PRODUCT.DAT. So byte 0 is hours completed for a Fusion Ball Launcher, byte 4 is hours completed for Laser Cannon, byte 8 is hours completed for a Plasma Beam, and so on. Finally at byte 140 (4 bytes * 35 items) we get the engineers allocated to the Fusion Ball Launcher. (All at the first base)

Rough Outline

Here is a rough outline of the format of the file, divided up into 350 byte chunks (each corresponds to a base). The order follows that of PRODUCT.DAT inside these chunks. All addresses are in decimal unless prefixed by 0x

000 - 136 : Hours stored for each item (4 bytes each)
140 - 208 : Engineers allocated to each item (2 bytes each)
210 - 278 : Total to produce for each item (2 bytes each)
280 - 348 : Units produced for each item (2 bytes each)

More Detailed

I used a python script to generate a more verbose listing of the addressing in this file, as it is rather tedious.

Stored Hours

  0 / 0x0  (4 Bytes) : Fusion Ball Launcher
  4 / 0x4  (4 Bytes) : Laser Cannon
  8 / 0x8  (4 Bytes) : Plasma Beam
 12 / 0xc  (4 Bytes) : Fusion Ball
 16 / 0x10 (4 Bytes) : Tank/Laser Cannon
 20 / 0x14 (4 Bytes) : Hovertank/Plasma
 24 / 0x18 (4 Bytes) : Hovertank/Launcher
 28 / 0x1c (4 Bytes) : HWP Fusion Bomb
 32 / 0x20 (4 Bytes) : Laser Pistol
 36 / 0x24 (4 Bytes) : Laser Rifle
 40 / 0x28 (4 Bytes) : Heavy Laser
 44 / 0x2c (4 Bytes) : Motion Scanner
 48 / 0x30 (4 Bytes) : Medi-kit
 52 / 0x34 (4 Bytes) : Psi-Amp
 56 / 0x38 (4 Bytes) : Heavy Plasma
 60 / 0x3c (4 Bytes) : Heavy Plasma Clip
 64 / 0x40 (4 Bytes) : Plasma Rifle
 68 / 0x44 (4 Bytes) : Plasma Rifle Clip
 72 / 0x48 (4 Bytes) : Plasma Pistol
 76 / 0x4c (4 Bytes) : Plasma Pistol Clip
 80 / 0x50 (4 Bytes) : Blaster Launcher
 84 / 0x54 (4 Bytes) : Blaster Bomb
 88 / 0x58 (4 Bytes) : Small Launcher
 92 / 0x5c (4 Bytes) : Stun Bomb
 96 / 0x60 (4 Bytes) : Alien Grenade
100 / 0x64 (4 Bytes) : Mind Probe
104 / 0x68 (4 Bytes) : Personal Armour
108 / 0x6c (4 Bytes) : Power Suit
112 / 0x70 (4 Bytes) : Flying Suit
116 / 0x74 (4 Bytes) : Alien Alloys
120 / 0x78 (4 Bytes) : UFO Power Source
124 / 0x7c (4 Bytes) : UFO Navigation
128 / 0x80 (4 Bytes) : FIRESTORM
132 / 0x84 (4 Bytes) : LIGHTNING
136 / 0x88 (4 Bytes) : AVENGER

Engineers Allocated

140 / 0x8c (2 Bytes) : Fusion Ball Launcher
142 / 0x8e (2 Bytes) : Laser Cannon
144 / 0x90 (2 Bytes) : Plasma Beam
146 / 0x92 (2 Bytes) : Fusion Ball
148 / 0x94 (2 Bytes) : Tank/Laser Cannon
150 / 0x96 (2 Bytes) : Hovertank/Plasma
152 / 0x98 (2 Bytes) : Hovertank/Launcher
154 / 0x9a (2 Bytes) : HWP Fusion Bomb
156 / 0x9c (2 Bytes) : Laser Pistol
158 / 0x9e (2 Bytes) : Laser Rifle
160 / 0xa0 (2 Bytes) : Heavy Laser
162 / 0xa2 (2 Bytes) : Motion Scanner
164 / 0xa4 (2 Bytes) : Medi-kit
166 / 0xa6 (2 Bytes) : Psi-Amp
168 / 0xa8 (2 Bytes) : Heavy Plasma
170 / 0xaa (2 Bytes) : Heavy Plasma Clip
172 / 0xac (2 Bytes) : Plasma Rifle
174 / 0xae (2 Bytes) : Plasma Rifle Clip
176 / 0xb0 (2 Bytes) : Plasma Pistol
178 / 0xb2 (2 Bytes) : Plasma Pistol Clip
180 / 0xb4 (2 Bytes) : Blaster Launcher
182 / 0xb6 (2 Bytes) : Blaster Bomb
184 / 0xb8 (2 Bytes) : Small Launcher
186 / 0xba (2 Bytes) : Stun Bomb
188 / 0xbc (2 Bytes) : Alien Grenade
190 / 0xbe (2 Bytes) : Mind Probe
192 / 0xc0 (2 Bytes) : Personal Armour
194 / 0xc2 (2 Bytes) : Power Suit
196 / 0xc4 (2 Bytes) : Flying Suit
198 / 0xc6 (2 Bytes) : Alien Alloys
200 / 0xc8 (2 Bytes) : UFO Power Source
202 / 0xca (2 Bytes) : UFO Navigation
204 / 0xcc (2 Bytes) : FIRESTORM
206 / 0xce (2 Bytes) : LIGHTNING
208 / 0xd0 (2 Bytes) : AVENGER

Total to Produce

210 / 0xd2  (2 Bytes) : Fusion Ball Launcher
212 / 0xd4  (2 Bytes) : Laser Cannon
214 / 0xd6  (2 Bytes) : Plasma Beam
216 / 0xd8  (2 Bytes) : Fusion Ball
218 / 0xda  (2 Bytes) : Tank/Laser Cannon
220 / 0xdc  (2 Bytes) : Hovertank/Plasma
222 / 0xde  (2 Bytes) : Hovertank/Launcher
224 / 0xe0  (2 Bytes) : HWP Fusion Bomb
226 / 0xe2  (2 Bytes) : Laser Pistol
228 / 0xe4  (2 Bytes) : Laser Rifle
230 / 0xe6  (2 Bytes) : Heavy Laser
232 / 0xe8  (2 Bytes) : Motion Scanner
234 / 0xea  (2 Bytes) : Medi-kit
236 / 0xec  (2 Bytes) : Psi-Amp
238 / 0xee  (2 Bytes) : Heavy Plasma
240 / 0xf0  (2 Bytes) : Heavy Plasma Clip
242 / 0xf2  (2 Bytes) : Plasma Rifle
244 / 0xf4  (2 Bytes) : Plasma Rifle Clip
246 / 0xf6  (2 Bytes) : Plasma Pistol
248 / 0xf8  (2 Bytes) : Plasma Pistol Clip
250 / 0xfa  (2 Bytes) : Blaster Launcher
252 / 0xfc  (2 Bytes) : Blaster Bomb
254 / 0xfe  (2 Bytes) : Small Launcher
256 / 0x100 (2 Bytes) : Stun Bomb
258 / 0x102 (2 Bytes) : Alien Grenade
260 / 0x104 (2 Bytes) : Mind Probe
262 / 0x106 (2 Bytes) : Personal Armour
264 / 0x108 (2 Bytes) : Power Suit
266 / 0x10a (2 Bytes) : Flying Suit
268 / 0x10c (2 Bytes) : Alien Alloys
270 / 0x10e (2 Bytes) : UFO Power Source
272 / 0x110 (2 Bytes) : UFO Navigation
274 / 0x112 (2 Bytes) : FIRESTORM
276 / 0x114 (2 Bytes) : LIGHTNING
278 / 0x116 (2 Bytes) : AVENGER

Units Produced

280 / 0x118 (2 Bytes) : Fusion Ball Launcher
282 / 0x11a (2 Bytes) : Laser Cannon
284 / 0x11c (2 Bytes) : Plasma Beam
286 / 0x11e (2 Bytes) : Fusion Ball
288 / 0x120 (2 Bytes) : Tank/Laser Cannon
290 / 0x122 (2 Bytes) : Hovertank/Plasma
292 / 0x124 (2 Bytes) : Hovertank/Launcher
294 / 0x126 (2 Bytes) : HWP Fusion Bomb
296 / 0x128 (2 Bytes) : Laser Pistol
298 / 0x12a (2 Bytes) : Laser Rifle
300 / 0x12c (2 Bytes) : Heavy Laser
302 / 0x12e (2 Bytes) : Motion Scanner
304 / 0x130 (2 Bytes) : Medi-kit
306 / 0x132 (2 Bytes) : Psi-Amp
308 / 0x134 (2 Bytes) : Heavy Plasma
310 / 0x136 (2 Bytes) : Heavy Plasma Clip
312 / 0x138 (2 Bytes) : Plasma Rifle
314 / 0x13a (2 Bytes) : Plasma Rifle Clip
316 / 0x13c (2 Bytes) : Plasma Pistol
318 / 0x13e (2 Bytes) : Plasma Pistol Clip
320 / 0x140 (2 Bytes) : Blaster Launcher
322 / 0x142 (2 Bytes) : Blaster Bomb
324 / 0x144 (2 Bytes) : Small Launcher
326 / 0x146 (2 Bytes) : Stun Bomb
328 / 0x148 (2 Bytes) : Alien Grenade
330 / 0x14a (2 Bytes) : Mind Probe
332 / 0x14c (2 Bytes) : Personal Armour
334 / 0x14e (2 Bytes) : Power Suit
336 / 0x150 (2 Bytes) : Flying Suit
338 / 0x152 (2 Bytes) : Alien Alloys
340 / 0x154 (2 Bytes) : UFO Power Source
342 / 0x156 (2 Bytes) : UFO Navigation
344 / 0x158 (2 Bytes) : FIRESTORM
346 / 0x15a (2 Bytes) : LIGHTNING
348 / 0x15c (2 Bytes) : AVENGER