øAslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&action=printpage;topic=2210.0e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/indexd3ff.htmlslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=2210.0e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/indexd3ff.html.zx–0h^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈ€4Œ)OKtext/htmlISO-8859-1gzip8:Ö)ÿÿÿÿÿÿÿÿWed, 11 Mar 2020 00:44:30 GMT0ó°° ®0®P®€§²ð®•0h^›) Print Page - New patch: Hasty T-Rex Glitch fix

Board of Slick

Banon's Donkey Farm => Game Modification Station => Topic started by: 13375K31C43R on April 24, 2016, 02:46:04 PM

Title: New patch: Hasty T-Rex Glitch fix
Post by: 13375K31C43R on April 24, 2016, 02:46:04 PM
Hi everyone! This will probably be my last patch for a little while, I've been running myself ragged over the last 30 hours or so. I think I've finally found the right fix for this graphical glitch that I've been dealing with for a while now. It happens when you face Tyrannosaur in the Colosseum, and Haste or Slow is cast on Tyrannosaur; he'll shift backwards during the casting of the spell. I've discovered that the problem is down to the midpoint calculation for the enemy's sprite on the battlefield; this patch makes a correction to the algorithm. I've done a bit of testing to make sure this patch doesn't mess anything up with any other enemies, and it's so far so good; however, I'll be more comfortable the more thorough the testing gets, so for now I've designated this as a beta release.

:edit: April 26, 2016
I think I'll go ahead and remove the beta designation. If anyone finds a problem, don't hesitate to let me know.

:edit: May 31, 2016
I've implemented a new fix that doesn't have the problems described in the replies below. Thank you, Assassin. :wink:

:edit: January 30, 2018
Added GBA port!
Title: Re: New patch: Hasty T-Rex Glitch fix
Post by: Xenovant on May 29, 2016, 09:36:08 AM
I have found a bug with pincer attacks. I don't know if it will happen in any pincer attack, or just some of them.

(http://i65.tinypic.com/wm0xn4.png)
Title: Re: New patch: Hasty T-Rex Glitch fix
Post by: assassin on May 29, 2016, 04:12:10 PM
yeah, the code change seems like it'd affect way too much.  a rather broad change to deal with a couple spells in a single venue.  perhaps give my Function C1/215F comments a look here:
http://web.archive.org/web/20140624085359/http://Home.comcast.net/~assassin17/c1bank.txt

what does a raw bitmap of the Tyranosaur look like anyway?  Haste outside of the Colosseum appears alright in vanilla.
Title: Re: New patch: Hasty T-Rex Glitch fix
Post by: 13375K31C43R on May 30, 2016, 10:19:04 AM
The bitmap information for Tyrannosaur in the Colosseum is located at D2/A914 (eight bytes long). I've already tried just setting the LSB in one of the bytes, which would've fixed the problem, but it also shifted parts of the image like the feet.
Title: Re: New patch: Hasty T-Rex Glitch fix
Post by: assassin on May 30, 2016, 01:54:29 PM
the game seems to handle odd-tile-width enemies just fine outside the Colosseum, perhaps because their starting X-coordinate is always on a tile boundary.  so i'd leave C1/215F alone, as it affects too many things that don't need changing.

is your concern with the Colosseum horizontal centering formula: updated X coord = ( (128 - width) / 2 ) + 24 ,
allowing for a mid-tile X-coordinate when the tile width is odd?

in that case, i'd go right at the Colosseum-specific code.  change C1/15C1 to:
Code: [Select]
LDA $812F    (adjusted tile width of enemy from slot #0)
INC
LSR
ASL          (round up to even #)
ASL
ASL
ASL
STA $10      (store width)

i'm sure you can find 3 bytes somewhere. ;)  maybe the C1/15F6 segment can be shrunk by starting with B0h?

anyway, it might still be worth dissecting these spells' animation scripts to see what it is about certain coordinates that make them choke.
Title: Re: New patch: Hasty T-Rex Glitch fix
Post by: 13375K31C43R on May 30, 2016, 10:06:41 PM
I've only been working off of Imzogelmo's disassembly up to now, so I never knew any of the code to be "Colosseum-specific", as you seem to have figured out. I'll take a look at it.
Title: Re: New patch: Hasty T-Rex Glitch fix
Post by: Imzogelmo on May 31, 2016, 07:04:00 PM
That old thing? I bet every one of us has a better version of the C1 bank by now. That old thing is just one or two steps away from the raw disassembly from DisPel.

Also, I think I have a way we could recoup several bytes of RAM (not contiguous, unfortunately). If anyone can come up with a way to get hundreds of contiguous bytes without sacrificing functionality, please let me know. This thing could be broke wide open. :)
Title: Re: New patch: Hasty T-Rex Glitch fix
Post by: 13375K31C43R on May 31, 2016, 07:06:27 PM
Yeah, but yours was the only one I could find until Assassin showed me his, and his is only accessible via the Wayback Machine.
Title: Re: New patch: Hasty T-Rex Glitch fix
Post by: Imzogelmo on May 31, 2016, 07:07:47 PM
Well, admittedly, I put mine out there because there was nothing else out at the time, and I was hoping to get folks talking and figuring out more stuff.
Title: Re: New patch: Hasty T-Rex Glitch fix
Post by: assassin on May 31, 2016, 07:40:18 PM
Yeah, but yours was the only one I could find until Assassin showed me his, and his is only accessible via the Wayback Machine.

http://slickproductions.org/docs.php?id=FF6

:P

but no disagreement on mine.  Slick's is probably the best of the three.  it includes a majority of mine, and it was my understanding that it had most or all of Imzogelmo's.
Title: Re: New patch: Hasty T-Rex Glitch fix
Post by: 13375K31C43R on May 31, 2016, 07:43:27 PM
Oh, right. Sorry, that is actually the one I've been using, as a matter of fact. It just includes so little explanation that it's hard to find anything in the code.

I don't mean to take anything away from you, sir.
Title: Re: New patch: Hasty T-Rex Glitch fix
Post by: 13375K31C43R on February 20, 2018, 11:19:13 PM
:bump: GBA port!