Author Topic: Chrono Cross Pointer Investigation  (Read 13064 times)

FaustWolf

  • Guru of Time Emeritus
  • Arbiter (+8000)
  • *
  • Posts: 8972
  • Fan Power Advocate
    • View Profile
Re: Chrono Cross Pointer Investigation
« Reply #15 on: December 21, 2008, 02:48:32 pm »
Heeey, welcome back M! :lee: :lee: :lee:

Yeah, the "red screen of death" is the exact same shade every time. I think it indicates a specific problem, but not sure what. I do remember it happening when I tried to insert Dark Serge into someone's battle model space without repointering and hoped for the best way back when.

I should note that the "unknown fourth byte" for the battle model data is pretty darn important. If you alter it from its original, the model won't load. You don't get a red screen in that case -- the game keeps going, but gets stuck and doesn't load the model. Everything it's loaded up to that point seems to function correctly though, such as little animals that crawl around the battleground.

utunnels

  • Guru of Reason Emeritus
  • Zurvan Surfer (+2500)
  • *
  • Posts: 2797
    • View Profile
Re: Chrono Cross Pointer Investigation
« Reply #16 on: December 21, 2008, 02:56:46 pm »
Well, maybe I know nothing about CC hacking stuff.
But for FF9, each battle has a complete set of  text, script, font... Which means the game load all that are needed by this battle from a huge block of data(probably not including textures). A battle with 2 goblins and a battle with 3 goblins are 2 different sets, which means there are 2 almost duplicated data blocks(you can hack the script or text, give different names to the goblins, etc), the game just won't go fetching a single goblin data from somewhere of the CD.

Maybe Dark Serge's model is not actually loaded?
« Last Edit: December 21, 2008, 03:06:52 pm by utunnels »

MDenham

  • CC:DBT Dream Team
  • Chronopolitan (+300)
  • *
  • Posts: 330
  • Glowsticks are not a weapon.
    • View Profile
    • Java IRC - konata.echoes-online.com
Re: Chrono Cross Pointer Investigation
« Reply #17 on: December 21, 2008, 03:08:19 pm »
Yeah, the "red screen of death" is the exact same shade every time. I think it indicates a specific problem, but not sure what.
Would be nice if I knew whether or not (for example) ePSXe supported dumping output from the external ports that would be on an old-style PS1 (specifically the serial port), and finding a devkit-PS1 BIOS would be a godsend for this as well.

I'm pretty sure there's still a substantial amount of the debug calls to help trace the program left in there - it would explain a lot of the odd text scattered throughout.

Off to look for the required information.

Vehek

  • Errare Explorer (+1500)
  • *
  • Posts: 1761
    • View Profile
Re: Chrono Cross Pointer Investigation
« Reply #18 on: December 21, 2008, 03:47:53 pm »
An interesting note: I got Serge's field model to load a NPC model that was a sector larger by chhanging that fourth byte.

FaustWolf

  • Guru of Time Emeritus
  • Arbiter (+8000)
  • *
  • Posts: 8972
  • Fan Power Advocate
    • View Profile
Re: Chrono Cross Pointer Investigation
« Reply #19 on: December 21, 2008, 04:03:44 pm »
AHA! Yes, it definitely has something to do with that darned fourth byte. It doesn't seem to matter for textures (at least in some cases) and weapons, but it definitely is important for the model. I'll test it out next time I fire the ISO up.

EDIT: utunnels, I happen to have a great interest in FF9 model research as well. Have you been to qhimm yet?

Oh, and Vehek, did you take notes on how you chose the value for the fourth byte? Did you make it match up with the fourth byte that larger model had originally. And did the game freeze up before you changed that fourth byte?
« Last Edit: December 21, 2008, 04:06:28 pm by FaustWolf »

Vehek

  • Errare Explorer (+1500)
  • *
  • Posts: 1761
    • View Profile
Re: Chrono Cross Pointer Investigation
« Reply #20 on: December 21, 2008, 04:07:14 pm »
In this case, I was testing with copying a NPC model to empty space. I think that before, it was freezing up. I changed the fourth byte to be the same as Kid's.

utunnels

  • Guru of Reason Emeritus
  • Zurvan Surfer (+2500)
  • *
  • Posts: 2797
    • View Profile
Re: Chrono Cross Pointer Investigation
« Reply #21 on: December 21, 2008, 04:16:24 pm »
EDIT: utunnels, I happen to have a great interest in FF9 model research as well. Have you been to qhimm yet?
No, I've never visited there before...
Yeah, I just spoke a possibility, as I said, I've not researched it at all.
I used to be one of the coders of a FF9 fan-translation project, but I'm not handy at ASM. :P

FaustWolf

  • Guru of Time Emeritus
  • Arbiter (+8000)
  • *
  • Posts: 8972
  • Fan Power Advocate
    • View Profile
Re: Chrono Cross Pointer Investigation
« Reply #22 on: December 21, 2008, 08:43:00 pm »
After a few preliminary tests...
 :picardno

Shit, guys. I've just (probably) conclusively confirmed that there is, indeed, a limit on the total amount of model data (texture, model, weapon pack) that can be fed into the game engine for any single model. Here's what I did:

Regular Serge texture, model, and weapon, but shoved the weapon back to the sector it would have to be in to make enough space for the Dark Serge model. Repointered as necessary. Result? Red Screen of Death.

Regular Serge texture, and model with pointers unchanged from above. Replaced Swallow weapon pack with the "glove" weapon pack, which is only one sector long because it's basically nothing. Result? Serge works fine, but weaponless.

Dark Serge texture, Dark Serge Model, glove weapon pack, with pointers unchanged from above. Result? Dark Serge works fine, but weaponless.

Of course I've already tried the pointer values with Dark Serge texture, Dark Serge model, and Scythe weapons pack.

Next thing to do is find a suggested upper bound on the size of a model's necessary data in sectors, so we can notify Chrono Cross fan projects of this technical limitation. Given that we're just now exploring Chrono Cross' internals, it seems kind of silly to try and change this bound via asm hacking, but I dunno. Ugh.  :evil:

The only hope for a perfect playable Dark Serge now is that either a.) changing the fourth byte somehow miraculously saves the day (I haven't tried this yet) or b.) the game will correctly load the enemy weapons pack given to Dark Serge as an enemy -- I've been trying with Scythe/Serge/Lynx's scythe weapons pack, which is what we used for the Magus Unmasked hack. I'll keep you updated...

MDenham

  • CC:DBT Dream Team
  • Chronopolitan (+300)
  • *
  • Posts: 330
  • Glowsticks are not a weapon.
    • View Profile
    • Java IRC - konata.echoes-online.com
Re: Chrono Cross Pointer Investigation
« Reply #23 on: December 21, 2008, 09:19:29 pm »
 :picardno x2.

I seem to have had my entire code disappear as far as the rewritten tools...  which does not help (it's not too bad to rewrite it, but it's work I don't particularly want to repeat :D).

However: the fourth byte does just state how much of the last sector is padding.  (0 = none, 1 = eight bytes, 2 = sixteen bytes, and so on.  Just multiply by 8.)

Keep in mind that if you're trying to "inject" a larger model into the middle of the ISO, you'd have to adjust EVERY ENTRY AFTERWARDS.  It's safer to drop them in at the end of the ISO for the time being, it seems.

FaustWolf

  • Guru of Time Emeritus
  • Arbiter (+8000)
  • *
  • Posts: 8972
  • Fan Power Advocate
    • View Profile
Re: Chrono Cross Pointer Investigation
« Reply #24 on: December 21, 2008, 09:48:34 pm »
Oh man, you just totally figured it out M! Maybe that's the key after all. Jeez, your return is like this serious Christmas gift. Also --

Just ignore my post above, because I was dead wrong! It just so happens that the file size needed to load General Viper is waaay more than what would be needed to load a working Dark Serge theoretically.

General Viper (Player Character):
Texture: File 3070 = 0x9800
Model: File 3071 = 0xE800
Weapons Pack: File 3072 = 0x14800
Total: 0x2C800

Dark Serge (Theoretical Player Character):
Texture: File 3670 adapted with some placeholder blink textures and other framework = 0x9800
Model: File 3671 = 0x11000
Weapons Pack: File 3210 = 0x29800

So I was factually wrong. It must be the fourth byte then. Maybe everything loads correctly if you tell the game engine there's greater than/less than the true amount of buffer space, and things get screwed up if the alternative happens. That would explain Vehek's experience and my own. Now to figure this out once and for all! :twisted:
« Last Edit: December 21, 2008, 09:51:21 pm by FaustWolf »

MDenham

  • CC:DBT Dream Team
  • Chronopolitan (+300)
  • *
  • Posts: 330
  • Glowsticks are not a weapon.
    • View Profile
    • Java IRC - konata.echoes-online.com
Re: Chrono Cross Pointer Investigation
« Reply #25 on: December 21, 2008, 10:03:03 pm »
So I was factually wrong. It must be the fourth byte then. Maybe everything loads correctly if you tell the game engine there's greater than/less than the true amount of buffer space, and things get screwed up if the alternative happens.
Most likely the errors occur when you're telling them there's more buffer space than there should be - because then you're chopping off the end of Section 5!

Shadow D. Darkman

  • Zurvan Surfer (+2500)
  • *
  • Posts: 2630
  • "Chrono Cross" is good, and spoilers never hurt...
    • View Profile
Re: Chrono Cross Pointer Investigation
« Reply #26 on: December 21, 2008, 10:32:39 pm »
Hey, question. Has anyone tried to hack a Serge (not as Lynx) VS Dark Serge battle?

(Sorry if this is a bit off-topic but this seems the most relevant place to ask this.) :oops:

FaustWolf

  • Guru of Time Emeritus
  • Arbiter (+8000)
  • *
  • Posts: 8972
  • Fan Power Advocate
    • View Profile
Re: Chrono Cross Pointer Investigation
« Reply #27 on: December 21, 2008, 10:40:02 pm »
@Shadow: We'll do better than that eventually.

Grrr, even specifying the fourth byte correctly isn't doing it for me. There's something about combining Dark Serge's model with Serge/Lynx's scythe that the game engine absolutely detests.

EDIT: Just so everyone knows I'm not completely crazy or anything, Dark Serge really does work when I assign a glove weapons pack to his model:


It's got to be some kind of texture loading issue. That's the only thing I can think at this point.
« Last Edit: December 21, 2008, 11:06:09 pm by FaustWolf »

Shadow D. Darkman

  • Zurvan Surfer (+2500)
  • *
  • Posts: 2630
  • "Chrono Cross" is good, and spoilers never hurt...
    • View Profile
Re: Chrono Cross Pointer Investigation
« Reply #28 on: December 21, 2008, 11:08:06 pm »
Ooh, cool! Dark Serge as a playable character! Sweet!

FaustWolf

  • Guru of Time Emeritus
  • Arbiter (+8000)
  • *
  • Posts: 8972
  • Fan Power Advocate
    • View Profile
Re: Chrono Cross Pointer Investigation
« Reply #29 on: December 22, 2008, 02:15:36 am »
The red screen of death still reigns supreme. I should probably try testing Dario, Flea, Slash, and Ozzie, but I'm too stubborn to let go of this just yet. I've tried the following:

Dark Serge Texture and Model, Glove Weapon pack: Works (without a weapon of course)
Dark Serte Texture and Model, any other weapon pack: Red screen of death
Regular Serge Texture and Dark Serge Model, any weapon pack: Red screen of death

What's actually fairly hilarious is that the game engine can load Dark Serge's "enemy scythe" weapon pack just fine -- it's a single scythe corresponding to the character's first equipped weapon, so you need to have Sea Swallow equipped or else the game will freeze when it tries to load the weapon. It can load on the status screen just fine, but red screens when it attempts to load in battle.

It's not a texture issue as I previously supposed -- the third experiment with Serge's regular texture would have solved that. Nor is it a total file size issue, nor is it a fourth byte issue. It's got to be something having to do with the interaction between the model and any weapon pack except the gloves weapon pack. It's like Dark Serge's model vehemently screams, "I can't handle a weapon!!"

Something interesting to note -- when Dark Serge attacks with gloves assigned as his weapon pack, his model performs all animations appropriately except normal attacks, which cause him to become discombobulated during the attack. I'm not sure what's up with that, because all attack animations are supposed to be stored in the model itself.