Author Topic: Battle script (SCENE.BIN) + more  (Read 12985 times)

Cyberman

  • No life
  • *
  • Posts: 1575
  • Karma: 8
    • View Profile
Battle script (SCENE.BIN) + more
« on: 2007-01-17 18:38:09 »
Right so I was wandering through the wiki (examining the data on SCENE.BIN) and wondered about the battle scripting and discovered a nice add link for it.  Is this the same code format as the regular field script or is it an entirely different beast? I suspect the later however I could be wrong.  I am pretty sure that the script has things such as dialog etc.  (well duh anyhow).
SCENE.BIN is very interesting so I'm studying.  I my as well start work on the battle part of the engine (it's what I'm most familiar with in any case).
So .. summary
scripting for battles? Is it the same as the rest of the engine or different? What about dialog in battles? Opcodes?

Also it's been batted around a lot, the scripting system in general is the next quesiton (Querry?)

There appear to be 2 ways to really go with it.
The first is psuedo functional language with proper clauses etc for instituting neatness. This would make it look more like PASCAL or C in terms of appearance (TCL perhaps). 

The second is go with the code. IE just use the current opcode names and make it more of an ASSEMBLER level scripting support than anything.  I suggest the very least is to bracket an entire script with BEGINP and ENDP if this is the route.  This helps to organize things visually at the very least.  I'm speaking from a script dump point of view.  This is obviously easiest to do.

One issue is that the scripts operate in paraellel, so do we understand how this works.  I remember talking about it is all.  Nothing is in the wiki so I must assume we never concluded much.

As for events in the field script I have some thoughts.  The first one is by default the initiation script for all field entities.  So I recomend this event be called, Start or Init.  Even though it's called regularly I think.  Do scripts get run periodically and if so how are they queued for periodic (IE timed) execution?  The animation in  field locations I suspect are controled by this correct? (IE a script runs the animation and can turn it on or off etc.)

Cyb

Synergy Blades

  • Guest
Re: Battle script (SCENE.BIN) + more
« Reply #1 on: 2007-01-17 19:47:40 »
Head here: http://db.gamefaqs.com/console/psx/file/final_fantasy_vii_enemy_mech.txt for Terence's guide to enemy AI. Totally different scripting language, I think, but he would know since he's detailed the workings of every enemy AI in there...  :-)

Field scripting: Meteor's headed for the first of your choices as you probably know, but I'm abstracting away some stuff, making it pretty (variable assignments, possibly introducing for/while control structures). When I get more time on it (busy with university, atm) I'll probably formalise the (semi-)final language and I don't mind sharing a lexer/parser if I make one. For any other script needs, if you don't fancy using that, just make your output whatever you fancy I guess, depending on whether you're going for byte-for-byte output, or making it pretty in some way. Anyone that's familiar with field script will probably be able to use whichever scripting tool they pick up.

As far as execution, I'd assumed they all execute in parallel, yeah; each initialisation script is called just the once upon loading up. I detailed in this thread: http://forums.qhimm.com/index.php?topic=6284.0 how the different script entries are executed if it's a visible object, but generally they only run the once (unless there's jumps in place to make it run ad infinitum). As I said, if it's a visible entity, certain scripts are triggered in a manner that depends on which script entry it is located in. Animations are general scripts that are looped repeatedly.

Akari

  • Moderator
  • Freak
  • *
  • Posts: 761
  • Karma: 26
    • View Profile
Re: Battle script (SCENE.BIN) + more
« Reply #2 on: 2007-01-18 05:35:25 »
Right so I was wandering through the wiki (examining the data on SCENE.BIN) and wondered about the battle scripting and discovered a nice add link for it.  Is this the same code format as the regular field script or is it an entirely different beast? I suspect the later however I could be wrong.  I am pretty sure that the script has things such as dialog etc.  (well duh anyhow).
SCENE.BIN is very interesting so I'm studying.  I my as well start work on the battle part of the engine (it's what I'm most familiar with in any case).
So .. summary
scripting for battles? Is it the same as the rest of the engine or different? What about dialog in battles? Opcodes?

Also it's been batted around a lot, the scripting system in general is the next quesiton (Querry?)

I was working on scene.bin lately. there are a lot of information missing or spread through topics.
Info about battle scripting opcodes are here http://forums.qhimm.com/index.php?topic=3290.0 With this I manage reproduce Terence's script. But the form of script in final_fantasy_vii_enemy_mech.txt are greatly differs from the real one. It's not readable at all %)

Quote
There appear to be 2 ways to really go with it.
The first is psuedo functional language with proper clauses etc for instituting neatness. This would make it look more like PASCAL or C in terms of appearance (TCL perhaps). 

The second is go with the code. IE just use the current opcode names and make it more of an ASSEMBLER level scripting support than anything.  I suggest the very least is to bracket an entire script with BEGINP and ENDP if this is the route.  This helps to organize things visually at the very least.  I'm speaking from a script dump point of view.  This is obviously easiest to do.

I think script should be handled as byte-code internally. This is the natural way how it was designed and how it worked, BUT for our own scripts we must use readable thing like C-like style for field scrypt (I think it must work directly with Meteor format) and Terence Fergusson's style for battle... something like

Code: [Select]
AI: Main
{
   If (1/3 Chance) Then {
      If (At Least One Opponent is in Back Row) Then
      {
         Choose Random Opponent in Back Row
      } Else {
         Choose Random Opponent with Lowest HP
      }
      TempVar:ChosenAtt = Tentacle
   } Else {
      If (At Least One Opponent is in Front Row) Then
      {
         Choose Random Opponent in Front Row
      } Else {
         Choose Random Opponent with Lowest HP
      }
      TempVar:ChosenAtt = <Bite>
   }
   Use TempVar:ChosenAtt on Target
}

The first of all I think you should gather as much info as posible through forums and add this to wiki. Because a lot part from scene.bin description missing. (manipulatable or not enemy is, how it status imunity defined and so on)

Cyberman

  • No life
  • *
  • Posts: 1575
  • Karma: 8
    • View Profile
Re: Battle script (SCENE.BIN) + more
« Reply #3 on: 2007-01-18 20:53:27 »
I was working on scene.bin lately. there are a lot of information missing or spread through topics.
Info about battle scripting opcodes are here http://forums.qhimm.com/index.php?topic=3290.0 With this I manage reproduce Terence's script. But the form of script in final_fantasy_vii_enemy_mech.txt are greatly differs from the real one. It's not readable at all %)
Ditto Akari. I've been twiddling with it myself.  I realized why they made it in such an odd format suddenly.  First in the world map they must use a hash table of some sort to figure what chunks to load into the main memory and decompress them on demand.  It's actually quite an interesting way of handling the problem.  What I plan on doing is sorting through the entire file and finding which battles have big AI scripting.  As for the game itself, I think we probably will need to abstract the SCENE.BIN access (which is likely what they did in FF7), and use an overloaded array operator to load/unload battle sections as memory permits.  I somehow found myself writting a battle class for the data already. (sigh)
What are you reproducing the battle scripting translation for the codes? Or something else? I'm not sure what you mean. He split his data up between 3 files on gamefaqs.
I think script should be handled as byte-code internally. This is the natural way how it was designed and how it worked, BUT for our own scripts we must use readable thing like C-like style for field scrypt (I think it must work directly with Meteor format) and Terence Fergusson's style for battle... something like
Mostly the later, but presenting(viewing) the original scripting in a readable manner might be helpful (extremely helpful) for finding bugs in the engine (which I'm sure there are at least a few).

The first of all I think you should gather as much info as posible through forums and add this to wiki. Because a lot part from scene.bin description missing. (manipulatable or not enemy is, how it status imunity defined and so on)
Hmmm I have terrance's long and detailed information on how it works but... it appears the combat/battle engine is rather complicated and I suspect the actual computation engine is not scripted (like most things in FF7) but hardcoded.  This means a lot of careful planning will be needed to figure out what to check and when to check it and what to do etc.  I read the first one and I am about 1/5th through the second.

As for the script codes in the battle system... hmmmm I will search the forums and update slowly.  Ehhh lots of tideous work.
Currently I plan on continuing my scene.bin view/unit it at least will provide information that will be useful later in the battle engine.

Cyb

Addendum

All right I've been looking at SCENE.BIN a lot lately.
I've concluded a few things,
the wiki data needeth much work. <-- Akari has noted that.
The best way to handle each battle scene data is a very tough nut to crack. So I've gone about the method of divide and conquer.  Enemy and Battle Scene data are seperate as well as the attacks. The format does not really lend to easy or simple access. It's a bit messy in other words.  So I split up the entire thing into several classes that work with each other.  It seemed directly accessing the data without said classes would be... insane (to be blunt).  There are also be problems realated to the probabilities calculations. So in a way this eleiminates bugs from being propagated irresponsibly.  For example the drop probability is handled (the way I have coded it) by the battle scene type.  Steal probability is calculated by it as well.  This is a better way that to cram it all in one big routine which is hard to look through and this means it's also likely poorly commented (like my code is ;) ).
the byte code data for the opcodes and battle AI ... this needs to be congeled and worked on as Akari noted it's a problem
I'm making a viewer using BCB but all the classes used for the low level part will be recyclable into Q-gears.. That seemes the most affective way to do this for me.

Cyb

Edit 3
I noticed the forum no longer makes modified messages new, interesting.  In any case does anyone know how to determine the SCENE.BIN block lengths? It's a bit of a problem since Square pads them with 0xFF and I believe that's leading to some weird errors in my SCENE.BIN dumping software. It's kind of really anoying to be truthful.  The FF's are copied straight to the buffer because of the bit fields they represent. Sure it's short but a burst of errors is not particularly what I want.  I have enough problems with my OWN errors instead of creating more. :D

Right now I subtract the end of the buffer (IE 8K) from the current buffer pointer reference for the first block this gives me 960 bytes.  Somehow this doesn't seem like a clean way to do this.  Can anyone think of a better way? Apart from analyzing the partially decoded block or something equally silly.
« Last Edit: 2007-01-21 00:46:31 by Cyberman »

The Skillster

  • No life
  • *
  • Posts: 2284
  • Karma: 3
  • Loving every Final Fantasy
    • View Profile
Re: Battle script (SCENE.BIN) + more
« Reply #4 on: 2007-01-21 12:00:47 »
If you want someone to test drive anything, please say so. I spent a good part of last January editing the scene.bin for my difficulty mod and stumbled on various enemy attack properties:
http://forums.qhimm.com/index.php?topic=4939.msg64476#msg64476

Cyberman

  • No life
  • *
  • Posts: 1575
  • Karma: 8
    • View Profile
Re: Battle script (SCENE.BIN) + more
« Reply #5 on: 2007-01-23 03:03:45 »
All right.. I've had little if any success to find the information in the wiki.
So If someone would peer at the data this thing spews out and tell me if it's off WAY off or kick me in the right direction. I'll stop wasting time. :D
Structure.

Column 1 shows Index. This is back filled to 0xFF because I had to have everything aligned as a consequence of the information looking like shear gibberish.
Column 2 hex data (woo)
Column 3 Printable ASCII data
Column 4 FF7 text view. If it has a bunch of FF's this section will appear white. Good fo noticing you reached the end of a file.

Apart from the initial structure information being correct thus far I've not found what is supposed to be in these records of data. That's a bit mysterious. So are there empty battles? IE files with no records or < 4?
This only works on SCENE.BIN anything else will get you a RAW dump of the data.  LZS files are the same. BSX files will give you a decompressed dump and FIELD.TDB will dump the textures into a nify image pane (second tab).
Because the data didn't meet expectations (IE it appears to be decoded wrong or something) I haven't bothered working on viewing the data like it would be in the 3rd pane.  So that about sums things up.

It's a small file unfortunately Yahoo Geocities no longer allows exe's zip's or Rar' files on there web pages. (Warez kiddies strike again?)
So.. hmmm I'll have to think of something I guess? :D

Cyb

gigaherz

  • Crazy poster
  • *
  • Posts: 105
  • Karma: 0
    • View Profile
    • gigaherz's shitty stuff
Re: Battle script (SCENE.BIN) + more
« Reply #6 on: 2007-01-23 17:12:40 »
You can try to upload it at sendspace... it's not a permament hosting but it works...

Salk

  • Insane poster
  • *
  • Posts: 459
  • Karma: 12
    • View Profile
Re: Battle script (SCENE.BIN) + more
« Reply #7 on: 2007-01-23 19:28:07 »
Cyberman,

I would suggest filefront (www.filefront.com) to upload your file!  :-)

Cyberman

  • No life
  • *
  • Posts: 1575
  • Karma: 8
    • View Profile
Re: Battle script (SCENE.BIN) + more
« Reply #8 on: 2007-01-23 21:32:35 »
Removed
Do Not download this if you aren't well informed about the SCENE.BIN format. Because all it will be is just weird looking and lack any usefullness.
This is PRE ALPHA software too. It's useless to really use it to do anything, unless you want to look at all the FIELD file people textures or something.

Side note on the TDB file, I think the BSX file must have the palette information, as well as the BCX files.  I think that is the only way for it to work.

I also have some interesting information reguarding FIELD.BIN this is the index file for the files in the ISO.  I'm going to do some work reguarding it sometime.

Cyb
« Last Edit: 2007-02-22 14:44:51 by Cyberman »

The Skillster

  • No life
  • *
  • Posts: 2284
  • Karma: 3
  • Loving every Final Fantasy
    • View Profile
Re: Battle script (SCENE.BIN) + more
« Reply #9 on: 2007-01-26 05:58:19 »
What runtime libraries do you need for this program, when I run it I get a message for some Borland DLL...

Akari

  • Moderator
  • Freak
  • *
  • Posts: 761
  • Karma: 26
    • View Profile
Re: Battle script (SCENE.BIN) + more
« Reply #10 on: 2007-01-26 09:15:47 »
What runtime libraries do you need for this program, when I run it I get a message for some Borland DLL...

http://www.dll-files.com/dllindex/dll-files.shtml?borlndmm

Cyberman

  • No life
  • *
  • Posts: 1575
  • Karma: 8
    • View Profile
Re: Battle script (SCENE.BIN) + more
« Reply #11 on: 2007-01-26 21:53:58 »
Ahhh poo I didn't check for that.  Sorry The Saint I pulled a Christian LOL.
It would be nice to have a virtual test system to check for stupid things like that.  Anyhow next time I'll make an installation package.
I thought I had covered all the bases but that one stinking DLL bites me everytime.  I never can figure how to get rid of that nusance.

Cyb

PS Thanks Akari.

PPS has anyone tested this yet? If so what is your opinion am I extracting the data correctly? It doesn't seem to have the right data in it at all so I've been quite puzzled. I used the data in the wiki for extraction.

gigaherz

  • Crazy poster
  • *
  • Posts: 105
  • Karma: 0
    • View Profile
    • gigaherz's shitty stuff
Re: Battle script (SCENE.BIN) + more
« Reply #12 on: 2007-01-27 02:50:01 »
Get vmware, virtualpc or qemu, install some XP on it, and you will have a nice virtual machine to test things on... :P

I tried it but as I'm clueless on the data is should have, I can't tell. :/

Cyberman

  • No life
  • *
  • Posts: 1575
  • Karma: 8
    • View Profile
Re: Battle script (SCENE.BIN) + more
« Reply #13 on: 2007-01-27 04:32:41 »
I've also updated it muchly including a FF7 symbol set viewing code.
I didn't find one single name in the file. It's a bit baffling.  Hence I was asking the question.

Ahh well SCENE.BIN format in the wiki might help no?

The SaiNt

  • No life
  • *
  • Posts: 1302
  • Karma: 3
    • View Profile
Re: Battle script (SCENE.BIN) + more
« Reply #14 on: 2007-01-28 02:47:01 »
Ahhh poo I didn't check for that.  Sorry The Saint I pulled a Christian LOL.

Huh?
Obviously I wasn't paying attention earlier so I missed it.

Cyberman

  • No life
  • *
  • Posts: 1575
  • Karma: 8
    • View Profile
Re: Battle script (SCENE.BIN) + more
« Reply #15 on: 2007-01-28 03:56:28 »
Oh I just forgot to make a proper install file without the crazy memory management DLL that borland for some reason doesn't consider a runtime package. Kind of frustrating really. Anyhow.. I've made several updates however I would like to make a install package.  Not sure should I do version management or just cram it in some directory and not bother :D

Cyb

Cyberman

  • No life
  • *
  • Posts: 1575
  • Karma: 8
    • View Profile
More On Scene.Bin Data
« Reply #16 on: 2007-01-28 22:47:24 »
Right so I've been trying to make heads or tails of what I'm doing wrong.
So I've dumped what the file sizes are by Block and file index in the file SCENE.BIN.

This is what I dumped in terms of Block#.File# and size

Code: [Select]
[00.000] Size = 2525
[00.001] Size = 1471
[00.002] Size = 2787
[00.003] Size = 1025
[00.004] Size = 138
[00.005] Size = 3452
[00.006] Size = 2923
[00.007] Size = 1893
[00.008] Size = 2515
[00.009] Size = 2288
[00.010] Size = 2871
[00.011] Size = 2694
[01.012] Size = 3349
[01.013] Size = 3628
[01.014] Size = 2473
[01.015] Size = 4627
[01.016] Size = 4263
[01.017] Size = 4705
[02.018] Size = 4196
[02.019] Size = 3943
[02.020] Size = 4830
[02.021] Size = 2356
[02.022] Size = 2589
[02.023] Size = 1240
[02.024] Size = 5115
[03.025] Size = 4009
[03.026] Size = 5121
[03.027] Size = 2046
[03.028] Size = 2423
[03.029] Size = 3574
[03.030] Size = 3581
[03.031] Size = 3964
[03.032] Size = 2735
[04.033] Size = 3324
[04.034] Size = 2170
[04.035] Size = 4894
[04.036] Size = 5988
[04.037] Size = 3287
[04.038] Size = 460
[05.039] Size = 4733
[05.040] Size = 5296
[05.041] Size = 4699
[05.042] Size = 3957
[05.043] Size = 4021
[05.044] Size = 4804
[06.045] Size = 2390
[06.046] Size = 2658
[06.047] Size = 2649
[06.048] Size = 3785
[06.049] Size = 3477
[06.050] Size = 4347
[06.051] Size = 5289
[06.052] Size = 4417
[07.053] Size = 5639
[07.054] Size = 4113
[07.055] Size = 3925
[07.056] Size = 1934
[07.057] Size = 2992
[07.058] Size = 3713
[07.059] Size = 1984
[07.060] Size = 2002
[08.061] Size = 1353
[08.062] Size = 1893
[08.063] Size = 1893
[08.064] Size = 2852
[08.065] Size = 385
[08.066] Size = 822
[08.067] Size = 2022
[08.068] Size = 2217
[08.069] Size = 2198
[08.070] Size = 3204
[08.071] Size = 3237
[08.072] Size = 2693
[09.073] Size = 2949
[09.074] Size = 2167
[09.075] Size = 2667
[09.076] Size = 3802
[09.077] Size = 3804
[09.078] Size = 3431
[09.079] Size = 3112
[09.080] Size = 3593
[10.081] Size = 4515
[10.082] Size = 2950
[10.083] Size = 2016
[10.084] Size = 2258
[10.085] Size = 2702
[10.086] Size = 3142
[10.087] Size = 2884
[10.088] Size = 3047
[10.089] Size = 3739
[11.090] Size = 3458
[11.091] Size = 4293
[11.092] Size = 1746
[11.093] Size = 3763
[11.094] Size = 3031
[11.095] Size = 3004
[11.096] Size = 3263
[11.097] Size = 3534
[12.098] Size = 3302
[12.099] Size = 690
[12.100] Size = 5918
[12.101] Size = 2323
[12.102] Size = 5245
[12.103] Size = 4206
[12.104] Size = 3047
[13.105] Size = 2642
[13.106] Size = 3983
[13.107] Size = 3981
[13.108] Size = 3614
[13.109] Size = 3065
[13.110] Size = 3472
[13.111] Size = 2687
[13.112] Size = 3291
[13.113] Size = 1931
[14.114] Size = 1703
[14.115] Size = 3646
[14.116] Size = 3325
[14.117] Size = 4254
[14.118] Size = 2409
[14.119] Size = 2417
[14.120] Size = 4944
[14.121] Size = 3536
[15.122] Size = 93
[15.123] Size = 2900
[15.124] Size = 90
[15.125] Size = 3546
[15.126] Size = 2811
[15.127] Size = 2855
[15.128] Size = 3617
[15.129] Size = 2648
[15.130] Size = 4103
[16.131] Size = 3550
[16.132] Size = 2347
[16.133] Size = 2298
[16.134] Size = 4471
[16.135] Size = 2105
[16.136] Size = 3041
[16.137] Size = 3143
[16.138] Size = 4991
[17.139] Size = 3355
[17.140] Size = 4369
[17.141] Size = 3464
[17.142] Size = 1722
[17.143] Size = 2609
[17.144] Size = 3687
[17.145] Size = 2474
[17.146] Size = 2640
[17.147] Size = 3286
[18.148] Size = 3786
[18.149] Size = 3017
[18.150] Size = 2237
[18.151] Size = 4416
[18.152] Size = 3192
[18.153] Size = 2792
[18.154] Size = 3542
[18.155] Size = 2692
[18.156] Size = 2821
[19.157] Size = 3794
[19.158] Size = 3199
[19.159] Size = 3313
[19.160] Size = 2425
[19.161] Size = 4656
[19.162] Size = 2494
[19.163] Size = 3193
[19.164] Size = 4344
[20.165] Size = 3760
[20.166] Size = 4487
[20.167] Size = 399
[20.168] Size = 3716
[20.169] Size = 4218
[20.170] Size = 5421
[21.171] Size = 4632
[21.172] Size = 4548
[21.173] Size = 4795
[21.174] Size = 2839
[21.175] Size = 3430
[21.176] Size = 1475
[21.177] Size = 3604
[22.178] Size = 3954
[22.179] Size = 2247
[22.180] Size = 3156
[22.181] Size = 3497
[22.182] Size = 4365
[22.183] Size = 3045
[22.184] Size = 6211
[23.185] Size = 4671
[23.186] Size = 3619
[23.187] Size = 3036
[23.188] Size = 4055
[23.189] Size = 3760
[23.190] Size = 3017
[23.191] Size = 4012
[23.192] Size = 2300
[24.193] Size = 3146
[24.194] Size = 2509
[24.195] Size = 95
[24.196] Size = 2489
[24.197] Size = 3566
[24.198] Size = 2811
[24.199] Size = 2804
[24.200] Size = 4372
[25.201] Size = 4674
[25.202] Size = 3331
[25.203] Size = 1645
[25.204] Size = 4312
[25.205] Size = 3298
[25.206] Size = 3147
[25.207] Size = 2379
[25.208] Size = 2218
[25.209] Size = 3431
[26.210] Size = 4199
[26.211] Size = 3698
[26.212] Size = 3583
[26.213] Size = 3856
[26.214] Size = 3797
[26.215] Size = 4333
[26.216] Size = 3285
[27.217] Size = 3873
[27.218] Size = 4060
[27.219] Size = 5227
[27.220] Size = 5764
[27.221] Size = 5795
[28.222] Size = 5609
[28.223] Size = 4959
[28.224] Size = 4284
[28.225] Size = 4432
[28.226] Size = 7562
[29.227] Size = 5252
[29.228] Size = 5666
[29.229] Size = 6227
[29.230] Size = 6421
[29.231] Size = 4462
[30.232] Size = 6521
[30.233] Size = 6663
[30.234] Size = 6223
[30.235] Size = 3633
[30.236] Size = 3745
[31.237] Size = 3561
[31.238] Size = 1625
[31.239] Size = 4078
[31.240] Size = 3622
[31.241] Size = 3099
[31.242] Size = 1834
[31.243] Size = 2924
[31.244] Size = 4018
[32.245] Size = 7099
[32.246] Size = 4243
[32.247] Size = 3414
[32.248] Size = 2428
[32.249] Size = 2653
[32.250] Size = 138
[32.251] Size = 138
[32.252] Size = 138
[32.253] Size = 138
[32.254] Size = 138
[32.255] Size = 2194
Anything that doesn't look right in there? (the small #'s are suspicious definately)

Cyb

gigaherz

  • Crazy poster
  • *
  • Posts: 105
  • Karma: 0
    • View Profile
    • gigaherz's shitty stuff
Re: Battle script (SCENE.BIN) + more
« Reply #17 on: 2007-01-29 01:22:09 »
I coded a small console C++ program to read my scene.bin.
As you can see my sizes are usually smaller than yours. If the info in the wiki is right, then my code is fine (I read the code 20 times to make sure it had no bugs), and my sizes look even more wrong...

Here's my code if you want to try it with your data... it comes with source and exe, and the source should be standard enough to be compilable in any C++ compiler.

You can put it in the same place as scene.bin, or specify the path in the first param.

http://www.sendspace.com/file/mqvy9p

The output of my program:
Code: [Select]
Block 0:
 * File 0: Offset = 16 words (64 bytes); Length = 177 words (708 bytes).
 * File 1: Offset = 193 words (772 bytes); Length = 112 words (448 bytes).
 * File 2: Offset = 305 words (1220 bytes); Length = 197 words (788 bytes).
 * File 3: Offset = 502 words (2008 bytes); Length = 80 words (320 bytes).
 * File 4: Offset = 582 words (2328 bytes); Length = 11 words (44 bytes).
 * File 5: Offset = 593 words (2372 bytes); Length = 240 words (960 bytes).
 * File 6: Offset = 833 words (3332 bytes); Length = 213 words (852 bytes).
 * File 7: Offset = 1046 words (4184 bytes); Length = 141 words (564 bytes).
 * File 8: Offset = 1187 words (4748 bytes); Length = 180 words (720 bytes).
 * File 9: Offset = 1367 words (5468 bytes); Length = 230 words (920 bytes).
 * File 10: Offset = 1597 words (6388 bytes); Length = 211 words (844 bytes).
 * File 11: Offset = 1808 words (7232 bytes); Length = 6384 words (25536 bytes).
Block 1:
 * File 0: Offset = 16 words (64 bytes); Length = 245 words (980 bytes).
 * File 1: Offset = 261 words (1044 bytes); Length = 253 words (1012 bytes).
 * File 2: Offset = 514 words (2056 bytes); Length = 352 words (1408 bytes).
 * File 3: Offset = 866 words (3464 bytes); Length = 328 words (1312 bytes).
 * File 4: Offset = 1194 words (4776 bytes); Length = 311 words (1244 bytes).
 * File 5: Offset = 1505 words (6020 bytes); Length = 6687 words (26748 bytes).
Block 2:
 * File 0: Offset = 16 words (64 bytes); Length = 305 words (1220 bytes).
 * File 1: Offset = 321 words (1284 bytes); Length = 291 words (1164 bytes).
 * File 2: Offset = 612 words (2448 bytes); Length = 343 words (1372 bytes).
 * File 3: Offset = 955 words (3820 bytes); Length = 217 words (868 bytes).
 * File 4: Offset = 1172 words (4688 bytes); Length = 191 words (764 bytes).
 * File 5: Offset = 1363 words (5452 bytes); Length = 197 words (788 bytes).
 * File 6: Offset = 1560 words (6240 bytes); Length = 6632 words (26528 bytes).
Block 3:
 * File 0: Offset = 16 words (64 bytes); Length = 279 words (1116 bytes).
 * File 1: Offset = 295 words (1180 bytes); Length = 362 words (1448 bytes).
 * File 2: Offset = 657 words (2628 bytes); Length = 138 words (552 bytes).
 * File 3: Offset = 795 words (3180 bytes); Length = 173 words (692 bytes).
 * File 4: Offset = 968 words (3872 bytes); Length = 247 words (988 bytes).
 * File 5: Offset = 1215 words (4860 bytes); Length = 273 words (1092 bytes).
 * File 6: Offset = 1488 words (5952 bytes); Length = 275 words (1100 bytes).
 * File 7: Offset = 1763 words (7052 bytes); Length = 6429 words (25716 bytes).
Block 4:
 * File 0: Offset = 16 words (64 bytes); Length = 241 words (964 bytes).
 * File 1: Offset = 257 words (1028 bytes); Length = 148 words (592 bytes).
 * File 2: Offset = 405 words (1620 bytes); Length = 356 words (1424 bytes).
 * File 3: Offset = 761 words (3044 bytes); Length = 436 words (1744 bytes).
 * File 4: Offset = 1197 words (4788 bytes); Length = 237 words (948 bytes).
 * File 5: Offset = 1434 words (5736 bytes); Length = 6758 words (27032 bytes).
Block 5:
 * File 0: Offset = 16 words (64 bytes); Length = 344 words (1376 bytes).
 * File 1: Offset = 360 words (1440 bytes); Length = 360 words (1440 bytes).
 * File 2: Offset = 720 words (2880 bytes); Length = 332 words (1328 bytes).
 * File 3: Offset = 1052 words (4208 bytes); Length = 279 words (1116 bytes).
 * File 4: Offset = 1331 words (5324 bytes); Length = 271 words (1084 bytes).
 * File 5: Offset = 1602 words (6408 bytes); Length = 6590 words (26360 bytes).
Block 6:
 * File 0: Offset = 16 words (64 bytes); Length = 165 words (660 bytes).
 * File 1: Offset = 181 words (724 bytes); Length = 186 words (744 bytes).
 * File 2: Offset = 367 words (1468 bytes); Length = 175 words (700 bytes).
 * File 3: Offset = 542 words (2168 bytes); Length = 266 words (1064 bytes).
 * File 4: Offset = 808 words (3232 bytes); Length = 243 words (972 bytes).
 * File 5: Offset = 1051 words (4204 bytes); Length = 299 words (1196 bytes).
 * File 6: Offset = 1350 words (5400 bytes); Length = 373 words (1492 bytes).
 * File 7: Offset = 1723 words (6892 bytes); Length = 6469 words (25876 bytes).
Block 7:
 * File 0: Offset = 16 words (64 bytes); Length = 403 words (1612 bytes).
 * File 1: Offset = 419 words (1676 bytes); Length = 289 words (1156 bytes).
 * File 2: Offset = 708 words (2832 bytes); Length = 268 words (1072 bytes).
 * File 3: Offset = 976 words (3904 bytes); Length = 252 words (1008 bytes).
 * File 4: Offset = 1228 words (4912 bytes); Length = 211 words (844 bytes).
 * File 5: Offset = 1439 words (5756 bytes); Length = 268 words (1072 bytes).
 * File 6: Offset = 1707 words (6828 bytes); Length = 133 words (532 bytes).
 * File 7: Offset = 1840 words (7360 bytes); Length = 6352 words (25408 bytes).
Block 8:
 * File 0: Offset = 16 words (64 bytes); Length = 96 words (384 bytes).
 * File 1: Offset = 112 words (448 bytes); Length = 141 words (564 bytes).
 * File 2: Offset = 253 words (1012 bytes); Length = 141 words (564 bytes).
 * File 3: Offset = 394 words (1576 bytes); Length = 214 words (856 bytes).
 * File 4: Offset = 608 words (2432 bytes); Length = 98 words (392 bytes).
 * File 5: Offset = 706 words (2824 bytes); Length = 68 words (272 bytes).
 * File 6: Offset = 774 words (3096 bytes); Length = 150 words (600 bytes).
 * File 7: Offset = 924 words (3696 bytes); Length = 159 words (636 bytes).
 * File 8: Offset = 1083 words (4332 bytes); Length = 159 words (636 bytes).
 * File 9: Offset = 1242 words (4968 bytes); Length = 231 words (924 bytes).
 * File 10: Offset = 1473 words (5892 bytes); Length = 248 words (992 bytes).
 * File 11: Offset = 1721 words (6884 bytes); Length = 6471 words (25884 bytes).
Block 9:
 * File 0: Offset = 16 words (64 bytes); Length = 222 words (888 bytes).
 * File 1: Offset = 238 words (952 bytes); Length = 214 words (856 bytes).
 * File 2: Offset = 452 words (1808 bytes); Length = 199 words (796 bytes).
 * File 3: Offset = 651 words (2604 bytes); Length = 264 words (1056 bytes).
 * File 4: Offset = 915 words (3660 bytes); Length = 260 words (1040 bytes).
 * File 5: Offset = 1175 words (4700 bytes); Length = 258 words (1032 bytes).
 * File 6: Offset = 1433 words (5732 bytes); Length = 235 words (940 bytes).
 * File 7: Offset = 1668 words (6672 bytes); Length = 6524 words (26096 bytes).
Block 10:
 * File 0: Offset = 16 words (64 bytes); Length = 321 words (1284 bytes).
 * File 1: Offset = 337 words (1348 bytes); Length = 206 words (824 bytes).
 * File 2: Offset = 543 words (2172 bytes); Length = 148 words (592 bytes).
 * File 3: Offset = 691 words (2764 bytes); Length = 154 words (616 bytes).
 * File 4: Offset = 845 words (3380 bytes); Length = 197 words (788 bytes).
 * File 5: Offset = 1042 words (4168 bytes); Length = 221 words (884 bytes).
 * File 6: Offset = 1263 words (5052 bytes); Length = 223 words (892 bytes).
 * File 7: Offset = 1486 words (5944 bytes); Length = 226 words (904 bytes).
 * File 8: Offset = 1712 words (6848 bytes); Length = 6480 words (25920 bytes).
Block 11:
 * File 0: Offset = 16 words (64 bytes); Length = 245 words (980 bytes).
 * File 1: Offset = 261 words (1044 bytes); Length = 312 words (1248 bytes).
 * File 2: Offset = 573 words (2292 bytes); Length = 126 words (504 bytes).
 * File 3: Offset = 699 words (2796 bytes); Length = 267 words (1068 bytes).
 * File 4: Offset = 966 words (3864 bytes); Length = 228 words (912 bytes).
 * File 5: Offset = 1194 words (4776 bytes); Length = 220 words (880 bytes).
 * File 6: Offset = 1414 words (5656 bytes); Length = 221 words (884 bytes).
 * File 7: Offset = 1635 words (6540 bytes); Length = 6557 words (26228 bytes).
Block 12:
 * File 0: Offset = 16 words (64 bytes); Length = 240 words (960 bytes).
 * File 1: Offset = 256 words (1024 bytes); Length = 239 words (956 bytes).
 * File 2: Offset = 495 words (1980 bytes); Length = 426 words (1704 bytes).
 * File 3: Offset = 921 words (3684 bytes); Length = 164 words (656 bytes).
 * File 4: Offset = 1085 words (4340 bytes); Length = 373 words (1492 bytes).
 * File 5: Offset = 1458 words (5832 bytes); Length = 312 words (1248 bytes).
 * File 6: Offset = 1770 words (7080 bytes); Length = 6422 words (25688 bytes).
Block 13:
 * File 0: Offset = 16 words (64 bytes); Length = 180 words (720 bytes).
 * File 1: Offset = 196 words (784 bytes); Length = 275 words (1100 bytes).
 * File 2: Offset = 471 words (1884 bytes); Length = 267 words (1068 bytes).
 * File 3: Offset = 738 words (2952 bytes); Length = 245 words (980 bytes).
 * File 4: Offset = 983 words (3932 bytes); Length = 231 words (924 bytes).
 * File 5: Offset = 1214 words (4856 bytes); Length = 242 words (968 bytes).
 * File 6: Offset = 1456 words (5824 bytes); Length = 190 words (760 bytes).
 * File 7: Offset = 1646 words (6584 bytes); Length = 228 words (912 bytes).
 * File 8: Offset = 1874 words (7496 bytes); Length = 6318 words (25272 bytes).
Block 14:
 * File 0: Offset = 16 words (64 bytes); Length = 214 words (856 bytes).
 * File 1: Offset = 230 words (920 bytes); Length = 268 words (1072 bytes).
 * File 2: Offset = 498 words (1992 bytes); Length = 227 words (908 bytes).
 * File 3: Offset = 725 words (2900 bytes); Length = 298 words (1192 bytes).
 * File 4: Offset = 1023 words (4092 bytes); Length = 174 words (696 bytes).
 * File 5: Offset = 1197 words (4788 bytes); Length = 172 words (688 bytes).
 * File 6: Offset = 1369 words (5476 bytes); Length = 340 words (1360 bytes).
 * File 7: Offset = 1709 words (6836 bytes); Length = 6483 words (25932 bytes).
Block 15:
 * File 0: Offset = 16 words (64 bytes); Length = 173 words (692 bytes).
 * File 1: Offset = 189 words (756 bytes); Length = 212 words (848 bytes).
 * File 2: Offset = 401 words (1604 bytes); Length = 171 words (684 bytes).
 * File 3: Offset = 572 words (2288 bytes); Length = 248 words (992 bytes).
 * File 4: Offset = 820 words (3280 bytes); Length = 196 words (784 bytes).
 * File 5: Offset = 1016 words (4064 bytes); Length = 217 words (868 bytes).
 * File 6: Offset = 1233 words (4932 bytes); Length = 261 words (1044 bytes).
 * File 7: Offset = 1494 words (5976 bytes); Length = 194 words (776 bytes).
 * File 8: Offset = 1688 words (6752 bytes); Length = 6504 words (26016 bytes).
Block 16:
 * File 0: Offset = 16 words (64 bytes); Length = 245 words (980 bytes).
 * File 1: Offset = 261 words (1044 bytes); Length = 174 words (696 bytes).
 * File 2: Offset = 435 words (1740 bytes); Length = 206 words (824 bytes).
 * File 3: Offset = 641 words (2564 bytes); Length = 325 words (1300 bytes).
 * File 4: Offset = 966 words (3864 bytes); Length = 163 words (652 bytes).
 * File 5: Offset = 1129 words (4516 bytes); Length = 213 words (852 bytes).
 * File 6: Offset = 1342 words (5368 bytes); Length = 224 words (896 bytes).
 * File 7: Offset = 1566 words (6264 bytes); Length = 6626 words (26504 bytes).
Block 17:
 * File 0: Offset = 16 words (64 bytes); Length = 249 words (996 bytes).
 * File 1: Offset = 265 words (1060 bytes); Length = 298 words (1192 bytes).
 * File 2: Offset = 563 words (2252 bytes); Length = 252 words (1008 bytes).
 * File 3: Offset = 815 words (3260 bytes); Length = 127 words (508 bytes).
 * File 4: Offset = 942 words (3768 bytes); Length = 194 words (776 bytes).
 * File 5: Offset = 1136 words (4544 bytes); Length = 266 words (1064 bytes).
 * File 6: Offset = 1402 words (5608 bytes); Length = 172 words (688 bytes).
 * File 7: Offset = 1574 words (6296 bytes); Length = 182 words (728 bytes).
 * File 8: Offset = 1756 words (7024 bytes); Length = 6436 words (25744 bytes).
Block 18:
 * File 0: Offset = 16 words (64 bytes); Length = 282 words (1128 bytes).
 * File 1: Offset = 298 words (1192 bytes); Length = 215 words (860 bytes).
 * File 2: Offset = 513 words (2052 bytes); Length = 150 words (600 bytes).
 * File 3: Offset = 663 words (2652 bytes); Length = 306 words (1224 bytes).
 * File 4: Offset = 969 words (3876 bytes); Length = 222 words (888 bytes).
 * File 5: Offset = 1191 words (4764 bytes); Length = 205 words (820 bytes).
 * File 6: Offset = 1396 words (5584 bytes); Length = 258 words (1032 bytes).
 * File 7: Offset = 1654 words (6616 bytes); Length = 199 words (796 bytes).
 * File 8: Offset = 1853 words (7412 bytes); Length = 6339 words (25356 bytes).
Block 19:
 * File 0: Offset = 16 words (64 bytes); Length = 284 words (1136 bytes).
 * File 1: Offset = 300 words (1200 bytes); Length = 228 words (912 bytes).
 * File 2: Offset = 528 words (2112 bytes); Length = 231 words (924 bytes).
 * File 3: Offset = 759 words (3036 bytes); Length = 179 words (716 bytes).
 * File 4: Offset = 938 words (3752 bytes); Length = 325 words (1300 bytes).
 * File 5: Offset = 1263 words (5052 bytes); Length = 161 words (644 bytes).
 * File 6: Offset = 1424 words (5696 bytes); Length = 237 words (948 bytes).
 * File 7: Offset = 1661 words (6644 bytes); Length = 6531 words (26124 bytes).
Block 20:
 * File 0: Offset = 16 words (64 bytes); Length = 279 words (1116 bytes).
 * File 1: Offset = 295 words (1180 bytes); Length = 320 words (1280 bytes).
 * File 2: Offset = 615 words (2460 bytes); Length = 316 words (1264 bytes).
 * File 3: Offset = 931 words (3724 bytes); Length = 267 words (1068 bytes).
 * File 4: Offset = 1198 words (4792 bytes); Length = 292 words (1168 bytes).
 * File 5: Offset = 1490 words (5960 bytes); Length = 6702 words (26808 bytes).
Block 21:
 * File 0: Offset = 16 words (64 bytes); Length = 321 words (1284 bytes).
 * File 1: Offset = 337 words (1348 bytes); Length = 328 words (1312 bytes).
 * File 2: Offset = 665 words (2660 bytes); Length = 329 words (1316 bytes).
 * File 3: Offset = 994 words (3976 bytes); Length = 194 words (776 bytes).
 * File 4: Offset = 1188 words (4752 bytes); Length = 239 words (956 bytes).
 * File 5: Offset = 1427 words (5708 bytes); Length = 237 words (948 bytes).
 * File 6: Offset = 1664 words (6656 bytes); Length = 6528 words (26112 bytes).
Block 22:
 * File 0: Offset = 16 words (64 bytes); Length = 283 words (1132 bytes).
 * File 1: Offset = 299 words (1196 bytes); Length = 159 words (636 bytes).
 * File 2: Offset = 458 words (1832 bytes); Length = 226 words (904 bytes).
 * File 3: Offset = 684 words (2736 bytes); Length = 254 words (1016 bytes).
 * File 4: Offset = 938 words (3752 bytes); Length = 309 words (1236 bytes).
 * File 5: Offset = 1247 words (4988 bytes); Length = 224 words (896 bytes).
 * File 6: Offset = 1471 words (5884 bytes); Length = 6721 words (26884 bytes).
Block 23:
 * File 0: Offset = 16 words (64 bytes); Length = 328 words (1312 bytes).
 * File 1: Offset = 344 words (1376 bytes); Length = 255 words (1020 bytes).
 * File 2: Offset = 599 words (2396 bytes); Length = 221 words (884 bytes).
 * File 3: Offset = 820 words (3280 bytes); Length = 290 words (1160 bytes).
 * File 4: Offset = 1110 words (4440 bytes); Length = 267 words (1068 bytes).
 * File 5: Offset = 1377 words (5508 bytes); Length = 224 words (896 bytes).
 * File 6: Offset = 1601 words (6404 bytes); Length = 277 words (1108 bytes).
 * File 7: Offset = 1878 words (7512 bytes); Length = 6314 words (25256 bytes).
Block 24:
 * File 0: Offset = 16 words (64 bytes); Length = 222 words (888 bytes).
 * File 1: Offset = 238 words (952 bytes); Length = 178 words (712 bytes).
 * File 2: Offset = 416 words (1664 bytes); Length = 321 words (1284 bytes).
 * File 3: Offset = 737 words (2948 bytes); Length = 190 words (760 bytes).
 * File 4: Offset = 927 words (3708 bytes); Length = 249 words (996 bytes).
 * File 5: Offset = 1176 words (4704 bytes); Length = 198 words (792 bytes).
 * File 6: Offset = 1374 words (5496 bytes); Length = 205 words (820 bytes).
 * File 7: Offset = 1579 words (6316 bytes); Length = 6613 words (26452 bytes).
Block 25:
 * File 0: Offset = 16 words (64 bytes); Length = 328 words (1312 bytes).
 * File 1: Offset = 344 words (1376 bytes); Length = 232 words (928 bytes).
 * File 2: Offset = 576 words (2304 bytes); Length = 121 words (484 bytes).
 * File 3: Offset = 697 words (2788 bytes); Length = 302 words (1208 bytes).
 * File 4: Offset = 999 words (3996 bytes); Length = 224 words (896 bytes).
 * File 5: Offset = 1223 words (4892 bytes); Length = 225 words (900 bytes).
 * File 6: Offset = 1448 words (5792 bytes); Length = 176 words (704 bytes).
 * File 7: Offset = 1624 words (6496 bytes); Length = 151 words (604 bytes).
 * File 8: Offset = 1775 words (7100 bytes); Length = 6417 words (25668 bytes).
Block 26:
 * File 0: Offset = 16 words (64 bytes); Length = 295 words (1180 bytes).
 * File 1: Offset = 311 words (1244 bytes); Length = 248 words (992 bytes).
 * File 2: Offset = 559 words (2236 bytes); Length = 257 words (1028 bytes).
 * File 3: Offset = 816 words (3264 bytes); Length = 285 words (1140 bytes).
 * File 4: Offset = 1101 words (4404 bytes); Length = 277 words (1108 bytes).
 * File 5: Offset = 1378 words (5512 bytes); Length = 319 words (1276 bytes).
 * File 6: Offset = 1697 words (6788 bytes); Length = 6495 words (25980 bytes).
Block 27:
 * File 0: Offset = 16 words (64 bytes); Length = 268 words (1072 bytes).
 * File 1: Offset = 284 words (1136 bytes); Length = 291 words (1164 bytes).
 * File 2: Offset = 575 words (2300 bytes); Length = 372 words (1488 bytes).
 * File 3: Offset = 947 words (3788 bytes); Length = 413 words (1652 bytes).
 * File 4: Offset = 1360 words (5440 bytes); Length = 6832 words (27328 bytes).
Block 28:
 * File 0: Offset = 16 words (64 bytes); Length = 388 words (1552 bytes).
 * File 1: Offset = 404 words (1616 bytes); Length = 351 words (1404 bytes).
 * File 2: Offset = 755 words (3020 bytes); Length = 303 words (1212 bytes).
 * File 3: Offset = 1058 words (4232 bytes); Length = 319 words (1276 bytes).
 * File 4: Offset = 1377 words (5508 bytes); Length = 6815 words (27260 bytes).
Block 29:
 * File 0: Offset = 16 words (64 bytes); Length = 366 words (1464 bytes).
 * File 1: Offset = 382 words (1528 bytes); Length = 404 words (1616 bytes).
 * File 2: Offset = 786 words (3144 bytes); Length = 438 words (1752 bytes).
 * File 3: Offset = 1224 words (4896 bytes); Length = 447 words (1788 bytes).
 * File 4: Offset = 1671 words (6684 bytes); Length = 6521 words (26084 bytes).
Block 30:
 * File 0: Offset = 16 words (64 bytes); Length = 464 words (1856 bytes).
 * File 1: Offset = 480 words (1920 bytes); Length = 463 words (1852 bytes).
 * File 2: Offset = 943 words (3772 bytes); Length = 448 words (1792 bytes).
 * File 3: Offset = 1391 words (5564 bytes); Length = 253 words (1012 bytes).
 * File 4: Offset = 1644 words (6576 bytes); Length = 6548 words (26192 bytes).
Block 31:
 * File 0: Offset = 16 words (64 bytes); Length = 254 words (1016 bytes).
 * File 1: Offset = 270 words (1080 bytes); Length = 117 words (468 bytes).
 * File 2: Offset = 387 words (1548 bytes); Length = 287 words (1148 bytes).
 * File 3: Offset = 674 words (2696 bytes); Length = 267 words (1068 bytes).
 * File 4: Offset = 941 words (3764 bytes); Length = 231 words (924 bytes).
 * File 5: Offset = 1172 words (4688 bytes); Length = 136 words (544 bytes).
 * File 6: Offset = 1308 words (5232 bytes); Length = 353 words (1412 bytes).
 * File 7: Offset = 1661 words (6644 bytes); Length = 6531 words (26124 bytes).
Block 32:
 * File 0: Offset = 16 words (64 bytes); Length = 500 words (2000 bytes).
 * File 1: Offset = 516 words (2064 bytes); Length = 301 words (1204 bytes).
 * File 2: Offset = 817 words (3268 bytes); Length = 234 words (936 bytes).
 * File 3: Offset = 1051 words (4204 bytes); Length = 171 words (684 bytes).
 * File 4: Offset = 1222 words (4888 bytes); Length = 181 words (724 bytes).
 * File 5: Offset = 1403 words (5612 bytes); Length = 11 words (44 bytes).
 * File 6: Offset = 1414 words (5656 bytes); Length = 11 words (44 bytes).
 * File 7: Offset = 1425 words (5700 bytes); Length = 11 words (44 bytes).
 * File 8: Offset = 1436 words (5744 bytes); Length = 11 words (44 bytes).
 * File 9: Offset = 1447 words (5788 bytes); Length = 11 words (44 bytes).
 * File 10: Offset = 1458 words (5832 bytes); Length = 6734 words (26936 bytes).

EDIT: I have made the program dump the first 16 bytes of data, and I have noticed all the file data starts directly with the gzip info (1f 8b 08 00 ...), so I'm pretty much sure my code works fine.
That also means either the gzip structure has some means to know when it's done, or there is just no way to know it, except for the total padded length.
Talking about gzip, I'm assuming it's the same gzip you can find in zlib, else I don't know what is it...

EDIT2: ok it is, I modified the extractor function from qgears to inflate the data to save time. :p
Now my program can dump the uncompressed data to a file. I will look at the data structures and see if I can make them show logically coherent info.
« Last Edit: 2007-01-29 02:47:52 by gigaherz »

Cyberman

  • No life
  • *
  • Posts: 1575
  • Karma: 8
    • View Profile
Re: Battle script (SCENE.BIN) + more
« Reply #18 on: 2007-01-29 02:17:04 »
Ok so my code matches it closely (save for the last block in each file for yours seems a bit big).

Here is my extraction data formated the way yours is
Code: [Select]
Block 0:
 * File 0: Offset = 16 words (64 bytes); Length = 177 words (708 bytes) Decompressed = 2525 bytes
 * File 1: Offset = 193 words (772 bytes); Length = 112 words (448 bytes) Decompressed = 1471 bytes
 * File 2: Offset = 305 words (1220 bytes); Length = 197 words (788 bytes) Decompressed = 2787 bytes
 * File 3: Offset = 502 words (2008 bytes); Length = 80 words (320 bytes) Decompressed = 1025 bytes
 * File 4: Offset = 582 words (2328 bytes); Length = 11 words (44 bytes) Decompressed = 138 bytes
 * File 5: Offset = 593 words (2372 bytes); Length = 240 words (960 bytes) Decompressed = 3452 bytes
 * File 6: Offset = 833 words (3332 bytes); Length = 213 words (852 bytes) Decompressed = 2923 bytes
 * File 7: Offset = 1046 words (4184 bytes); Length = 141 words (564 bytes) Decompressed = 1893 bytes
 * File 8: Offset = 1187 words (4748 bytes); Length = 180 words (720 bytes) Decompressed = 2515 bytes
 * File 9: Offset = 1367 words (5468 bytes); Length = 230 words (920 bytes) Decompressed = 2288 bytes
 * File 10: Offset = 1597 words (6388 bytes); Length = 211 words (844 bytes) Decompressed = 2871 bytes
 * File 11: Offset = 1808 words (7232 bytes); Length = 240 words (960 bytes) Decompressed = 2694 bytes
Block 1:
 * File 0: Offset = 16 words (64 bytes); Length = 245 words (980 bytes) Decompressed = 3349 bytes
 * File 1: Offset = 261 words (1044 bytes); Length = 253 words (1012 bytes) Decompressed = 3628 bytes
 * File 2: Offset = 514 words (2056 bytes); Length = 352 words (1408 bytes) Decompressed = 2473 bytes
 * File 3: Offset = 866 words (3464 bytes); Length = 328 words (1312 bytes) Decompressed = 4627 bytes
 * File 4: Offset = 1194 words (4776 bytes); Length = 311 words (1244 bytes) Decompressed = 4263 bytes
 * File 5: Offset = 1505 words (6020 bytes); Length = 543 words (2172 bytes) Decompressed = 4705 bytes
Block 2:
 * File 0: Offset = 16 words (64 bytes); Length = 305 words (1220 bytes) Decompressed = 4196 bytes
 * File 1: Offset = 321 words (1284 bytes); Length = 291 words (1164 bytes) Decompressed = 3943 bytes
 * File 2: Offset = 612 words (2448 bytes); Length = 343 words (1372 bytes) Decompressed = 4830 bytes
 * File 3: Offset = 955 words (3820 bytes); Length = 217 words (868 bytes) Decompressed = 2356 bytes
 * File 4: Offset = 1172 words (4688 bytes); Length = 191 words (764 bytes) Decompressed = 2589 bytes
 * File 5: Offset = 1363 words (5452 bytes); Length = 197 words (788 bytes) Decompressed = 1240 bytes
 * File 6: Offset = 1560 words (6240 bytes); Length = 488 words (1952 bytes) Decompressed = 5115 bytes
Block 3:
 * File 0: Offset = 16 words (64 bytes); Length = 279 words (1116 bytes) Decompressed = 4009 bytes
 * File 1: Offset = 295 words (1180 bytes); Length = 362 words (1448 bytes) Decompressed = 5121 bytes
 * File 2: Offset = 657 words (2628 bytes); Length = 138 words (552 bytes) Decompressed = 2046 bytes
 * File 3: Offset = 795 words (3180 bytes); Length = 173 words (692 bytes) Decompressed = 2423 bytes
 * File 4: Offset = 968 words (3872 bytes); Length = 247 words (988 bytes) Decompressed = 3574 bytes
 * File 5: Offset = 1215 words (4860 bytes); Length = 273 words (1092 bytes) Decompressed = 3581 bytes
 * File 6: Offset = 1488 words (5952 bytes); Length = 275 words (1100 bytes) Decompressed = 3964 bytes
 * File 7: Offset = 1763 words (7052 bytes); Length = 285 words (1140 bytes) Decompressed = 2735 bytes
Block 4:
 * File 0: Offset = 16 words (64 bytes); Length = 241 words (964 bytes) Decompressed = 3324 bytes
 * File 1: Offset = 257 words (1028 bytes); Length = 148 words (592 bytes) Decompressed = 2170 bytes
 * File 2: Offset = 405 words (1620 bytes); Length = 356 words (1424 bytes) Decompressed = 4894 bytes
 * File 3: Offset = 761 words (3044 bytes); Length = 436 words (1744 bytes) Decompressed = 5988 bytes
 * File 4: Offset = 1197 words (4788 bytes); Length = 237 words (948 bytes) Decompressed = 3287 bytes
 * File 5: Offset = 1434 words (5736 bytes); Length = 614 words (2456 bytes) Decompressed = 460 bytes
Block 5:
 * File 0: Offset = 16 words (64 bytes); Length = 344 words (1376 bytes) Decompressed = 4733 bytes
 * File 1: Offset = 360 words (1440 bytes); Length = 360 words (1440 bytes) Decompressed = 5296 bytes
 * File 2: Offset = 720 words (2880 bytes); Length = 332 words (1328 bytes) Decompressed = 4699 bytes
 * File 3: Offset = 1052 words (4208 bytes); Length = 279 words (1116 bytes) Decompressed = 3957 bytes
 * File 4: Offset = 1331 words (5324 bytes); Length = 271 words (1084 bytes) Decompressed = 4021 bytes
 * File 5: Offset = 1602 words (6408 bytes); Length = 446 words (1784 bytes) Decompressed = 4804 bytes
Block 6:
 * File 0: Offset = 16 words (64 bytes); Length = 165 words (660 bytes) Decompressed = 2390 bytes
 * File 1: Offset = 181 words (724 bytes); Length = 186 words (744 bytes) Decompressed = 2658 bytes
 * File 2: Offset = 367 words (1468 bytes); Length = 175 words (700 bytes) Decompressed = 2649 bytes
 * File 3: Offset = 542 words (2168 bytes); Length = 266 words (1064 bytes) Decompressed = 3785 bytes
 * File 4: Offset = 808 words (3232 bytes); Length = 243 words (972 bytes) Decompressed = 3477 bytes
 * File 5: Offset = 1051 words (4204 bytes); Length = 299 words (1196 bytes) Decompressed = 4347 bytes
 * File 6: Offset = 1350 words (5400 bytes); Length = 373 words (1492 bytes) Decompressed = 5289 bytes
 * File 7: Offset = 1723 words (6892 bytes); Length = 325 words (1300 bytes) Decompressed = 4417 bytes
Block 7:
 * File 0: Offset = 16 words (64 bytes); Length = 403 words (1612 bytes) Decompressed = 5639 bytes
 * File 1: Offset = 419 words (1676 bytes); Length = 289 words (1156 bytes) Decompressed = 4113 bytes
 * File 2: Offset = 708 words (2832 bytes); Length = 268 words (1072 bytes) Decompressed = 3925 bytes
 * File 3: Offset = 976 words (3904 bytes); Length = 252 words (1008 bytes) Decompressed = 1934 bytes
 * File 4: Offset = 1228 words (4912 bytes); Length = 211 words (844 bytes) Decompressed = 2992 bytes
 * File 5: Offset = 1439 words (5756 bytes); Length = 268 words (1072 bytes) Decompressed = 3713 bytes
 * File 6: Offset = 1707 words (6828 bytes); Length = 133 words (532 bytes) Decompressed = 1984 bytes
 * File 7: Offset = 1840 words (7360 bytes); Length = 208 words (832 bytes) Decompressed = 2002 bytes
Block 8:
 * File 0: Offset = 16 words (64 bytes); Length = 96 words (384 bytes) Decompressed = 1353 bytes
 * File 1: Offset = 112 words (448 bytes); Length = 141 words (564 bytes) Decompressed = 1893 bytes
 * File 2: Offset = 253 words (1012 bytes); Length = 141 words (564 bytes) Decompressed = 1893 bytes
 * File 3: Offset = 394 words (1576 bytes); Length = 214 words (856 bytes) Decompressed = 2852 bytes
 * File 4: Offset = 608 words (2432 bytes); Length = 98 words (392 bytes) Decompressed = 385 bytes
 * File 5: Offset = 706 words (2824 bytes); Length = 68 words (272 bytes) Decompressed = 822 bytes
 * File 6: Offset = 774 words (3096 bytes); Length = 150 words (600 bytes) Decompressed = 2022 bytes
 * File 7: Offset = 924 words (3696 bytes); Length = 159 words (636 bytes) Decompressed = 2217 bytes
 * File 8: Offset = 1083 words (4332 bytes); Length = 159 words (636 bytes) Decompressed = 2198 bytes
 * File 9: Offset = 1242 words (4968 bytes); Length = 231 words (924 bytes) Decompressed = 3204 bytes
 * File 10: Offset = 1473 words (5892 bytes); Length = 248 words (992 bytes) Decompressed = 3237 bytes
 * File 11: Offset = 1721 words (6884 bytes); Length = 327 words (1308 bytes) Decompressed = 2693 bytes
Block 9:
 * File 0: Offset = 16 words (64 bytes); Length = 222 words (888 bytes) Decompressed = 2949 bytes
 * File 1: Offset = 238 words (952 bytes); Length = 214 words (856 bytes) Decompressed = 2167 bytes
 * File 2: Offset = 452 words (1808 bytes); Length = 199 words (796 bytes) Decompressed = 2667 bytes
 * File 3: Offset = 651 words (2604 bytes); Length = 264 words (1056 bytes) Decompressed = 3802 bytes
 * File 4: Offset = 915 words (3660 bytes); Length = 260 words (1040 bytes) Decompressed = 3804 bytes
 * File 5: Offset = 1175 words (4700 bytes); Length = 258 words (1032 bytes) Decompressed = 3431 bytes
 * File 6: Offset = 1433 words (5732 bytes); Length = 235 words (940 bytes) Decompressed = 3112 bytes
 * File 7: Offset = 1668 words (6672 bytes); Length = 380 words (1520 bytes) Decompressed = 3593 bytes
Block 10:
 * File 0: Offset = 16 words (64 bytes); Length = 321 words (1284 bytes) Decompressed = 4515 bytes
 * File 1: Offset = 337 words (1348 bytes); Length = 206 words (824 bytes) Decompressed = 2950 bytes
 * File 2: Offset = 543 words (2172 bytes); Length = 148 words (592 bytes) Decompressed = 2016 bytes
 * File 3: Offset = 691 words (2764 bytes); Length = 154 words (616 bytes) Decompressed = 2258 bytes
 * File 4: Offset = 845 words (3380 bytes); Length = 197 words (788 bytes) Decompressed = 2702 bytes
 * File 5: Offset = 1042 words (4168 bytes); Length = 221 words (884 bytes) Decompressed = 3142 bytes
 * File 6: Offset = 1263 words (5052 bytes); Length = 223 words (892 bytes) Decompressed = 2884 bytes
 * File 7: Offset = 1486 words (5944 bytes); Length = 226 words (904 bytes) Decompressed = 3047 bytes
 * File 8: Offset = 1712 words (6848 bytes); Length = 336 words (1344 bytes) Decompressed = 3739 bytes
Block 11:
 * File 0: Offset = 16 words (64 bytes); Length = 245 words (980 bytes) Decompressed = 3458 bytes
 * File 1: Offset = 261 words (1044 bytes); Length = 312 words (1248 bytes) Decompressed = 4293 bytes
 * File 2: Offset = 573 words (2292 bytes); Length = 126 words (504 bytes) Decompressed = 1746 bytes
 * File 3: Offset = 699 words (2796 bytes); Length = 267 words (1068 bytes) Decompressed = 3763 bytes
 * File 4: Offset = 966 words (3864 bytes); Length = 228 words (912 bytes) Decompressed = 3031 bytes
 * File 5: Offset = 1194 words (4776 bytes); Length = 220 words (880 bytes) Decompressed = 3004 bytes
 * File 6: Offset = 1414 words (5656 bytes); Length = 221 words (884 bytes) Decompressed = 3263 bytes
 * File 7: Offset = 1635 words (6540 bytes); Length = 413 words (1652 bytes) Decompressed = 3534 bytes
Block 12:
 * File 0: Offset = 16 words (64 bytes); Length = 240 words (960 bytes) Decompressed = 3302 bytes
 * File 1: Offset = 256 words (1024 bytes); Length = 239 words (956 bytes) Decompressed = 690 bytes
 * File 2: Offset = 495 words (1980 bytes); Length = 426 words (1704 bytes) Decompressed = 5918 bytes
 * File 3: Offset = 921 words (3684 bytes); Length = 164 words (656 bytes) Decompressed = 2323 bytes
 * File 4: Offset = 1085 words (4340 bytes); Length = 373 words (1492 bytes) Decompressed = 5245 bytes
 * File 5: Offset = 1458 words (5832 bytes); Length = 312 words (1248 bytes) Decompressed = 4206 bytes
 * File 6: Offset = 1770 words (7080 bytes); Length = 278 words (1112 bytes) Decompressed = 3047 bytes
Block 13:
 * File 0: Offset = 16 words (64 bytes); Length = 180 words (720 bytes) Decompressed = 2642 bytes
 * File 1: Offset = 196 words (784 bytes); Length = 275 words (1100 bytes) Decompressed = 3983 bytes
 * File 2: Offset = 471 words (1884 bytes); Length = 267 words (1068 bytes) Decompressed = 3981 bytes
 * File 3: Offset = 738 words (2952 bytes); Length = 245 words (980 bytes) Decompressed = 3614 bytes
 * File 4: Offset = 983 words (3932 bytes); Length = 231 words (924 bytes) Decompressed = 3065 bytes
 * File 5: Offset = 1214 words (4856 bytes); Length = 242 words (968 bytes) Decompressed = 3472 bytes
 * File 6: Offset = 1456 words (5824 bytes); Length = 190 words (760 bytes) Decompressed = 2687 bytes
 * File 7: Offset = 1646 words (6584 bytes); Length = 228 words (912 bytes) Decompressed = 3291 bytes
 * File 8: Offset = 1874 words (7496 bytes); Length = 174 words (696 bytes) Decompressed = 1931 bytes
Block 14:
 * File 0: Offset = 16 words (64 bytes); Length = 214 words (856 bytes) Decompressed = 1703 bytes
 * File 1: Offset = 230 words (920 bytes); Length = 268 words (1072 bytes) Decompressed = 3646 bytes
 * File 2: Offset = 498 words (1992 bytes); Length = 227 words (908 bytes) Decompressed = 3325 bytes
 * File 3: Offset = 725 words (2900 bytes); Length = 298 words (1192 bytes) Decompressed = 4254 bytes
 * File 4: Offset = 1023 words (4092 bytes); Length = 174 words (696 bytes) Decompressed = 2409 bytes
 * File 5: Offset = 1197 words (4788 bytes); Length = 172 words (688 bytes) Decompressed = 2417 bytes
 * File 6: Offset = 1369 words (5476 bytes); Length = 340 words (1360 bytes) Decompressed = 4944 bytes
 * File 7: Offset = 1709 words (6836 bytes); Length = 339 words (1356 bytes) Decompressed = 3536 bytes
Block 15:
 * File 0: Offset = 16 words (64 bytes); Length = 173 words (692 bytes) Decompressed = 93 bytes
 * File 1: Offset = 189 words (756 bytes); Length = 212 words (848 bytes) Decompressed = 2900 bytes
 * File 2: Offset = 401 words (1604 bytes); Length = 171 words (684 bytes) Decompressed = 90 bytes
 * File 3: Offset = 572 words (2288 bytes); Length = 248 words (992 bytes) Decompressed = 3546 bytes
 * File 4: Offset = 820 words (3280 bytes); Length = 196 words (784 bytes) Decompressed = 2811 bytes
 * File 5: Offset = 1016 words (4064 bytes); Length = 217 words (868 bytes) Decompressed = 2855 bytes
 * File 6: Offset = 1233 words (4932 bytes); Length = 261 words (1044 bytes) Decompressed = 3617 bytes
 * File 7: Offset = 1494 words (5976 bytes); Length = 194 words (776 bytes) Decompressed = 2648 bytes
 * File 8: Offset = 1688 words (6752 bytes); Length = 360 words (1440 bytes) Decompressed = 4103 bytes
Block 16:
 * File 0: Offset = 16 words (64 bytes); Length = 245 words (980 bytes) Decompressed = 3550 bytes
 * File 1: Offset = 261 words (1044 bytes); Length = 174 words (696 bytes) Decompressed = 2347 bytes
 * File 2: Offset = 435 words (1740 bytes); Length = 206 words (824 bytes) Decompressed = 2298 bytes
 * File 3: Offset = 641 words (2564 bytes); Length = 325 words (1300 bytes) Decompressed = 4471 bytes
 * File 4: Offset = 966 words (3864 bytes); Length = 163 words (652 bytes) Decompressed = 2105 bytes
 * File 5: Offset = 1129 words (4516 bytes); Length = 213 words (852 bytes) Decompressed = 3041 bytes
 * File 6: Offset = 1342 words (5368 bytes); Length = 224 words (896 bytes) Decompressed = 3143 bytes
 * File 7: Offset = 1566 words (6264 bytes); Length = 482 words (1928 bytes) Decompressed = 4991 bytes
Block 17:
 * File 0: Offset = 16 words (64 bytes); Length = 249 words (996 bytes) Decompressed = 3355 bytes
 * File 1: Offset = 265 words (1060 bytes); Length = 298 words (1192 bytes) Decompressed = 4369 bytes
 * File 2: Offset = 563 words (2252 bytes); Length = 252 words (1008 bytes) Decompressed = 3464 bytes
 * File 3: Offset = 815 words (3260 bytes); Length = 127 words (508 bytes) Decompressed = 1722 bytes
 * File 4: Offset = 942 words (3768 bytes); Length = 194 words (776 bytes) Decompressed = 2609 bytes
 * File 5: Offset = 1136 words (4544 bytes); Length = 266 words (1064 bytes) Decompressed = 3687 bytes
 * File 6: Offset = 1402 words (5608 bytes); Length = 172 words (688 bytes) Decompressed = 2474 bytes
 * File 7: Offset = 1574 words (6296 bytes); Length = 182 words (728 bytes) Decompressed = 2640 bytes
 * File 8: Offset = 1756 words (7024 bytes); Length = 292 words (1168 bytes) Decompressed = 3286 bytes
Block 18:
 * File 0: Offset = 16 words (64 bytes); Length = 282 words (1128 bytes) Decompressed = 3786 bytes
 * File 1: Offset = 298 words (1192 bytes); Length = 215 words (860 bytes) Decompressed = 3017 bytes
 * File 2: Offset = 513 words (2052 bytes); Length = 150 words (600 bytes) Decompressed = 2237 bytes
 * File 3: Offset = 663 words (2652 bytes); Length = 306 words (1224 bytes) Decompressed = 4416 bytes
 * File 4: Offset = 969 words (3876 bytes); Length = 222 words (888 bytes) Decompressed = 3192 bytes
 * File 5: Offset = 1191 words (4764 bytes); Length = 205 words (820 bytes) Decompressed = 2792 bytes
 * File 6: Offset = 1396 words (5584 bytes); Length = 258 words (1032 bytes) Decompressed = 3542 bytes
 * File 7: Offset = 1654 words (6616 bytes); Length = 199 words (796 bytes) Decompressed = 2692 bytes
 * File 8: Offset = 1853 words (7412 bytes); Length = 195 words (780 bytes) Decompressed = 2821 bytes
Block 19:
 * File 0: Offset = 16 words (64 bytes); Length = 284 words (1136 bytes) Decompressed = 3794 bytes
 * File 1: Offset = 300 words (1200 bytes); Length = 228 words (912 bytes) Decompressed = 3199 bytes
 * File 2: Offset = 528 words (2112 bytes); Length = 231 words (924 bytes) Decompressed = 3313 bytes
 * File 3: Offset = 759 words (3036 bytes); Length = 179 words (716 bytes) Decompressed = 2425 bytes
 * File 4: Offset = 938 words (3752 bytes); Length = 325 words (1300 bytes) Decompressed = 4656 bytes
 * File 5: Offset = 1263 words (5052 bytes); Length = 161 words (644 bytes) Decompressed = 2494 bytes
 * File 6: Offset = 1424 words (5696 bytes); Length = 237 words (948 bytes) Decompressed = 3193 bytes
 * File 7: Offset = 1661 words (6644 bytes); Length = 387 words (1548 bytes) Decompressed = 4344 bytes
Block 20:
 * File 0: Offset = 16 words (64 bytes); Length = 279 words (1116 bytes) Decompressed = 3760 bytes
 * File 1: Offset = 295 words (1180 bytes); Length = 320 words (1280 bytes) Decompressed = 4487 bytes
 * File 2: Offset = 615 words (2460 bytes); Length = 316 words (1264 bytes) Decompressed = 399 bytes
 * File 3: Offset = 931 words (3724 bytes); Length = 267 words (1068 bytes) Decompressed = 3716 bytes
 * File 4: Offset = 1198 words (4792 bytes); Length = 292 words (1168 bytes) Decompressed = 4218 bytes
 * File 5: Offset = 1490 words (5960 bytes); Length = 558 words (2232 bytes) Decompressed = 5421 bytes
Block 21:
 * File 0: Offset = 16 words (64 bytes); Length = 321 words (1284 bytes) Decompressed = 4632 bytes
 * File 1: Offset = 337 words (1348 bytes); Length = 328 words (1312 bytes) Decompressed = 4548 bytes
 * File 2: Offset = 665 words (2660 bytes); Length = 329 words (1316 bytes) Decompressed = 4795 bytes
 * File 3: Offset = 994 words (3976 bytes); Length = 194 words (776 bytes) Decompressed = 2839 bytes
 * File 4: Offset = 1188 words (4752 bytes); Length = 239 words (956 bytes) Decompressed = 3430 bytes
 * File 5: Offset = 1427 words (5708 bytes); Length = 237 words (948 bytes) Decompressed = 1475 bytes
 * File 6: Offset = 1664 words (6656 bytes); Length = 384 words (1536 bytes) Decompressed = 3604 bytes
Block 22:
 * File 0: Offset = 16 words (64 bytes); Length = 283 words (1132 bytes) Decompressed = 3954 bytes
 * File 1: Offset = 299 words (1196 bytes); Length = 159 words (636 bytes) Decompressed = 2247 bytes
 * File 2: Offset = 458 words (1832 bytes); Length = 226 words (904 bytes) Decompressed = 3156 bytes
 * File 3: Offset = 684 words (2736 bytes); Length = 254 words (1016 bytes) Decompressed = 3497 bytes
 * File 4: Offset = 938 words (3752 bytes); Length = 309 words (1236 bytes) Decompressed = 4365 bytes
 * File 5: Offset = 1247 words (4988 bytes); Length = 224 words (896 bytes) Decompressed = 3045 bytes
 * File 6: Offset = 1471 words (5884 bytes); Length = 577 words (2308 bytes) Decompressed = 6211 bytes
Block 23:
 * File 0: Offset = 16 words (64 bytes); Length = 328 words (1312 bytes) Decompressed = 4671 bytes
 * File 1: Offset = 344 words (1376 bytes); Length = 255 words (1020 bytes) Decompressed = 3619 bytes
 * File 2: Offset = 599 words (2396 bytes); Length = 221 words (884 bytes) Decompressed = 3036 bytes
 * File 3: Offset = 820 words (3280 bytes); Length = 290 words (1160 bytes) Decompressed = 4055 bytes
 * File 4: Offset = 1110 words (4440 bytes); Length = 267 words (1068 bytes) Decompressed = 3760 bytes
 * File 5: Offset = 1377 words (5508 bytes); Length = 224 words (896 bytes) Decompressed = 3017 bytes
 * File 6: Offset = 1601 words (6404 bytes); Length = 277 words (1108 bytes) Decompressed = 4012 bytes
 * File 7: Offset = 1878 words (7512 bytes); Length = 170 words (680 bytes) Decompressed = 2300 bytes
Block 24:
 * File 0: Offset = 16 words (64 bytes); Length = 222 words (888 bytes) Decompressed = 3146 bytes
 * File 1: Offset = 238 words (952 bytes); Length = 178 words (712 bytes) Decompressed = 2509 bytes
 * File 2: Offset = 416 words (1664 bytes); Length = 321 words (1284 bytes) Decompressed = 95 bytes
 * File 3: Offset = 737 words (2948 bytes); Length = 190 words (760 bytes) Decompressed = 2489 bytes
 * File 4: Offset = 927 words (3708 bytes); Length = 249 words (996 bytes) Decompressed = 3566 bytes
 * File 5: Offset = 1176 words (4704 bytes); Length = 198 words (792 bytes) Decompressed = 2811 bytes
 * File 6: Offset = 1374 words (5496 bytes); Length = 205 words (820 bytes) Decompressed = 2804 bytes
 * File 7: Offset = 1579 words (6316 bytes); Length = 469 words (1876 bytes) Decompressed = 4372 bytes
Block 25:
 * File 0: Offset = 16 words (64 bytes); Length = 328 words (1312 bytes) Decompressed = 4674 bytes
 * File 1: Offset = 344 words (1376 bytes); Length = 232 words (928 bytes) Decompressed = 3331 bytes
 * File 2: Offset = 576 words (2304 bytes); Length = 121 words (484 bytes) Decompressed = 1645 bytes
 * File 3: Offset = 697 words (2788 bytes); Length = 302 words (1208 bytes) Decompressed = 4312 bytes
 * File 4: Offset = 999 words (3996 bytes); Length = 224 words (896 bytes) Decompressed = 3298 bytes
 * File 5: Offset = 1223 words (4892 bytes); Length = 225 words (900 bytes) Decompressed = 3147 bytes
 * File 6: Offset = 1448 words (5792 bytes); Length = 176 words (704 bytes) Decompressed = 2379 bytes
 * File 7: Offset = 1624 words (6496 bytes); Length = 151 words (604 bytes) Decompressed = 2218 bytes
 * File 8: Offset = 1775 words (7100 bytes); Length = 273 words (1092 bytes) Decompressed = 3431 bytes
Block 26:
 * File 0: Offset = 16 words (64 bytes); Length = 295 words (1180 bytes) Decompressed = 4199 bytes
 * File 1: Offset = 311 words (1244 bytes); Length = 248 words (992 bytes) Decompressed = 3698 bytes
 * File 2: Offset = 559 words (2236 bytes); Length = 257 words (1028 bytes) Decompressed = 3583 bytes
 * File 3: Offset = 816 words (3264 bytes); Length = 285 words (1140 bytes) Decompressed = 3856 bytes
 * File 4: Offset = 1101 words (4404 bytes); Length = 277 words (1108 bytes) Decompressed = 3797 bytes
 * File 5: Offset = 1378 words (5512 bytes); Length = 319 words (1276 bytes) Decompressed = 4333 bytes
 * File 6: Offset = 1697 words (6788 bytes); Length = 351 words (1404 bytes) Decompressed = 3285 bytes
Block 27:
 * File 0: Offset = 16 words (64 bytes); Length = 268 words (1072 bytes) Decompressed = 3873 bytes
 * File 1: Offset = 284 words (1136 bytes); Length = 291 words (1164 bytes) Decompressed = 4060 bytes
 * File 2: Offset = 575 words (2300 bytes); Length = 372 words (1488 bytes) Decompressed = 5227 bytes
 * File 3: Offset = 947 words (3788 bytes); Length = 413 words (1652 bytes) Decompressed = 5764 bytes
 * File 4: Offset = 1360 words (5440 bytes); Length = 688 words (2752 bytes) Decompressed = 5795 bytes
Block 28:
 * File 0: Offset = 16 words (64 bytes); Length = 388 words (1552 bytes) Decompressed = 5609 bytes
 * File 1: Offset = 404 words (1616 bytes); Length = 351 words (1404 bytes) Decompressed = 4959 bytes
 * File 2: Offset = 755 words (3020 bytes); Length = 303 words (1212 bytes) Decompressed = 4284 bytes
 * File 3: Offset = 1058 words (4232 bytes); Length = 319 words (1276 bytes) Decompressed = 4432 bytes
 * File 4: Offset = 1377 words (5508 bytes); Length = 671 words (2684 bytes) Decompressed = 7562 bytes
Block 29:
 * File 0: Offset = 16 words (64 bytes); Length = 366 words (1464 bytes) Decompressed = 5252 bytes
 * File 1: Offset = 382 words (1528 bytes); Length = 404 words (1616 bytes) Decompressed = 5666 bytes
 * File 2: Offset = 786 words (3144 bytes); Length = 438 words (1752 bytes) Decompressed = 6227 bytes
 * File 3: Offset = 1224 words (4896 bytes); Length = 447 words (1788 bytes) Decompressed = 6421 bytes
 * File 4: Offset = 1671 words (6684 bytes); Length = 377 words (1508 bytes) Decompressed = 4462 bytes
Block 30:
 * File 0: Offset = 16 words (64 bytes); Length = 464 words (1856 bytes) Decompressed = 6521 bytes
 * File 1: Offset = 480 words (1920 bytes); Length = 463 words (1852 bytes) Decompressed = 6663 bytes
 * File 2: Offset = 943 words (3772 bytes); Length = 448 words (1792 bytes) Decompressed = 6223 bytes
 * File 3: Offset = 1391 words (5564 bytes); Length = 253 words (1012 bytes) Decompressed = 3633 bytes
 * File 4: Offset = 1644 words (6576 bytes); Length = 404 words (1616 bytes) Decompressed = 3745 bytes
Block 31:
 * File 0: Offset = 16 words (64 bytes); Length = 254 words (1016 bytes) Decompressed = 3561 bytes
 * File 1: Offset = 270 words (1080 bytes); Length = 117 words (468 bytes) Decompressed = 1625 bytes
 * File 2: Offset = 387 words (1548 bytes); Length = 287 words (1148 bytes) Decompressed = 4078 bytes
 * File 3: Offset = 674 words (2696 bytes); Length = 267 words (1068 bytes) Decompressed = 3622 bytes
 * File 4: Offset = 941 words (3764 bytes); Length = 231 words (924 bytes) Decompressed = 3099 bytes
 * File 5: Offset = 1172 words (4688 bytes); Length = 136 words (544 bytes) Decompressed = 1834 bytes
 * File 6: Offset = 1308 words (5232 bytes); Length = 353 words (1412 bytes) Decompressed = 2924 bytes
 * File 7: Offset = 1661 words (6644 bytes); Length = 387 words (1548 bytes) Decompressed = 4018 bytes
Block 32:
 * File 0: Offset = 16 words (64 bytes); Length = 500 words (2000 bytes) Decompressed = 7099 bytes
 * File 1: Offset = 516 words (2064 bytes); Length = 301 words (1204 bytes) Decompressed = 4243 bytes
 * File 2: Offset = 817 words (3268 bytes); Length = 234 words (936 bytes) Decompressed = 3414 bytes
 * File 3: Offset = 1051 words (4204 bytes); Length = 171 words (684 bytes) Decompressed = 2428 bytes
 * File 4: Offset = 1222 words (4888 bytes); Length = 181 words (724 bytes) Decompressed = 2653 bytes
 * File 5: Offset = 1403 words (5612 bytes); Length = 11 words (44 bytes) Decompressed = 138 bytes
 * File 6: Offset = 1414 words (5656 bytes); Length = 11 words (44 bytes) Decompressed = 138 bytes
 * File 7: Offset = 1425 words (5700 bytes); Length = 11 words (44 bytes) Decompressed = 138 bytes
 * File 8: Offset = 1436 words (5744 bytes); Length = 11 words (44 bytes) Decompressed = 138 bytes
 * File 9: Offset = 1447 words (5788 bytes); Length = 11 words (44 bytes) Decompressed = 138 bytes
 * File 10: Offset = 1458 words (5832 bytes); Length = 590 words (2360 bytes) Decompressed = 2194 bytes
Save for the end block size everything else looks the same. (and I had decompressed size too).

Cyb

gigaherz

  • Crazy poster
  • *
  • Posts: 105
  • Karma: 0
    • View Profile
    • gigaherz's shitty stuff
Re: Battle script (SCENE.BIN) + more
« Reply #19 on: 2007-01-29 12:35:19 »
I checked the uncompressed sizes, and ALL of them give me 7808 bytes, without exception. I made a basic "checksum" calculation for the blocks, and most of them give me different values, meaning there is different data, xcept for a few files that are empty (the ones that compress to only 11 words).
From that I deduce your decompression method doesn't work as it should.

OK I defined the structs in the wiki and managed to get coherent enemy info:
Code: [Select]
...
 * File 8: Offset = 1187 words (4748 bytes); Length = 180 words (720 bytes); Uncompressed = 7808; Checksum = 6dd434fc
 * * Enemy IDs: 72, 73, 74
 * * Battle Locations: 67, 67, 67, 67
 * * Enemy 0: Devil Ride  level 13.
 * * Enemy 1: Custom Sweeper  level 15.
 * * Enemy 2: Kalm Fang  level 10.
 * File 9: Offset = 1367 words (5468 bytes); Length = 230 words (920 bytes); Uncompressed = 7808; Checksum = 35f32891
 * * Enemy IDs: 73, 74, 75
 * * Battle Locations: 67, 67, 2, 2
 * * Enemy 0: Custom Sweeper  level 15.
 * * Enemy 1: Kalm Fang  level 10.
 * * Enemy 2: Prowler  level 12.
 * File 10: Offset = 1597 words (6388 bytes); Length = 211 words (844 bytes); Uncompressed = 7808; Checksum = da779ba6
 * * Enemy IDs: 72, 74, 75
 * * Battle Locations: 2, 2, 2, 2
 * * Enemy 0: Devil Ride  level 13.
 * * Enemy 1: Kalm Fang  level 10.
 * * Enemy 2: Prowler  level 12.
...

other names show weird chars so I assume they are either "leftovers" from the japanese version (debug enemies?), or special codes for other things:
Code: [Select]
* File 0: Offset = 16 words (64 bytes); Length = 177 words (708 bytes); Uncompressed = 7808; Checksum = 90385f1c
 * * Enemy IDs: 0, 1, 2
 * * Battle Locations: 0, 4, 0, 49
 * * Enemy 0: œ™0(Š–) level 3.
 * * Enemy 1: œ™1() level 2.
 * * Enemy 2: œ™2(–) level 4.
 * File 1: Offset = 193 words (772 bytes); Length = 112 words (448 bytes); Uncompressed = 7808; Checksum = b7d0083f
 * * Enemy IDs: 4, 5, 6
 * * Battle Locations: 4, 4, 67, 7
 * * Enemy 0: œ™4(‘š) level 6.
 * * Enemy 1: œ™5(‡–™) level 7.
 * * Enemy 2: œ™6(–‰) level 4.
 * File 2: Offset = 305 words (1220 bytes); Length = 197 words (788 bytes); Uncompressed = 7808; Checksum = 995d2f8e
 * * Enemy IDs: 0, 2, 4
 * * Battle Locations: 30, 23, 0, 0
 * * Enemy 0: œ™0(Š–) level 3.
 * * Enemy 1: œ™2(–) level 4.
 * * Enemy 2: œ™4(‘š) level 6.
 * File 3: Offset = 502 words (2008 bytes); Length = 80 words (320 bytes); Uncompressed = 7808; Checksum = 595d3c7e
 * * Enemy IDs: 7, 8, 9
 * * Battle Locations: 0, 0, 0, 0
 * * Enemy 0: œ™7(œ–A) level 4.
 * * Enemy 1: œ™8(œ–B) level 4.
 * * Enemy 2: œ™9(œ–C) level 4.
 * File 5: Offset = 593 words (2372 bytes); Length = 240 words (960 bytes); Uncompressed = 7808; Checksum = 2603d575
 * * Enemy IDs: 0, 57, 58
 * * Battle Locations: 58, 71, 0, 0
 * * Enemy 0: œ™0(Š–) level 3.
 * * Enemy 1: Mighty Grunt  level 12.
 * * Enemy 2: Mighty Grunt  level 12.
 * File 6: Offset = 833 words (3332 bytes); Length = 213 words (852 bytes); Uncompressed = 7808; Checksum = 18288071
 * * Enemy IDs: 0, 1, 172
 * * Battle Locations: 0, 0, 23, 85
 * * Enemy 0: œ™0(Š–) level 3.
 * * Enemy 1: œ™1() level 2.
 * * Enemy 2: Adamantaimai level 30.
 * File 1: Offset = 270 words (1080 bytes); Length = 117 words (468 bytes); Uncompressed = 7808; Checksum = 6fd6f46f
 * * Enemy IDs: 0, -1, -1
 * * Battle Locations: 4, 4, 4, 4
 * * Enemy 0: œ™0(Š–) level 3.
 * File 2: Offset = 387 words (1548 bytes); Length = 287 words (1148 bytes); Uncompressed = 7808; Checksum = c078c605
 * * Enemy IDs: 0, 233, -1
 * * Battle Locations: 37, 4, 4, 4
 * * Enemy 0: œ™0(Š–) level 3.
 * * Enemy 1: Tonberry  level 25.
 * File 2: Offset = 817 words (3268 bytes); Length = 234 words (936 bytes); Uncompressed = 7808; Checksum = 40a26a06
 * * Enemy IDs: 2, 335, -1
 * * Battle Locations: 60, 60, 60, 60
 * * Enemy 0: œ™2(–) level 4.
 * * Enemy 1: Ultimate Weapon level 61.
 * File 4: Offset = 1222 words (4888 bytes); Length = 181 words (724 bytes); Uncompressed = 7808; Checksum = 18ded3fc
 * * Enemy IDs: 0, 2, -1
 * * Battle Locations: 4, 4, 52, 0
 * * Enemy 0: œ™0(Š–) level 3.
 * * Enemy 1: œ™2(–) level 4.

EDIT: I have been trying to figure out how to "get" the script length, but I'm starting to think there isn't any length marker and the scripts just exit when they are done executing...
« Last Edit: 2007-01-29 14:08:18 by gigaherz »

Cyberman

  • No life
  • *
  • Posts: 1575
  • Karma: 8
    • View Profile
Re: Battle script (SCENE.BIN) + more
« Reply #20 on: 2007-01-29 15:50:09 »
I checked the uncompressed sizes, and ALL of them give me 7808 bytes, without exception. I made a basic "checksum" calculation for the blocks, and most of them give me different values, meaning there is different data, xcept for a few files that are empty (the ones that compress to only 11 words).
From that I deduce your decompression method doesn't work as it should.
That would be my conclusion too. Dang what a pain. It works perfect for everything else I've used it for though. When is a bug a feature? :D  I must be missing something specific in the decompression algorythm or I might be starting at the wrong location (the latter might be more likely).

EDIT: I have been trying to figure out how to "get" the script length, but I'm starting to think there isn't any length marker and the scripts just exit when they are done executing...
Script Length? No length marker that I am aware of I believe since the record size is fixed to 7808 bytes that means that you check if there are any scripts.  Then after that you perform much the same computation as you did to find the compressed file lengths (between scripts) the final one can be done using the end of the record. If you have one script though it means from the offset to the end of record is the AI.  There are a few battles that are like that.  Look at the ProudClod battle that might help.

Cyb

gigaherz

  • Crazy poster
  • *
  • Posts: 105
  • Karma: 0
    • View Profile
    • gigaherz's shitty stuff
Re: Battle script (SCENE.BIN) + more
« Reply #21 on: 2007-01-29 20:01:24 »
Script Length? No length marker that I am aware of I believe since the record size is fixed to 7808 bytes that means that you check if there are any scripts.  Then after that you perform much the same computation as you did to find the compressed file lengths (between scripts) the final one can be done using the end of the record. If you have one script though it means from the offset to the end of record is the AI.  There are a few battles that are like that.  Look at the ProudClod battle that might help.

Cyb

Ok done I had some troubles to figure out WHERE did the offsets start to count from: the first byte of the ai is the first byte of the offsets, so offset=6 is the first byte of actual data!

After that, each AI has a 16-entry script table with the offset counting from the start of the AI, so script_offset=0 would be the first byte of the table.

I have noticed all/most (haven't read all of them) end with a 0x73 byte, so I'm assuming opcode73=RET
Based on that assumption ("all scripts will end with a 0x73") I will also assume all the 0xFF bytes at the end are padding, and I will cut them (else the dump grows to 7mb).

EDIT: I did that, checked the last byte of all the scripts and yes, all of them, without exception, have a 0x73 as the last opcode.

EDIT2: As it's way too big to paste in a code block, I uploaded the output of my program to sendspace in case anyone wants to look at it.
« Last Edit: 2007-01-29 20:22:47 by gigaherz »

Cyberman

  • No life
  • *
  • Posts: 1575
  • Karma: 8
    • View Profile
Re: Battle script (SCENE.BIN) + more
« Reply #22 on: 2007-01-30 16:05:55 »
What are you using to decompress each file in SCENE.BIN? I'm using much the same algorythm that's used in Q-gears. Ditto with you?

Cyb

gigaherz

  • Crazy poster
  • *
  • Posts: 105
  • Karma: 0
    • View Profile
    • gigaherz's shitty stuff
Re: Battle script (SCENE.BIN) + more
« Reply #23 on: 2007-01-30 17:10:27 »
I copied the code from qgears, and changed it to "fit" in my program, so basically I changed the parameters and return value, so I pass it a pointer and get the pointer to the uncompressed data as return value, and the size in a int pointer.

Cyberman

  • No life
  • *
  • Posts: 1575
  • Karma: 8
    • View Profile
Re: Battle script (SCENE.BIN) + more
« Reply #24 on: 2007-01-31 02:26:04 »
Ok well I used the code from Q-gears, the output and results are identical to my code.  Dare I ask are you doing something different? Somehow?
my first set of codes from the first file are (undecoded)
Code: [Select]
1F8B08000000000000000203ED96