Author Topic: Okay, Chrono Cross Textures  (Read 29027 times)

jono

  • Porrean (+50)
  • *
  • Posts: 64
    • View Profile
Re: Okay, Chrono Cross Textures
« Reply #45 on: October 14, 2007, 10:45:19 pm »
Maybe it's worth you guys looking for vertex arrays in vram/system ram of the emulator, you may just find model geometry. Just a thought, if theres tools to do it, the models will definitely be in the emulators ram somewhere, we just don't know what format.

Wrong thread I know but I could be worth a go.

FaustWolf

  • Guru of Time Emeritus
  • Arbiter (+8000)
  • *
  • Posts: 8972
  • Fan Power Advocate
    • View Profile
Re: Okay, Chrono Cross Textures
« Reply #46 on: October 14, 2007, 11:01:29 pm »
Ooh, I like the sound of that jono. And I agree - why shouldn't model data be in VRAM, darnit? If I gave you a VRAM dump, do you think you'd be able to locate model data? I know I can't myself, haha. But that's definitely something I'd like to explore. We just need the right tools.

EDIT: ...Unless the models would be decompressed in VRAM if it turns out that they're compressed in the .iso. Then I suppose looking for model data in VRAM might be easier than looking for it in the CD data itself.
« Last Edit: October 15, 2007, 12:20:43 am by FaustWolf »

jono

  • Porrean (+50)
  • *
  • Posts: 64
    • View Profile
Re: Okay, Chrono Cross Textures
« Reply #47 on: October 15, 2007, 10:26:28 am »
Sorry still wrong topic :)
I'll make sure this is my last post about modelling in the texture thread.

Even if we get exapmles of the model files, reverse engineering a model format would be very difficult, especialy if it is compressed and has a confusing animation format like ffvii models had. I think looking in system ram in an epsxe save state could be the way to go, I posted a bit more in depth about it in the model thread.

We'll hopefully get there eventually, I can't wait to finish uni this semester and have a really good look at this if it hasn't already been solved.

ZeaLitY

  • Entity
  • End of Timer (+10000)
  • *
  • Posts: 10797
  • Spring Breeze Dancin'
    • View Profile
    • My Compendium Staff Profile
Re: Okay, Chrono Cross Textures
« Reply #48 on: October 15, 2007, 11:17:53 am »
I'm going to tinker with the VRAM viewer. Did you guys see this? It's supposedly an emulator with a debugger built in. You're probably already aware of it, but:

http://www.romhacking.net/utils/311/
« Last Edit: October 15, 2007, 11:31:57 am by ZeaLitY »

FaustWolf

  • Guru of Time Emeritus
  • Arbiter (+8000)
  • *
  • Posts: 8972
  • Fan Power Advocate
    • View Profile
Re: Okay, Chrono Cross Textures
« Reply #49 on: October 15, 2007, 12:44:01 pm »
Oh-hoh-hoh-hoh. VERY nice find Zeality; no, I wasn't familiar with that emulator. That could at least point us in the right direction for model and other data, depending on whether the debugger tells where on the disc/iso it's pulling data from. I'll take a look at this later.

Yeah, once this semester is done for us all, we are so tearing Cross apart, and in a good way. :)

ZeaLitY

  • Entity
  • End of Timer (+10000)
  • *
  • Posts: 10797
  • Spring Breeze Dancin'
    • View Profile
    • My Compendium Staff Profile
Re: Okay, Chrono Cross Textures
« Reply #50 on: October 15, 2007, 01:26:02 pm »
Took a good 30 minutes to put this together. It's the Dragon Tail Bar, attached. Putting those 128x16 tiles together is a little quirky, so I'll type out the rules for future reference. I've left the transparent areas white, but I've attached another "proper" version.

1. VRAM Viewer naturally lists about 4 columns of tiles. The map itself starts with the first tile and goes right as it looks at tiles down the column. Under OPTIMAL conditions, you could take the very first tile (upper left), place it, take the second (directly below the first, still on the leftmost column), place it to the right. Do this until you know you've reached the rightmost part of the map and start a new row. (For instance, the Dragon Tail Bar is five tiles wide; under optimal conditions, I'd just go down the columns placing five tiles per row).

2. Black space is the first quirk. At the top of inside maps is mostly black, and Cross skips texturing this. For the Dragon Tail Bar example, the top was almost totally transparent. However, above those chandeliers, there was some tiny, tiny light, meaning Cross went ahead and gave that uppermost row two tiles (as you can see in the image). You have to feel it out. So, for most inside maps, you usually can't just start plugging away left to right.

3. Doors and other openings also have transparent space. Instead of having a black texture, Cross just skips this (you can see the white space in the doorway). What you have to do in this case is break the tile in half, because once you hit the transparent space line, the graphics AFTER the space follow and won't line up with the rest of the map. So you have to copy and paste the portion after that transparent line to the right and line it up manually.

4. But this has a catch: at the end of the row, your final tile might have data intended for the left side of the map on it. Check out the bottom right portion of the Dragon Tail Bar: see those squares? They don't line up like the window because data for the left side of the map followed them, so I had to chop up the tiles and paste that stuff on the left side of the map where it belonged before continuing the new row they created with new, full tiles.

5. There may be other surprises. Play it conservatively, and zoom in as much as you can if needed to try and link up those hard to see light effects.

Now I just have to figure out what this other stuff is in the viewer.

Edit: I got it now. Looks like some of Termina's data is in there to the right...I'll post what I see in a minute so we can try and figure out what the viewer gives us in total.

[attachment deleted by admin]
« Last Edit: October 15, 2007, 01:28:56 pm by ZeaLitY »

FaustWolf

  • Guru of Time Emeritus
  • Arbiter (+8000)
  • *
  • Posts: 8972
  • Fan Power Advocate
    • View Profile
Re: Okay, Chrono Cross Textures
« Reply #51 on: October 15, 2007, 02:15:51 pm »
Nice work Zeality! Are you using the VRAM viewer I referred to earlier with the DragonTear forum link, or have you found a better one? I'd really like to see something where the documentation isn't in Chinese.

And to take up more space with this post, I've got a question for people familiar with the inner workings of 2D image files. Let's say I have a .TIM file and a .BMP file showing the exact same picture. The file headers would be radically different I expect, but would the internal data be different as well? I'm asking in the hope that it might be possible to identify pre-rendered background data by hexadecimal strings regardless of the format, provided that background data is uncompressed in the .iso. The pre-rendered backgrounds are 2D images with invisible geometry overlaid, or am I understanding that wrong? And if so, I wonder if the overlaid geometry is included in the prerendered background file or stored separately.
« Last Edit: October 15, 2007, 03:00:12 pm by FaustWolf »

ZeaLitY

  • Entity
  • End of Timer (+10000)
  • *
  • Posts: 10797
  • Spring Breeze Dancin'
    • View Profile
    • My Compendium Staff Profile
Re: Okay, Chrono Cross Textures
« Reply #52 on: October 15, 2007, 03:06:42 pm »
Yeah, I'm using the one with the Chinese readme.

I'll post the full thing later so we can figure out every last thing the viewer shows us.

FaustWolf

  • Guru of Time Emeritus
  • Arbiter (+8000)
  • *
  • Posts: 8972
  • Fan Power Advocate
    • View Profile
Re: Okay, Chrono Cross Textures
« Reply #53 on: October 16, 2007, 01:50:26 pm »
Zeality, I've done some exploration with PSMPlay (nightmare of a program!) and found lots of .TIM and .STR files. The .STR subject I'll save for another time and another thread, but I was wondering if you know offhand whether we've got the following images yet.



The upper ones are text windows. I wasn't sure we had accessed the little leaf and skull icons on the bottom of each of those images. We probably also have the Time Devourer's portrait (I'd forgotten it even had one). But is that a pre-rendered background image of Arni Village I'm seeing!? I have no idea why it would be stored / detected as a .TIM, and this is its natural image size, so it can't be blown up without becoming pixelated. I came across a very similar phenomenon with background graphics in Front Mission 3, where it seems that these little backdrops are either extraneous data that are perfectly meaningless or that the console/emulator somehow makes them bigger in-game without pixelation.

ZeaLitY

  • Entity
  • End of Timer (+10000)
  • *
  • Posts: 10797
  • Spring Breeze Dancin'
    • View Profile
    • My Compendium Staff Profile
Re: Okay, Chrono Cross Textures
« Reply #54 on: October 16, 2007, 02:24:43 pm »
Unfortunately, that's the battle background image (and we do have those icons). For some reason, thumbnails like that are kept among the TIM data. So regrettably, PSMPlay isn't finding anything new...

But it's good that it can rip the STR files. Hopefully it can give us offsets for those.

FaustWolf

  • Guru of Time Emeritus
  • Arbiter (+8000)
  • *
  • Posts: 8972
  • Fan Power Advocate
    • View Profile
Re: Okay, Chrono Cross Textures
« Reply #55 on: October 16, 2007, 08:38:14 pm »
Thanks for checking that out. I'm still having issues ripping pure .STRs (PSMPlay can detect them, but can't read or output them for some reason), but I've been able to get compressed STRs (.CSTRs) from PSXMc. The latter are still useful for tracing where the .STR data in Chrono Cross is, though the .CSTR files seem to have way different headers, which makes things icky. Using the .CSTRs will be my backup plan in case I'm totally unable to extract pure .STRs; I've got a thread on ROMHacking.net regarding the topic now, so I'm keeping my fingers Crossed.

*SPECIAL UPDATE EDIT*

Hey guys and gals, check this out. I've done a bit of experimenting with textures in the .iso, and I've found that replacing Kid's first clone texture (offsets 00B61800 ~ 00B65A20) with a totally black .TIM makes her map model disappear entirely but has no effect on her battle model. See below...

http://img258.imageshack.us/img258/6217/kidoverworldjm6.jpg
This is invisible Kid on a dungeon map. You can clearly see her shadow though. I expected Kid to turn a nice midnight hue, but the game may be interpreting all the 00 bytes in the black-colored .TIM as wiping the data away entirely. I'll try with a different color next time and see what happens. Also, I might have gone about this in a n00bish way; I think you're supposed to have TIMViewer or another program re-insert a texture, but I simply copied and pasted hex code from the black .TIM to the .iso. :mrgreen: That may make a difference.

But this tells us something perhaps - maybe all of the characters' textures are stored in those .TIMs we've gotten our hands on. I mean, I expected to see legs and shoes running around because those didn't seem to be present in the texture; but maybe the game does re-use parts of the texture all over character models. Either that, or screwing with the texture file made the game not even try to pull Kid's shoes out of wherever they should be elsewhere on the .iso.

http://img258.imageshack.us/img258/4571/kidbattleta9.jpg
And here's Kid in battle, perfectly normal. This means that the game's battle textures and dungeon/town map textures are stored separately. Thus, one of two things is true - either the clone textures we've pulled are used in different situations (perhaps one clone in battle, one on the overworld map, and one on dungeon maps) or we haven't even been able to pull in-battle textures yet. Only one way to find out - I'll replace all of Kid's textures in the .iso sometime.

Seeing this phenomenon kind of reminds me of that floor shadow that appears when Kid reads Lucca's letter. Is it possible there's actually a model for some kind of ghostly Janus in the .iso, but no texture was ever done so the model itself doesn't appear? Weird.
« Last Edit: October 16, 2007, 08:45:21 pm by FaustWolf »

Luminaire85

  • Guru of Time Emeritus
  • Chronopolitan (+300)
  • *
  • Posts: 311
    • View Profile
    • Chrono Cinema
Re: Okay, Chrono Cross Textures
« Reply #56 on: October 16, 2007, 11:48:39 pm »
Yeah, black may not have been the best choice:

Quote
The red, green and blue samples behave like any RGB-defined color, but the STP (special transparency processing) bit has varying special meanings. Depending on the current transparency processing mode, it denotes if pixels of this color should be treated as transparent or not. If transparency processing is enabled, pixels of this color will be rendered transparent if the STP bit is set. A special case is black pixels (RGB 0,0,0), which by default are treated as transparent by the PlayStation unless the STP bit is set.

Above from http://wiki.qhimm.com/PSX/TIM_file (emphasis mine).

* Note that colors are 16-bit, with 5 each for red, green, and blue, and the last for alpha (transparency).

FaustWolf

  • Guru of Time Emeritus
  • Arbiter (+8000)
  • *
  • Posts: 8972
  • Fan Power Advocate
    • View Profile
Re: Okay, Chrono Cross Textures
« Reply #57 on: October 17, 2007, 12:56:38 am »
 :lol: Thanks for confirming that, Luminaire. I'll go with a nice, soft blue next time.

ZeaLitY

  • Entity
  • End of Timer (+10000)
  • *
  • Posts: 10797
  • Spring Breeze Dancin'
    • View Profile
    • My Compendium Staff Profile
Re: Okay, Chrono Cross Textures
« Reply #58 on: October 17, 2007, 01:58:25 pm »
After my insane-o tests are done later today, I'm going to open a savestate with VRAM and then in a hex editor. Using the menu TIMs and a character model TIM (the location tiles are shown between), I'm going to see if the graphics really are all together in one part of the savestate as they appear in the VRAM viewer. If it's true, then we can take the block between (the location tiles) and search them out through hex in the main ISO (or try to find a header).

Unfortunately, this won't work if the VRAM viewer is taking graphics from a lot of different parts of the savestate. But on the other hand, if that's true, we know the viewer has some way of recognizing MIM textures or their output.

FaustWolf

  • Guru of Time Emeritus
  • Arbiter (+8000)
  • *
  • Posts: 8972
  • Fan Power Advocate
    • View Profile
Re: Okay, Chrono Cross Textures
« Reply #59 on: October 17, 2007, 02:15:43 pm »
Sounds good. That way we can also narrow down where model data might be in the savestate and in VRAM, if it is indeed in there. Too bad there isn't a VRAM utility to dump the data in its native format; I just take screenies of what appears in the viewer. Unless there's a dumping function I haven't found yet...

I'll continue playing around with character textures to test some of my own theories as to how things work.

Good luck on tests!
« Last Edit: October 17, 2007, 02:41:36 pm by FaustWolf »