Author Topic: CC Weapon Pack Structure  (Read 8742 times)

Satoh

  • CC:DBT Dream Team
  • Magical Dreamer (+1250)
  • *
  • Posts: 1291
  • Am I your dream... or are you mine...?
    • View Profile
CC Weapon Pack Structure
« on: June 14, 2008, 08:20:45 pm »
Ok, I noticed a repeating pattern in the weapon .OUTs, it starts roughly roughly 60 lines from the very beginning of the 3rd section. In Serge's case its at 2790 and in Kid's case it is at 2530...

I believe it may be either the names of the weapons or maybe the stats, I think its worth investigating...


But I have little experience with this type of thing...

original message:
First let me say, I'm new to the whole hex exploring, but I think I've found something regarding stats or something in the weapon packs...

starting at 2790 (in serge's weapons) there's a set of data that has a repeating pattern... it repeats 7 times, once for each weapon in Serge's list it looks like... now, some places are filled with 0 that others have a number, typically only one or two entries have a 00 byte at either the beginning or end that the others don't. I assume this is for things like special effects that weapons as individuals have, but other weapons of the same type(swallow) don't have. then again, it could be something as simple as a naming convention.... but there's 7 similarly structured entries in an even spacing from eachother, it may be worthwhile to look at it....

but like I said, it may just be the ramblings of someone completely inexperienced... I'm going to check other packs for similar data...

EDIT: this data pattern is present in the 3rd section of both Serge and Kid's weapons, about 15 60 lines from the beginning of the section.
« Last Edit: June 14, 2008, 08:48:13 pm by Satoh »

MDenham

  • CC:DBT Dream Team
  • Chronopolitan (+300)
  • *
  • Posts: 330
  • Glowsticks are not a weapon.
    • View Profile
    • Java IRC - konata.echoes-online.com
Re: CC Weapon Pack Structure
« Reply #1 on: June 15, 2008, 02:22:49 am »
Mind attaching, at the very least, the one for Serge's weapons?  I'll take a look at it when I've got a moment (i.e. sometime this weekend, probably).

Satoh

  • CC:DBT Dream Team
  • Magical Dreamer (+1250)
  • *
  • Posts: 1291
  • Am I your dream... or are you mine...?
    • View Profile
Re: CC Weapon Pack Structure
« Reply #2 on: June 15, 2008, 02:52:00 am »
Sure thing, here's the three first weapon packs...

 each file theoretically contains all the weapon data for a given character, attached are

Serge(3057), Kid(3060), and Guile's(3063) weapon data

pop it into a hex editor and see if you can come up with anything... I'm a novice at this, but I'm trying to at least get the weapon data started...

[attachment deleted by admin]

FaustWolf

  • Guru of Time Emeritus
  • Arbiter (+8000)
  • *
  • Posts: 8972
  • Fan Power Advocate
    • View Profile
Re: CC Weapon Pack Structure
« Reply #3 on: June 15, 2008, 03:04:44 am »
Also MDenham, the weapon packs may be structured as follows, based on the very quick look at them I took a few months back:

*Some preliminary data, perhaps pointers to each weapon in the pack
*Texture (Classic TIM format)
*Weapon Model
*Texture (Classic TIM format)
*Weapon Model
etc., etc. I'm really not positive on the order though, and I think there's got to be data specifying the color of the weapon trail; thus the swallow leaves a white trail, Fargo's swords leave blue trails, and Glenn's swords leave green trails.

Also, the weapon models will not begin with the signature 06 00 00 00 20 00 00 00 because they lack their own animation data as far as I can tell, and will theoretically have fewer sections; the weapon animations are incorporated into the model animations.

Satoh

  • CC:DBT Dream Team
  • Magical Dreamer (+1250)
  • *
  • Posts: 1291
  • Am I your dream... or are you mine...?
    • View Profile
Re: CC Weapon Pack Structure
« Reply #4 on: June 15, 2008, 03:20:26 am »
Also MDenham, the weapon packs may be structured as follows, based on the very quick look at them I took a few months back:

*Some preliminary data, perhaps pointers to each weapon in the pack
*Texture (Classic TIM format)
*Weapon Model
*Texture (Classic TIM format)
*Weapon Model
etc., etc. I'm really not positive on the order though, and I think there's got to be data specifying the color of the weapon trail; thus the swallow leaves a white trail, Fargo's swords leave blue trails, and Glenn's swords leave green trails.

Also, the weapon models will not begin with the signature 06 00 00 00 20 00 00 00 because they lack their own animation data as far as I can tell, and will theoretically have fewer sections; the weapon animations are incorporated into the model animations.

Did you just hear yourself? You might have inadvertantly solved something. That data could very well be in the character file, think about it, the trail follow's the chcaracter's innate element... granted it could be in the weapon packs as they are per-character-exclusive, but it might explain some of the unknowns in the character models... (BTW, Odin, nice choice.. interested in ripping Valkyrie Profile sprites at some point? XD )

Anyway, what happens to the weapon trails when you zero out the VDDM? And do the characters still blink after you do?

FaustWolf

  • Guru of Time Emeritus
  • Arbiter (+8000)
  • *
  • Posts: 8972
  • Fan Power Advocate
    • View Profile
Re: CC Weapon Pack Structure
« Reply #5 on: June 15, 2008, 03:45:20 am »
Those are excellent questions, and I'll do some tests with the VDDM later just to rule such things out. The most important reason why I believe the weapon trails are specific to the weapon packs is that when I attempted a Dark Serge hack a few months back, I overwrote Dark Serge's model over NeoFio's, and due to not having found the battle model pointers, I had to make do with giving Dark Serge NeoFio's weapon pack. The results were understandably not pretty, but Dark Serge was attacking with green trails all over the place. I haven't the foggiest idea what controls the eyeball blinks.

Yeah, I've been obsessed with Valkyrie Profile portraits for about a year now, and thanks to the Tia battle texture exercise, I became confident enough to sic creaothceann's VRAM viewer on a VP VRAM dump, and for the first time I've been successful in ripping a VP portrait straight from VRAM. The portraits are split up into dozens of nice little chunks, making assembly a huge pain. I'm going to rip choice portraits over time though, because they're rockin'. Both the portraits and sprites are apparently compressed or encrypted on the game image, and all ripping stopped once Oddigy disappeared from the Internets; she was one of the great graphics hacking gurus.

MagilsugaM

  • CC:DBT Dream Team
  • Time Traveler (+800)
  • *
  • Posts: 812
  • Never say never... Nothing is impossible...
    • View Profile
Re: CC Weapon Pack Structure
« Reply #6 on: June 15, 2008, 03:58:42 am »
That sounds interesting if we can rip Lynx Scythe we can modify the texture to get diferent weapons for Magus...

Right? It will make a huge difference to have more weapons for him.

Satoh

  • CC:DBT Dream Team
  • Magical Dreamer (+1250)
  • *
  • Posts: 1291
  • Am I your dream... or are you mine...?
    • View Profile
Re: CC Weapon Pack Structure
« Reply #7 on: June 15, 2008, 04:15:22 am »
That sounds interesting if we can rip Lynx Scythe we can modify the texture to get diferent weapons for Magus...

Right? It will make a huge difference to have more weapons for him.

In theory, yes.

Those are excellent questions, and I'll do some tests with the VDDM later just to rule such things out. The most important reason why I believe the weapon trails are specific to the weapon packs is that when I attempted a Dark Serge hack a few months back, I overwrote Dark Serge's model over NeoFio's, and due to not having found the battle model pointers, I had to make do with giving Dark Serge NeoFio's weapon pack. The results were understandably not pretty, but Dark Serge was attacking with green trails all over the place. I haven't the foggiest idea what controls the eyeball blinks.

Yeah, I've been obsessed with Valkyrie Profile portraits for about a year now, and thanks to the Tia battle texture exercise, I became confident enough to sic creaothceann's VRAM viewer on a VP VRAM dump, and for the first time I've been successful in ripping a VP portrait straight from VRAM. The portraits are split up into dozens of nice little chunks, making assembly a huge pain. I'm going to rip choice portraits over time though, because they're rockin'. Both the portraits and sprites are apparently compressed or encrypted on the game image, and all ripping stopped once Oddigy disappeared from the Internets; she was one of the great graphics hacking gurus.

I ask because I made it my personal quest to be the first person to actually get a decent number of sprites from the game...because that are almost none... anywhere...

But I suppose I have enough things to rip anyway... even without VP, I have to rip model data from Megaman Legends 2, battle model data from FFIX, (unless somebody finally got around to viewing relevent models...) and eventually I hope to be able to rip from any of the plethora of .hack games....

(I have waaaaaaay too many goals...)

And wait, when you replaced NeoFio, did you replace ALL of it's data? if not, then you could still have the residual pieces of the VDDM.... anyway, I noticed those things were never mentioned in the original exploration thread and figured they might be the culprits.
« Last Edit: June 15, 2008, 04:21:27 am by Satoh »

FaustWolf

  • Guru of Time Emeritus
  • Arbiter (+8000)
  • *
  • Posts: 8972
  • Fan Power Advocate
    • View Profile
Re: CC Weapon Pack Structure
« Reply #8 on: June 15, 2008, 11:52:05 am »
My memory is a bit foggy on the experiment now, but I think Dark Serge's model overwrote the entirety of NeoFio and then some. But now I've thought of a conclusive experiment: overwrite Glenn's weapon pack with Fargo's, or better yet, overwrite Leena's weapons pack with Glenn's --I rather like the idea of Leena: Warrior Princess. Er, something. In any case, if the weapon trail changes, we know that the weapon packs themselves define the trails; if the trail does not change, then they are defined somewhere in the model data.

MDenham

  • CC:DBT Dream Team
  • Chronopolitan (+300)
  • *
  • Posts: 330
  • Glowsticks are not a weapon.
    • View Profile
    • Java IRC - konata.echoes-online.com
Re: CC Weapon Pack Structure
« Reply #9 on: June 15, 2008, 02:04:55 pm »
As far as the whole original idea - it's just graphical data at that point as well.  I think weapon textures are 64x128 (they're almost definitely 64 wide, and they seem like they're 128 high), and I can pin down the header for you - it's just a texture count, followed by pointers to the textures.  The last two or three entries in the header (varies by character, it seems - otherwise Kid's weapons are missing the last four bytes) are pretty much useless entries - the first two are to a sequence of 20 77 77 77, and the third is a sequence of 00 00 00 00.

This gives us usable textures numbered 0-D (14 total) for Serge and Guile and 0-B (12 total) for Kid.

Don't Serge and Guile have seven usable weapons each, and Kid has six?

Yourgingerestfan

  • CC:DBT Dream Team
  • Magical Dreamer (+1250)
  • *
  • Posts: 1404
  • im ginger ....your ginger ....were all ginger !
    • View Profile
Re: CC Weapon Pack Structure
« Reply #10 on: June 15, 2008, 02:07:47 pm »
omg leena warrior princess !!! luvin the idea !

FaustWolf

  • Guru of Time Emeritus
  • Arbiter (+8000)
  • *
  • Posts: 8972
  • Fan Power Advocate
    • View Profile
Re: CC Weapon Pack Structure
« Reply #11 on: June 15, 2008, 02:22:43 pm »
Epic file exploration, M. Thanks! Yes, 7 weapons for Serge and Guile and 6 for Kid if memory serves, so two textures per weapon. Excellent.

I'm still slogging through tech data to find summon models for the model pack, and after that I have to do a thought experiment to see whether I might have found how double textures work, but after that I shall get this documented. I'll do a Leena: Warrior Princess experiment since that idea is apparently going over well.

MagilsugaM, to address your earlier question, Thorn was working on a new scythe texture for Magus last I heard from him, which was a while ago. See if you can find some Chrono Trigger concept art for Magus' scythes, as that may give you and other interested artists some good direction. Not sure if said concept art exists though.

Satoh

  • CC:DBT Dream Team
  • Magical Dreamer (+1250)
  • *
  • Posts: 1291
  • Am I your dream... or are you mine...?
    • View Profile
Re: CC Weapon Pack Structure
« Reply #12 on: June 19, 2008, 12:19:53 am »
Ok, since I was wrong in my theory last time, I have no thoughts as to what may actually be stored here, but here is what I've noticed just recently

"new findings!

File: Serge WEP

section   length


1   0x1580

2   0x0E20

3   0x1580

4   0x0AF8

5   0x1580

6   0x0D30

7   0x1580

8   0x0E60

9   0x1580

A   0x0E18

B   0x1580

C   0x0C90

D   0x1580

E   0x0E84

F   0x1580

10   0x0004



EOF   0xA4F4


Take note, starting at section 1, every other section is the same length.

The sections in between are varying lengths, but are closely related...
I believe these secondary shorter sections use some form of compression, upon comparing
3 of them side by side, I noticed they share a lot of common bytes between them, and they
aren't just 00 bytes, there are a lot of strings strings formatted similar to this:
"80 23 00 08 08" in there that appear in the same places in all three files observed. One
file keeps the same pattern, but occasionally replaces 08 08 with 06 06 and similar.

Upon compairing two 1580 sections, it was notable that they share a similar pattern structure,
but that the patterns do not match or even begin and end in the same place in the section.

One file began it's pattern a full 20 lines earlier than another, though they both contain an
almost Identical subheader.

Further comparison revealed that the patterns are very similar in structure, but containing
no similar bytes and again, starting in different places..."


I have not applied these data to any other pack as of yet, but I did think the information from Serge's pack is definitely worth noting.

Also note that the short-blocks number in 7 while the long-blocks number 8. Serge has 7 weapons. (unless one was removed, in which he could have 8 )

Eiter way, the information is promising.
« Last Edit: June 19, 2008, 02:48:36 am by Satoh »

Satoh

  • CC:DBT Dream Team
  • Magical Dreamer (+1250)
  • *
  • Posts: 1291
  • Am I your dream... or are you mine...?
    • View Profile
Re: CC Weapon Pack Structure
« Reply #13 on: June 19, 2008, 04:01:36 am »
Based on a comment FaustWolf gave me in a PM about classic TIM headers, I have pulled one of the 1580 segments out, "Classic TIM headers usually start with 10 00 00 00" and the 1580 segments, in fact, start with that very 4byte entry.

I have confirmed that the segments of interest are in fact textures, though I have as of yet been unable to find a working palette offset, so I assume the correct palette is stored elsewhere in the file.

Now I will look through the smaller blocks...

MDenham

  • CC:DBT Dream Team
  • Chronopolitan (+300)
  • *
  • Posts: 330
  • Glowsticks are not a weapon.
    • View Profile
    • Java IRC - konata.echoes-online.com
Re: CC Weapon Pack Structure
« Reply #14 on: June 19, 2008, 09:17:07 pm »
Based on a comment FaustWolf gave me in a PM about classic TIM headers, I have pulled one of the 1580 segments out, "Classic TIM headers usually start with 10 00 00 00" and the 1580 segments, in fact, start with that very 4byte entry.

I have confirmed that the segments of interest are in fact textures, though I have as of yet been unable to find a working palette offset, so I assume the correct palette is stored elsewhere in the file.
The palettes are right at the beginning of each entry - from the looks of it, they're all 16-color textures, and therefore two pixels per byte in the image data (which matches the 0b1000 in the header's flags - 0b1 indicates that the CLUT exists, 0b00 indicates that it's 4bpp; the third bit there is apparently unused).  However, the "image length" portion of the header is shorter (2 bytes instead of four), and the X/Y/height/width numbers are in the wrong order :D - if we go in the order they "should" be in, we get a 32x85 image, rather than the 128x85 image it actually is.

So: on to the shorter sections, which are probably models (but who knows?)

Header: (examples taken from the first three weapons)
01 00 00 08 48 00 5E 00 E0 0B 00 00 28 00 00 00 14 00 00 00 02 00 00 00
01 00 00 08 39 00 46 00 30 09 00 00 28 00 00 00 14 00 00 00 02 00 00 00
01 00 00 08 43 00 58 00 18 0B 00 00 28 00 00 00 14 00 00 00 02 00 00 00


First things first - the red, green, maroon, and blue sections are identical every time.  The purple section is always an offset to the "end table", which seems to be vertex positions.  Unlike battle models, the index values are all zeroed.  The first two bytes in black seem to be a vertex count (based on hand counting); however, I'm not sure what the other two bytes are.

Does this help? :D