Author Topic: Chrono Cross exploration & file structure  (Read 40144 times)

FaustWolf

  • *
  • Posts: 60
    • View Profile
Re: Chrono Cross exploration & file structure
« Reply #50 on: 2007-11-08 04:32:09 »
Halkun, you're a walking PSX encyclopedia! Truly amazing!

Ah, so nothing wrong with GPU opcode discussion then. *Breathes sigh of relief* Is there any documentation on what GPU opcode / functions look like in assembly language, Halkun? (At least related to quads, if that's the only opcode that appears near model data) I didn't see anything about that on the wiki.


halkun

  • Global moderator
  • *
  • Posts: 2097
  • NicoNico :)
    • View Profile
    • Q-Gears Homepage
Re: Chrono Cross exploration & file structure
« Reply #51 on: 2007-11-08 04:40:03 »
The gpu opcodes are not in any language. How they work is you make a list of opcode commands that you want to the GPU to accomplish, line them all up in a row, and then fire them to the GPU for execution.

You can talk to the GPU two ways, by giving the opcode directly to the GPU, or by fireing them off via DMA. The GPU hand off only works one at a time. The DMA method is much faster and supports Ordering Tables (OT) or linked lists of GPU opcodes.

What makes OTs so easy is you can pre-rig your list of opcodes, and then use the GTE to sort each "triangle" opcode by Z depth. Then you have a paint order that the GPU can render triangles to the screen. (That's why they are called "ordering tables") In FF8, the texture data consisted of pre-made GPU packets that was missing some data (to be filled by the GTE).

Of course it's been almost 7 years since I looked at them.

FF7 was more HRC-ish when they were built.

 
« Last Edit: 2007-11-08 04:41:54 by halkun »

Akari

  • *
  • Posts: 766
    • View Profile
Re: Chrono Cross exploration & file structure
« Reply #52 on: 2007-11-08 15:45:32 »
The other is a "frame" format that simply holds all the angles for the bones in that frame.(used for the field characters)

In PSX format not that easy. It is not set all rotation for all bones, but only rotation for defined bones and to defined axis (many bones have only one or two axis for rotation). And, in addition root bone movement. And all this stored not frame by frame, but all rotations for 1 axis of one bone, next next axis, next bone and so on.

Lupus Erectus

  • Guest
Re: Chrono Cross exploration & file structure
« Reply #53 on: 2007-11-08 16:27:11 »
Speaking of animation formats, a few days ago I was trying to look at the Vagrant story animation data and watching some animations in-game I noticed they definately aren't skeletal like the TMD seems to be, but more like a list of vertex coordinates for each frame (like the MD2 of quake 2 I think) It's very noticeable on some weird monsters like the slimes and the Dark Eyes with theyr glowing and theyr texture "animations" but also on some humanoid models there are some visible distortions.
I guess Psy-Q doens't support anything like this, eh?

And Faustwolf, since VS and CC are both from Square and from the same age, I looked at those files you posted but they seem very different beasts.

FaustWolf

  • *
  • Posts: 60
    • View Profile
Re: Chrono Cross exploration & file structure
« Reply #54 on: 2007-11-08 16:39:15 »
Thanks for looking at the files, Lupus! Once we get past the hurdles associated with viewing Chrono Cross' models, Vagrant Story is actually very high on my list of games to explore next. Have you succeeded in viewing VS model data?

Lupus Erectus

  • Guest
Re: Chrono Cross exploration & file structure
« Reply #55 on: 2007-11-08 17:17:41 »
No, but I haven't really investigated, and probably I won't for a good while....
OTOH, some time ago I started uploading some VS data on http://www.datacrystal.org/wiki/Main_Page

ZeaLitY

  • Guest
Re: Chrono Cross exploration & file structure
« Reply #56 on: 2007-11-08 18:39:34 »
Quick question:

Code: [Select]
Headers example
                                    00 00 00 00 64 65 67 75              ....degu
04 00 22 01 00 00 00 00 64 65 67 31 04 00 22 01 00 00 00 00  ..".....deg1..".....
64 65 67 32 04 00 22 01 00 00 00 00 64 65 67 33 04 00 22 01  deg2..".....deg3..".
00 00 00 00 64 65 67 34 04 00 22 01 00 00 00 00 64 65 67 35  ....deg4..".....deg5
04 00 22 01 00 00 00 00 65 6e 6b 65 04 00 22 08 00 00 00 00  ..".....enke..".....
65 6e 6b 31 04 00 22 04 00 00 00 00 67 61 6b 65 04 00 22 01  enk1..".....gake..".
00 00 00 00 67 61 6b 31 04 00 22 01 00 00 00 00 67 61 6b 32  ....gak1..".....gak2
04 00 22 01 00 00 00 00 67 61 6b 33 04 00 22 01 00 00 00 00  ..".....gak3..".....
67 61 6b 34 04 00 22 01 00 00 00 00 67 61 6b 35 04 00 22 01  gak4..".....gak5..".
00 00 00 00 67 61 6b 36 04 00 22 01 00 00 00 00 67 61 6b 37  ....gak6..".....gak7
04 00 22 01 00 00 00 00 67 61 6b 38 04 00 22 01 00 00 00 00  ..".....gak8..".....
67 73 30 31 04 00 22 01 00 00 00 00 67 73 30 32 04 00 22 01  gs01..".....gs02..".
00 00 00 00 67 73 30 33 04 00 22 01 00 00 00 00 67 73 30 34  ....gs03..".....gs04
04 00 22 01 00 00 00 00 67 75 30 31 04 00 22 01 00 00 00 00  ..".....gu01..".....
67 75 30 32 04 00 22 01 00 00 00 00 67 75 30 33 04 00 22 01  gu02..".....gu03..".
00 00 00 00 67 75 30 34 04 00 22 01 00 00 00 00 6a 69 6d 65  ....gu04..".....jime
04 00 22 01 00 00 00 00 6a 69 6d 31 04 00 22 01 00 00 00 00  ..".....jim1..".....
6a 69 6d 32 04 00 22 01 00 00 00 00 6a 69 6d 33 04 00 22 01  jim2..".....jim3..".
00 00 00 00 6a 69 6d 34 04 00 22 01 00 00 00 00 6b 75 6d 6f  ....jim4..".....kumo
04 00 22 02 00 00 00 00 6b 61 6e 6b 04 00 22 04              ..".....kank..".

Would those be the actual filenames for the TIMs? These three byte headers go before each TIM in the battle data. I think pretty soon we can begin asset extraction in the files produced by Yazoo's tools at the Compendium...sort of like, getting identifiable data out of OUT files, leaving the rest / deleting them if they are completely convertible.
« Last Edit: 2007-11-08 18:44:29 by ZeaLitY »

Akari

  • *
  • Posts: 766
    • View Profile
Re: Chrono Cross exploration & file structure
« Reply #57 on: 2007-11-08 19:06:48 »
Speaking of animation formats, a few days ago I was trying to look at the Vagrant story animation data and watching some animations in-game I noticed they definately aren't skeletal like the TMD seems to be, but more like a list of vertex coordinates for each frame (like the MD2 of quake 2 I think) It's very noticeable on some weird monsters like the slimes and the Dark Eyes with theyr glowing and theyr texture "animations" but also on some humanoid models there are some visible distortions.

This is common sence in bones animation. Each vertex has weight parameter bones (or how much bone movement influence it). You can set vertex linked to two bones at once, so you will see ettect of distortion (when dress move and stretch). This was used in FFIX.

FaustWolf

  • *
  • Posts: 60
    • View Profile
Re: Chrono Cross exploration & file structure
« Reply #58 on: 2007-11-08 23:50:07 »
This is posted at the Chrono Compendium also, but I'm reproducing here. It relates to a comparison I'm attempting between FF8 model data and Chrono Cross model data:

I've just done some investigation of the data following Zell's battle model texture(s) in my disassembler (because viewing data through a disassembler makes me feel cool  8-)), and it appears the data immediately following Zell's texture starts with the following assembly language instructions:

dsrav zero, zero, zero
sync
dsllv  zero, zero, zero

Halkun, does this provide any clue as to whether or not I'm looking at quad opcodes? Or, an alternative question, how is one able to tell that he/she is even looking at quad opcodes?  :oops:

And I've got a few quick questions about your PSX doc, which I am still reading through (rather haphazardly, as time allows):

1.) In your GPU packet command list, "0x2c" constitutes a packet command for a textured 4-point polygon. What would that look like in hex? Just "2C"? And would that appear in a quad opcode?

2.) You differentiate between "monochrome" and "textured" polygons. Would I be correct in stating that Final Fantasy 7 uses monochrome polygons (excluding faces, I guess?), whereas Final Fantasy 8 (and, by association, Chrono Cross) uses textured polygons? This is an obvious NooB question, but I just want to make sure.

EDIT: I received your answer on Chrono Compendium Halkun! Thanx!
« Last Edit: 2007-11-09 02:00:02 by FaustWolf »

FaustWolf

  • *
  • Posts: 60
    • View Profile
Re: Chrono Cross exploration & file structure
« Reply #59 on: 2007-11-10 22:47:51 »
Posting this here for maximum exposure; it's on the Compendium as well:

The "Uknown Data" in my ModelMine1 post can now be referred to as "Model Data." :D

Here's tonight's update. The vid quality is less than I would have liked, but hopefully we can find some insight within its grainy-ness. No sound either; I'll report later as to whether the "Chimera" uses Kid's or Serge's sounds in battle, because I've forgotten. :-D

The first video is just a demonstration of how the characters Serge and Kid look in battle. Folks already familiar with Chrono Cross battle models can probably skip to the second vid, but this provides a useful reference:
http://www.youtube.com/watch?v=uxts0pisnI0

Now the fun begins. As boring as it will be at times, please watch this in its entirety to get a full impression of what's going on with the model data. The final 30 seconds are especially important:
http://www.youtube.com/watch?v=Ysh*t-thL5Q

Please finish the web address of the second vid with the letter "I". Silly Youtube. :roll:

As you can see, the "Chimera" is Serge's model data with Kid's battle texture. Serge's standing, running, and spell-casting animations have carried over, but not his physical attack animations for some reason. But a complicating factor is the significant difference in file size between Serge's and Kid's model data. Specifically (and surprisingly), Kid's model takes up 8184 bytes more in the game CD than Serge's! It could be that Kid's animations are more complex than Serge's or something, and therefore need more space.

I'll illustrate graphically what I did exactly. Below is a representation of Serge's battle model data (sans skin & eye blink textures). In ModelMine1, the unskinned model lasts from hex offsets 00009800 ~ 00014848:


The following is a representation of Kid's unskinned battle model data. I will release her battle data set - ModelMine2 - tomorrow evening, once I jot down some datamapping notes on it. Then we can find potential model file headers.


Now, with Serge's model data written over Kid's:


So some of Kid's model data is still left over. At some point I'll wipe the rest of the "red" (Kid) part out with 00 bytes and see how that changes things.

At least this shows that we've got battle models. Now, the question is how to go about deciphering the model format so it can be viewed in 3DS Max, Blender, etc.
« Last Edit: 2007-11-10 22:49:52 by FaustWolf »

Lupus Erectus

  • Guest
Re: Chrono Cross exploration & file structure
« Reply #60 on: 2007-11-11 10:23:23 »
I had a look at the "modelmine" file, I just noticed only now.
The file is nicely structured a header and relative offsets to subsections, and each subsection has a similar header. The only exception seems to be the (probable) model data starting at 9800, this may be hardcoded in the game code. Same for 14800 which is a header containig pointers to the other subsections until the end of the file.
Section 00009800 ~ 00014800:
the first $20 bytes are a header. The first value may be the number of sections, the others are relative the offsets (relative to the beginning of current section, that is). Some of the sections are similarly split in subsections. I have no clue what they may be :)
Section 14800 - end of file:
header as above; the "unknown" sections between weapon textures are certainly weapon models.
for example, the first is at 15dc8. From there:
    0-7 unknown
    8-11 offset to vertices section
    12-15 probably offset to unknown section (at 15df0)
        this seems to be made of groups of 4 bytes. I nocited some textures have weid coloring,
        maybe models are textured AND color shaded.  They could be RGB values. (but the 4th byte?)
    16-19 probably offset to unknown section (at 15ddc)
The vertices section is a Cyber said above: groups of 4 2-bytes values, the last is 00 00. Vagrant Story is like this both for characters and weapons, but your model data here seems different.
Note how the first value also is often 00 00 or little more, that's because of the flatness of weapon models. However the last value sometimes is 01 00 or 02 00  :|
   

FaustWolf

  • *
  • Posts: 60
    • View Profile
Re: Chrono Cross exploration & file structure
« Reply #61 on: 2007-11-11 14:06:53 »
Thanks Lupus! I'm copying your post and re-producing it at the Chrono Compendium, if you don't mind. Here's the latest updates there:

http://www.chronocompendium.com/Forums/index.php/topic,4770.msg83974.html#msg83974

ZeaLitY

  • Guest
Re: Chrono Cross exploration & file structure
« Reply #62 on: 2008-02-18 22:43:25 »
Just stopping in to report that the static model at rest has been (99%) successfully imported into Blender.



Thanks for the help, everyone.