Author Topic: Corruption investigation  (Read 2936 times)

JLukas

  • Fan Project Leader
  • Squaretable Knight (+400)
  • *
  • Posts: 426
    • View Profile
Corruption investigation
« on: May 28, 2006, 10:35:22 pm »
I'm going to have a look at the corruption issue in the current demo, and, with any luck, fix it.  But I need as much background info as possible to speed this along:

1) Link to the latest post-2.0 CE bugfix patch being worked on right now?
2) What's corrupt?  Just the Sun Keep?  Which Sun Keep, location #?  Is the map itself corrupt, and/or the event for it?  Does it open in TF?  If it crashes in TF, does it do so on loading the map, or event?
3) Was that Sun Keep itself ever modified?
4) Can it be deleted, in other words, do you need that location for the story?
5) Do you have the patch right before it got corrupt?  Do you know what you added/changed afterwards to cause it?  (not necessary, but would help a lot.  especially if you have both a pre and post corruption patch).

I would guess from it being the Sun Keep corrupting that data is crossing a bank boundary, or it is being "squeezed" (partly overwritten) into a bank that no longer has room for it.
« Last Edit: May 31, 2006, 01:16:03 am by JLukas »

Agent 12

  • Moderator
  • Zurvan Surfer (+2500)
  • *
  • Posts: 2572
    • View Profile
Re: Corruption investigation
« Reply #1 on: May 28, 2006, 10:42:35 pm »
oo exciting I'll post a patch tonight (mom's on the comp right now)  I should have both.  It seems to be caused by importing King Zeal.  It works right before patching, but not right after. 

Would you be able to look into the magus power glitch to or is that still undocumented?

--jp

JLukas

  • Fan Project Leader
  • Squaretable Knight (+400)
  • *
  • Posts: 426
    • View Profile
Re: Corruption investigation
« Reply #2 on: May 28, 2006, 10:59:51 pm »
King Zeal - importing NPC gfx?  How are you doing that specifically?

Magus power glitch, hmm I saw that in the other thread I think, got a link to that post and more details of what's happening?  Sounds like something with how the game engine works and not a TF problem.

ZeaLitY

  • Entity
  • End of Timer (+10000)
  • *
  • Posts: 10797
  • Spring Breeze Dancin'
    • View Profile
    • My Compendium Staff Profile
Re: Corruption investigation
« Reply #3 on: May 29, 2006, 12:26:02 am »
2. Right now, just the Sun Keep. Random locations have lost their events time to time.
3. No.
4. Don't need it.

Agent 12

  • Moderator
  • Zurvan Surfer (+2500)
  • *
  • Posts: 2572
    • View Profile
Re: Corruption investigation
« Reply #4 on: May 29, 2006, 04:21:00 am »
OK, 3 files attached.

postdemo is the corrupt, sunkeeps works is prior to corruption, and the last one should be the patch used to place King Zeal in. 

It's every sunkeep location in the game (all eras).  It loads find in TF and everything looks great I even imported events from a working rom and it still didn't work.  You go to the exit and it just black screens, though the music still loads IIRC. 

The location isn't technically needed, though fixing it would ease my mind and make the game that much better. 

http://www.chronocompendium.com/Forums/index.php?topic=2577.0

That is one thread about the Magus Power Glitch, you should be able to use any CE rom to see it in action.  I'm thinking a dirty fix would be to manually set the power conditioning on his level say everytime Chronopolis loads but that's a really dirty fix and would like to fix it any other way if possible.  It happened by using CTEC to edit his level and stats to a "level 1 magus" (used a gamefaqs level chart).  A similar problem happens with Robo since I reset his level but it's not quite as drastic as **, I think his stamina is a little lower than it's suuposed to be.

Anyways any help is appreciated.

--jp

[attachment deleted by admin]

Agent 12

  • Moderator
  • Zurvan Surfer (+2500)
  • *
  • Posts: 2572
    • View Profile
Re: Corruption investigation
« Reply #5 on: May 29, 2006, 04:21:30 am »
Third attachment for above post

[attachment deleted by admin]

JLukas

  • Fan Project Leader
  • Squaretable Knight (+400)
  • *
  • Posts: 426
    • View Profile
Re: Corruption investigation
« Reply #6 on: May 31, 2006, 01:15:09 am »
Early findings:

King Zeal patch definately seems to be the problem with the Sun Keep.  The crashing occurs even when the patch is applied to a fresh non-CE CT.

Going into this, I was expecting to see the Sun Keep map or event corrupt, but that was not the case.  Looking at the raw packets, nothing appears out of the ordinary.  As you also saw, it's working fine in TF.

The game is just calling it quits halfway on loading the area for seemingly no reason.

The King Zeal patch modifies some data in the $2Fxxxx range.  I'm guessing it accidently overwrites some cave tileset graphics, and the game hangs on trying to decompress it.

I need more background info on the King Zeal patch, what it does specifically.  Details like "Inserted custom graphics to such-and-such address"  Unfortunately this patch appears to have a bunch of background "noise", in other words, other non-related changes that happend to be made at the same time, and I can't really make sense of it.




Agent 12

  • Moderator
  • Zurvan Surfer (+2500)
  • *
  • Posts: 2572
    • View Profile
Re: Corruption investigation
« Reply #7 on: May 31, 2006, 01:44:38 am »
http://www.chronocompendium.com/Forums/index.php?topic=2684.0

Chrono 99 gave a pretty detailed explanation of what he did there, I'm not an expert on graphics hacking at all.   It's 3rd to last post. (crosses fingers)


 

--jp
« Last Edit: May 31, 2006, 01:56:10 am by jsondag2 »

JLukas

  • Fan Project Leader
  • Squaretable Knight (+400)
  • *
  • Posts: 426
    • View Profile
Re: Corruption investigation
« Reply #8 on: June 05, 2006, 04:58:38 am »
Offending data is between $180000 - $1B0000...in progress

edit 4:01am - somewhere in $1A0000 - $1B0000
edit 4:06am - down to $1A8000 - $1B0000
edit 4:25am - found, patching
« Last Edit: June 05, 2006, 05:26:04 am by JLukas »

JLukas

  • Fan Project Leader
  • Squaretable Knight (+400)
  • *
  • Posts: 426
    • View Profile
Re: Corruption investigation
« Reply #9 on: June 05, 2006, 06:01:45 am »
King Zeal was $85 bytes longer than the original graphics.  The extra data spilled over and corrupted the following graphics packet.  I didn't open it in a tile editor to check which one, but I can almost guarantee it was the Sun Stone.  In the future when editing graphics, caution must be taken not to import something to its original location without knowing if it can fit.

If his sprite sheet is increased in the future, it would be a good idea to relocate it somewhere in the Expanded space.
« Last Edit: January 18, 2008, 07:36:28 pm by JLukas »

Agent 12

  • Moderator
  • Zurvan Surfer (+2500)
  • *
  • Posts: 2572
    • View Profile
Re: Corruption investigation
« Reply #10 on: June 05, 2006, 08:58:44 pm »
Applied:  Total success   :D

--jp

Agent 12

  • Moderator
  • Zurvan Surfer (+2500)
  • *
  • Posts: 2572
    • View Profile
Re: Corruption investigation
« Reply #11 on: June 30, 2006, 01:07:15 am »
Had a minor heart attack when I saw the attached screen.....thank god I make backups.

I added an exit to 1002 AD and I also added a "location name" (replaced one of the nulls under window-->Strings-->Locations).  I'm guessing one of these caused it.

2 GB array??

--jp

[attachment deleted by admin]

nightmare975

  • Architect of Kajar
  • God of War (+3000)
  • *
  • Posts: 3263
    • View Profile
Re: Corruption investigation
« Reply #12 on: June 30, 2006, 01:20:55 am »
It always does that when I open up the Overworlds. I think there aare too many exits.

Agent 12

  • Moderator
  • Zurvan Surfer (+2500)
  • *
  • Posts: 2572
    • View Profile
Re: Corruption investigation
« Reply #13 on: June 30, 2006, 01:28:56 am »
This wasn't opening up the OW this was opening up the ROM itself

the OW error I can click continue and go on like normal, this one I can't edit the rom at all.

--jp

JLukas

  • Fan Project Leader
  • Squaretable Knight (+400)
  • *
  • Posts: 426
    • View Profile
Re: Corruption investigation
« Reply #14 on: June 30, 2006, 04:01:09 am »
There was a really old similar bug with the 2GB array error.  In fact, I was just able to find it in Bugzilla.  It was caused by OW exits and MTD fighting over free space.  Geiger changed the save logic to solve it.

Two things to try:

1.  Only edit one set at a time.  Open TF, add the exit(s), save, close TF completely.  Open TF, edit Loc Name, save, close TF completely.

You should be able to continue from there.  If not, in the steps above, try adding a few more exits/location names than you actually need (you can delete them later, of course)  Hopefully, the size of the new data will force it into a more friendly spot.