Author Topic: How to fix the Castle Crush Glitch? (DKC2DKQ)  (Read 499 times)

13375K31C43R

  • Magus Sisters
  • *
  • Posts: 606
  • Gender: Male
    • View Profile
    • Leet Sketcher's Final Fantasy III Patches
How to fix the Castle Crush Glitch? (DKC2DKQ)
« on: March 06, 2017, 07:00:10 PM »
I found a way to semi-fix the Castle Crush Glitch. This was done in SDK2 Editor; all I had to do was change the ordering of the sprites in the list for Castle Crush. Now, while Diddy can still appear to be holding imaginary barrels, at least they won't spawn weird glitchy Rambi barrels anymore (at least, they didn't for me; the worst that happened was I spawned a Krook that instantly killed me).

I call this a semi-fix because it's not perfect. The right way to fix this would be to fix the way Diddy handles barrels in Castle Crush. With Dixie, you can attempt the quick-drop-pick-up move that makes the glitch work, except Dixie will either pick the barrel up before it breaks or not pick it up at all; this is what Diddy should be doing.

Castle Crush.ips applies the semi-fix; Castle Crush-R.ips removes it.
« Last Edit: March 06, 2017, 07:39:50 PM by 13375K31C43R »
"Do not meddle in the affairs of wizards, for they are subtle and quick to anger." -Gildor from The Lord of the Rings

assassin

  • Bane of Retards
  • *
  • Posts: 1,013
  • space bears are not gentle!
    • View Profile
    • My Barren Webpage
Re: How to fix the Castle Crush Glitch? (DKC2DKQ)
« Reply #1 on: March 08, 2017, 11:58:10 AM »
am clueless on this, so forgive any flailing..  is there a "Barrel Breaking" flag (or constant value in a Barrel State variable) that might be detectable with Cheat Search?  pretending there is, is the problem that the game lets Diddy pick up a barrel after this is set, or that the flag can be set after he's already picked up the barrel?  (or neither.)

how does the wall figure into breakage when there's no throwing?  even though the floor's moving parallel to it, is there some "is touching wall?" test?

13375K31C43R

  • Magus Sisters
  • *
  • Posts: 606
  • Gender: Male
    • View Profile
    • Leet Sketcher's Final Fantasy III Patches
Re: How to fix the Castle Crush Glitch? (DKC2DKQ)
« Reply #2 on: March 08, 2017, 11:56:54 PM »
I don't know. My problem is that there's no decent disassembly I can find, so I have no idea where the "drop barrel" or "breaking barrel" or "pick up barrel" functions are. Obviously the cause has to be something along those lines. My guess is that Diddy's "drop barrel" function calls the "breaking barrel" function on the basis of the barrel being placed at a wall near the rising floor, but doesn't properly implement the "can't pick it up anymore" property in time; Dixie's differs in that if one of those two things happens, they both do. For all I can fathom, the "check for barrel breakage" function was probably implemented into Diddy's "drop barrel" function unnecessarily. That seems to be what's happening because I can't replicate the glitch with Dixie.

One other thing to note is that with either character, if that character is alone and you break the DK barrel this way, the partner character won't spawn. I'm guessing this is not a bug because it doesn't register the barrel as being held or touched by a Kong anymore; it's more like just a sh*tty thing to do.
"Do not meddle in the affairs of wizards, for they are subtle and quick to anger." -Gildor from The Lord of the Rings

Lenophis

  • Forum Overlord
  • *
  • Posts: 1,677
  • Gender: Male
  • I sad
    • View Profile
    • Slick Productions
Re: How to fix the Castle Crush Glitch? (DKC2DKQ)
« Reply #3 on: March 09, 2017, 08:00:16 AM »
I don't think the problem is necessarily them picking up an invisible barrel, but that its ID is 0 (supposedly). It's referencing an item that technically no longer exists, which is why all kinds of broken stuff happens. Wrong warp, sprite corruption, game corruption in Castle Crush, early exit in Slime Climb, etc. The Slime Climb one references an invisible beetle, to boot.

I think whatever is supposed to clear an entity's destruction just isn't happening fast enough, or it should be happening before the code that runs that allows a player to pick something up.

119 bugs fixed and counting.

assassin

  • Bane of Retards
  • *
  • Posts: 1,013
  • space bears are not gentle!
    • View Profile
    • My Barren Webpage
Re: How to fix the Castle Crush Glitch? (DKC2DKQ)
« Reply #4 on: March 09, 2017, 09:36:41 AM »
i'll take a leap of faith that DKC1 has some relevancy here, as i find more info on that, the games all look the same, and dunno where i put my DKC2 ROM.  iow, airtight reasoning. ;P

- http://www.dkc-atlas.com/forum/viewtopic.php?f=38&t=1199 , see "Public DKC RAM Table".  testing on Ropey Rampage, the first DK barrel has a value of 26h in the 7E:0D45 table, but then becomes 0 when destroyed.
- i did some cheat searches trying to pin down changes in this DK barrel's states.  contenders:

http://assassin17.brinkster.net/dkc1/dk-barrel-high-ropey-rampage-RAM-addresses-narrowed.txt

[EDIT1: listed values are from testing with Donkey.]

as the one note hints, there might be some variability as to what address a given barrel uses, depending on the path you take to reaching/grabbing it.

i didn't find an outright "Barrel Breaking" flag or constant among those values, but they could be useful if they (or something similar) are used in DKC2.  a fix might be a matter of testing certain ones, and/or making sure they're consistent with each other.  or it might involve altering one or more.  suppose, for example, that a "barrel is on ground" value is what lets you pick up the breaking barrel here, and why i've never heard about picking up a barrel you've just chucked at (or walked into) a wall.  in that case, finding the code that triggers the breakage and inserting a change of said value to something else might remedy things.  (EDIT2: like you said, "properly implement the 'can't pick it up anymore' property in time".)

that's an alternate path to stopping the barrel breakage in the first place, and not one i'm necessarily saying is better, but either way can achieve some needed consistency.

EDIT2: break-pointing those cheat-searched values was able to get me in the vicinity of the DKC1 "pick up barrel" and "put down barrel" functions.

-----

EDIT2: having a barrel somehow be crushed "between" a floor and a vertical wall is a bit dumb, but maybe it'd be too involved to change.  if you put down the barrel in a proper horizontal position (i.e. corresponding to old wall edge) while in a clearing where the walls are wider, then original wall width is reached again, can the stationary barrel be crushed against the side of a wall?  or is the breakage limited to during a Kong's barrel lowering?

also, while going the route of stopping perpendicular breakage makes sense, could Diddy still quick-pick up a barrel that's crushed against the ceiling of a clearing with some precise timing?

i'm guessing that a wall is seen as a "ceiling" in that the barrel, slightly overlapping the wall, is trying to enter an impassable tile from below..  but why does this overlap exist in the first place: graphical presentation?  making sure barrel-toting Diddy needs to walk _into_ a wall to open a secret passage?
« Last Edit: March 09, 2017, 01:50:08 PM by assassin »

assassin

  • Bane of Retards
  • *
  • Posts: 1,013
  • space bears are not gentle!
    • View Profile
    • My Barren Webpage
Re: How to fix the Castle Crush Glitch? (DKC2DKQ)
« Reply #5 on: March 09, 2017, 04:04:48 PM »
another thing (i can't edit that post no more!): if there is the wall acting as a ceiling deal, is the crush of a barrel against/within an impassable tile triggered right away, or does it wait until the top of the barrel touches the bottom of a tile border?  and if there is, as you said, a " 'check for barrel breakage' function [in] Diddy's 'drop barrel' function", is it subject to the same alignment wait?

playing while knowing where each wall tile starts (grid lines would be nice) and using frame advance, i wonder whether Dixie putting down a barrel would have slightly more wait until breakage than Diddy.

13375K31C43R

  • Magus Sisters
  • *
  • Posts: 606
  • Gender: Male
    • View Profile
    • Leet Sketcher's Final Fantasy III Patches
Re: How to fix the Castle Crush Glitch? (DKC2DKQ)
« Reply #6 on: March 09, 2017, 05:51:02 PM »
also, while going the route of stopping perpendicular breakage makes sense, could Diddy still quick-pick up a barrel that's crushed against the ceiling of a clearing with some precise timing?

Yes! I just tested it and, although the timing is very precise, it is possible for Diddy to pick up an invisible barrel in this case! :omg:

And... after further testing... this makes it possible for Dixie to do this too! :wtf:
"Do not meddle in the affairs of wizards, for they are subtle and quick to anger." -Gildor from The Lord of the Rings

assassin

  • Bane of Retards
  • *
  • Posts: 1,013
  • space bears are not gentle!
    • View Profile
    • My Barren Webpage
Re: How to fix the Castle Crush Glitch? (DKC2DKQ)
« Reply #7 on: March 09, 2017, 06:54:23 PM »
interesting!  i wonder whether her jumping ability opens up new exploits.

as for why she couldn't do it the other way, maybe her barrel put down (or recovery therefrom) is slower, or has a different trajectory.  (to be sure, the former is different from what i was considering in the last sentence of my prior post; that was about having to wait until the barrel hits a wall tile border, in the event Dixie's "put down" routine lacked a breakage check.)  that could give time for both the breakage to be triggered and the barrel to lose its "is on ground" value, assuming the former is consistently done first.

can barrels be ceiling-crushed while being held by a character, or must they be on the ground?  doubtful it would trigger the bug; i'm just trying to pin down the breakage requirements.

13375K31C43R

  • Magus Sisters
  • *
  • Posts: 606
  • Gender: Male
    • View Profile
    • Leet Sketcher's Final Fantasy III Patches
Re: How to fix the Castle Crush Glitch? (DKC2DKQ)
« Reply #8 on: March 09, 2017, 07:44:42 PM »
If I hold a barrel under a ceiling, Diddy/Dixie gets crushed, then the barrel breaks and the crushed Kong immediately respawns.
"Do not meddle in the affairs of wizards, for they are subtle and quick to anger." -Gildor from The Lord of the Rings

assassin

  • Bane of Retards
  • *
  • Posts: 1,013
  • space bears are not gentle!
    • View Profile
    • My Barren Webpage
Re: How to fix the Castle Crush Glitch? (DKC2DKQ)
« Reply #9 on: March 09, 2017, 08:01:29 PM »
if Diddy stands in the vertical shaft, just clear of the ceiling, with the barrel held in front of him, can it be crushed without him?

13375K31C43R

  • Magus Sisters
  • *
  • Posts: 606
  • Gender: Male
    • View Profile
    • Leet Sketcher's Final Fantasy III Patches
Re: How to fix the Castle Crush Glitch? (DKC2DKQ)
« Reply #10 on: March 09, 2017, 08:35:34 PM »
If he's holding it in that way, then no, it won't break until he drops or throws it.
"Do not meddle in the affairs of wizards, for they are subtle and quick to anger." -Gildor from The Lord of the Rings