øAslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=2314.0e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index556d.htmlslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&board=8.40e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/index556d.html.zxs$h^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈà•¤7êOKtext/htmlISO-8859-1gzip0|Ö7êÿÿÿÿÿÿÿÿTue, 10 Mar 2020 23:52:43 GMT0ó°° ®0®P®€§²ð®r$h^ÿÿÿÿÿÿÿÿÎ$7ê New patch: Overhead Bug fix

Author Topic: New patch: Overhead Bug fix  (Read 845 times)

13375K31C43R

  • Ultros
  • *
  • Posts: 675
  • Gender: Male
    • View Profile
    • Leet Sketcher's Final Fantasy III Patches
New patch: Overhead Bug fix
« on: December 08, 2016, 12:58:36 AM »
Hey, hey! Guess which genius figured out how to fix that weird glitch that makes the Ragnarok Magicite appear over the party's head in Narshe's Weapon shop! Not only that, I figured out the meanings of two bits that are labeled as "unknown" in FF6LE and Zone Doctor (at least in the version I use). Movement event script command C8 sets the current entity's "layering priority" to a certain value; in each NPC's 9-byte data starting at C4/1D52, bits 8.3 and 8.4 indicate the starting value of the layering priority. I figured out that by changing that value for the Magicite NPC, swapping its place with the guy who holds it, and clearing its "walk under" bit, I could make it always show up over the man but under your character's head. Huzzah! :childish: :whoa: :omghax:

:edit: July 13, 2017
Ported to PlayStation.
« Last Edit: July 13, 2017, 04:21:36 AM 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,033
  • space bears are not gentle!
    • View Profile
    • My Barren Webpage
Re: New patch: Overhead Bug fix
« Reply #1 on: December 08, 2016, 06:43:40 AM »
why did you need to swap their places?  is sprite index some tiebreaker when priorities match?

anyway, i was gonna recommend downloading bsnes v0.015 to diagnose this.  seriously.  most emulators toggle all sprites at once, and both priorities of a given BG # at once.  so there are 5 toggles.  but that classic bsnes release lets you enable/disable both priorities of all 4 backgrounds separately, as well as all 4 sprite priority levels -- that's 12 freaking toggles in all!

13375K31C43R

  • Ultros
  • *
  • Posts: 675
  • Gender: Male
    • View Profile
    • Leet Sketcher's Final Fantasy III Patches
Re: New patch: Overhead Bug fix
« Reply #2 on: December 08, 2016, 12:50:59 PM »
I'm not sure why I had to swap them. The thing is, if their priorities are the same, the Magicite won't appear regardless of the order unless the "walk under" bit is set, which causes the bug. My guess is, because the Magicite is added to the map via the "create object" event command, it's not able to be shown in that spot because there's already a sprite in that location with that priority, but if I change the Magicite's priority then it can be shown. But for some reason, it only works if I swap its place with the salesman.

I'll give bsnes a look-see, but why v0.015? The latest version I can find is 0.91, so who's going to use a version as outdated as 0.015?

:edit:
Actually, are you saying you were going to suggest that bsnes 0.015 might have helped me find a fix? Or if I diagnose now, what are you expecting?
« Last Edit: December 08, 2016, 01:58:57 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,033
  • space bears are not gentle!
    • View Profile
    • My Barren Webpage
Re: New patch: Overhead Bug fix
« Reply #3 on: December 08, 2016, 06:07:58 PM »
I'll give bsnes a look-see, but why v0.015?

because:
Quote from: me
that classic bsnes release lets you enable/disable both priorities of all 4 backgrounds separately, as well as all 4 sprite priority levels

Quote
The latest version I can find is 0.91, so who's going to use a version as outdated as 0.015?

someone who wants said capability, because later versions dropped it.

Quote
Actually, are you saying you were going to suggest that bsnes 0.015 might have helped me find a fix?

yes.  while i saw you fixed this case, i posted that anyway, as ancient bsnes could be useful for observing layers in the future.  i've long been a fan of its flexibility there, and having never given it its own topic, recommended it upon seeing a relevant post.

good work decoding those "??" bits.  so does "walk under" influence both passability *and* display priority?  if so, to what extent can it modify the latter beyond "the starting value of the layering priority"?
« Last Edit: December 08, 2016, 06:20:40 PM by assassin »

13375K31C43R

  • Ultros
  • *
  • Posts: 675
  • Gender: Male
    • View Profile
    • Leet Sketcher's Final Fantasy III Patches
Re: New patch: Overhead Bug fix
« Reply #4 on: December 08, 2016, 06:32:41 PM »
The "walk under" and "walk over" bits are not bits 8.3 and 8.4. IIRC, they're bits 7.4 and 7.5. So obviously the function is different. I'm not willing to spend weeks dissecting and debugging the code to confirm this, but my take is that "walk over" objects are always drawn underneath "walk under" objects, and "normal" objects are drawn between them, and the layering priority is merely a tiebreaker (to some extent). One thing I tried was clearing the Magicite's "walk under" bit and setting the man's "walk over" bit, but that caused a couple of other problems. One, I couldn't even talk to the guy, which obviously had something to do with the "walk over" bit being set, and two, if I stood north of him, my legs would be drawn over his head.

That's as much as I can discern because I don't know where the function is that uses all of that in one place to determine what sprites are drawn and in what order.
"Do not meddle in the affairs of wizards, for they are subtle and quick to anger." -Gildor from The Lord of the Rings

13375K31C43R

  • Ultros
  • *
  • Posts: 675
  • Gender: Male
    • View Profile
    • Leet Sketcher's Final Fantasy III Patches
Re: New patch: Overhead Bug fix
« Reply #5 on: December 08, 2016, 07:08:48 PM »
This document has a lot of useful information about drawing stuff on the screen. Check out especially what register $2105 means.

I did a little more experimenting with the starting priority of the Magicite, and priority 0 or 3 will cause the top part of the Magicite to be cut off and replaced with a hole through the salesman's chest. :eek: Priority 1 or 2 will make it display correctly and it originally had priority 2, so...maybe I could have left that part alone. Oh well, I don't think it really matters.

Register $2105 is given a value of 9 in bank C0 and that doesn't change, so in that document you'll want to look at the "p = 1" column.
"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,033
  • space bears are not gentle!
    • View Profile
    • My Barren Webpage
Re: New patch: Overhead Bug fix
« Reply #6 on: December 08, 2016, 07:33:32 PM »
yep, Qwertie's doc is very good.  another one:
http://pikensoft.com/docs/SNES_bg_layering_%28Piken%29.txt

Novalia Spirit

  • Pandora's Masking Tape
  • *
  • Posts: 33
  • Gender: Male
    • View Profile
Re: New patch: Overhead Bug fix
« Reply #7 on: December 08, 2016, 11:23:16 PM »
Quote from: assassin
why did you need to swap their places?  is sprite index some tiebreaker when priorities match?
Quote from: assassin
does "walk under" influence both passability *and* display priority?  if so, to what extent can it modify the latter beyond "the starting value of the layering priority"?

The game reserves the initial portion of OAM for entities with the "walk under" property, and does the opposite for those with the "walk over" attribute. The sprite order in OAM is the deciding factor when two sprites share the same layering priority.

Regarding the NPC editor in FF6LE, from what I recall noticing way back when it was released, the author just used Imzogelmo's NPC Data List, combined with a list of findings I sent him during my early work on bank C0. I don't think any research was actually made prior to the editor's release.
« Last Edit: December 11, 2016, 02:26:37 PM by Novalia Spirit »

Madsiur

  • Tunnel Armor
  • *
  • Posts: 149
  • Gender: Male
  • FF6AE coder
    • View Profile
    • Madsiur's Lair
Re: New patch: Overhead Bug fix
« Reply #8 on: December 09, 2016, 08:01:58 AM »
Regarding the NPC editor in FF6LE, from what I recall noticing way back when it was released, the author just used Imzogelmo's NPC Data List, combined with a list of findings I sent him during my early work on bank C0. I don't think any research was actually made prior to the editor's release.

I could be wrong but giangurgolo & Omega are more SMRPG experts I think. FF6LE was born from the same base as Lazy Shell feature-wise. FF6 was another RPG with good documentation they were able to build an editor for in a decent amount of time.

Imzogelmo

  • Ogopogo Aficianado
  • *
  • Posts: 241
  • Gender: Male
  • Ask me about my other job.
    • View Profile
    • NEPROMR
Re: New patch: Overhead Bug fix
« Reply #9 on: December 09, 2016, 05:03:09 PM »
Yes, Novalia is right. I named "walk over" and "walk under" when I made my program to generate the NPC data file, and that was just from a quick cursory look at what they seemed to do.  I think it deserves a bit more (yes, I see the pun) investigation now, especially since that terminology has stuck around in the form of editors...
5/31/16 - I have an assembly of the battle portion of C2, relocated to the F0 bank, which has both vanilla and patch code in my dropbox. I'll be updating it with additional patches as I have time. I will *not* be releasing it publicly, but ask me for the link and I'll share.

13375K31C43R

  • Ultros
  • *
  • Posts: 675
  • Gender: Male
    • View Profile
    • Leet Sketcher's Final Fantasy III Patches
Re: New patch: Overhead Bug fix
« Reply #10 on: July 13, 2017, 04:21:52 AM »
:bump: PS1 port.
"Do not meddle in the affairs of wizards, for they are subtle and quick to anger." -Gildor from The Lord of the Rings