øAslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&topic=2331.0e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/indexf164.htmlslickproductions.org/forum/index.php?PHPSESSID=5f0fck550j2m4m2fpbtkj2vkm1&board=8.60e:/My Web Sites/Slick Productions - FFIV Message Board/slickproductions.org/forum/indexf164.html.zx°$h^ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÈà•¤ŒúOKtext/htmlISO-8859-1gzip8:ÖŒúÿÿÿÿÿÿÿÿTue, 10 Mar 2020 23:53:44 GMT0ó°° ®0®P®€§²ð®¯$h^ÿÿÿÿÿÿÿÿ„'Œú Sprite Priority Bug?

Author Topic: Sprite Priority Bug?  (Read 1276 times)

TheNattak

  • Garula
  • *
  • Posts: 203
  • Gender: Male
  • Mike
    • View Profile
    • Return of the Dark Sorcerer
Sprite Priority Bug?
« on: January 15, 2017, 07:17:06 PM »
Anyone know why or just plain notice how snes9x, as well as bsnes (accurate emulators, the issue is not present with zsnes), have issues with monster graphics on enemy formations that have 4 monsters in them when spells or w/e are used? How they flicker and chunks of the monster sprite vanish and the hand cursor too, for the entirety of the battle... For instance this wolf missing the top of it's sprite: http://imgur.com/a/cezDr

And here, the bottom right mammoth, just a tiny bit off him.: http://imgur.com/a/HBUCr

From what I've noticed it seems to happen with 4 or more enemies on the screen when certain animations take place. Once there becomes 3 it no longer happens. But then again, I notice it does it on my giant final boss replacing god kefka, and that's just 1 sprite... so I'm not too sure about what the issue stems from, vram maybe? I see it happen with 2 large sprites like behemoths when they cast Meteo, and Atma as well, so yeah.

Also puts a big invisible line through the hand cursor, after it does it. or before even when I tested on higan:
http://imgur.com/a/ke6rq

The invisible mould is clipping into the sprite it seems: http://imgur.com/a/bcjL4
making it so the moulds do not intersect does indeed fix it from happening, but this is not a feasible fix since some of the formations look bad moving the monster too far up or down. And like I say it happens on large sprites not in a formation of 4, so I dunno.

To see this in action, use Heal in that mammoth battle and the top of the mammoth flickers, and the hand cursor has an invisible line going through it for the rest of the fight. I've had someone confirm it happens on a flash cart so it seems to be a real issue on hardware, though I don't recall seeing this happen as a kid playing the hell out of the game...

If this is indeed an issue with the actual game, is this something that can be fixed I wonder?
« Last Edit: January 15, 2017, 10:47:40 PM by TheNattak »

assassin

  • Bane of Retards
  • *
  • Posts: 1,033
  • space bears are not gentle!
    • View Profile
    • My Barren Webpage
Re: Sprite Priority Bug?
« Reply #1 on: January 15, 2017, 10:46:56 PM »
check this thread:
http://www.ff6hacking.com/forums/showthread.php?tid=2552

Madsiur talks about the limitations.

and this one, namely the second page / last post:
http://www.ff6hacking.com/forums/showthread.php?tid=2563

Stray Aspik has a good theory there.  Magitek Armor is definitely key in this.

finally, this is good reading, but doesn't get into those specific issues:
http://mnrogar.slickproductions.org/phpBB3/viewtopic.php?f=3&t=470

it's more about making sure custom moulds comply with limits.

Quote
I see it happen with 2 large sprites like behemoths when they cast Meteo, and Atma as well, so yeah.

did you get the issues with them on vanilla?

TheNattak

  • Garula
  • *
  • Posts: 203
  • Gender: Male
  • Mike
    • View Profile
    • Return of the Dark Sorcerer
Re: Sprite Priority Bug?
« Reply #2 on: January 15, 2017, 10:57:55 PM »
Yes on vanilla. The issue does indeed happen on formations without the Magitek armor. It does sound like a pixel overflow issue from reading Aspik's post, which would explain why it goes away when one of the four monsters is killed. And really large sprites along with spell animations I guess. But it's real bad and obvious, the flickering and removal of pixels when certain spells/animations happen, I really don't remember it happening on SNES, I think.

Lenophis

  • Forum Overlord
  • *
  • Posts: 1,688
  • Gender: Male
  • I sad
    • View Profile
    • Slick Productions
Re: Sprite Priority Bug?
« Reply #3 on: January 15, 2017, 11:04:32 PM »
This is a hardware limitation that the game seemingly tried to avoid, but wasn't 100% able to. Best you can do is shuffle sprites around to hopefully avoid it.

119 bugs fixed and counting.

TheNattak

  • Garula
  • *
  • Posts: 203
  • Gender: Male
  • Mike
    • View Profile
    • Return of the Dark Sorcerer
Re: Sprite Priority Bug?
« Reply #4 on: January 15, 2017, 11:17:32 PM »
Ah I see, this is good to know. Thanks fellas. I do find it odd though that the less accurate zsnes the issue is not present. Sometimes less accurate can bypass some technical issues I suppose.
« Last Edit: January 15, 2017, 11:24:35 PM by TheNattak »

assassin

  • Bane of Retards
  • *
  • Posts: 1,033
  • space bears are not gentle!
    • View Profile
    • My Barren Webpage
Re: Sprite Priority Bug?
« Reply #5 on: January 15, 2017, 11:26:37 PM »
i don't recall seeing it on the SNES, either.. but i might not have even seen it on vanilla emulated (generally Snes9x 1.39).

it does seem unlikely that ZSNES would dodge a straight-up storage limitation, since i doubt it's nice enough to create extra space for sprites.  which suggests more of a speed or timing issue...  wish i knew more.

13375K31C43R

  • Ultros
  • *
  • Posts: 675
  • Gender: Male
    • View Profile
    • Leet Sketcher's Final Fantasy III Patches
Re: Sprite Priority Bug?
« Reply #6 on: January 16, 2017, 03:28:45 AM »
I feel as though the reason why we don't see this on ZSNES might be related to the fact that ZSNES erroneously displays sprites over whatever windows are displayed at the bottom.
"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: Sprite Priority Bug?
« Reply #7 on: January 20, 2017, 06:51:49 PM »
it's fun to watch this unfold in an emulator that lets you toggle all the graphics layers.  the game goes nuts moving the sprites between layers.  (i used bsnes v0.073 (Qt GUI) this time, considerably newer than what i recommended before.  the lack of an official changelog makes it hard to pin down when this feature went away, or maybe it's still in the source code waiting to be activated.)

for the monster attacks in that Mammoth battle, the timing suggests that damage numerals are responsible for the missing chunk.  as for Heal Force, maybe it's the top part of the green sparkle?  for me, the chunks have only been temporary; the only time i got them permanently was when being annihilated and letting the battle sit.

and a good theory about the ZSNES shortfall.  i'll have to doublecheck whether the ancient Snes9x 1.39 i use has the same limitation.

Lenophis

  • Forum Overlord
  • *
  • Posts: 1,688
  • Gender: Male
  • I sad
    • View Profile
    • Slick Productions
Re: Sprite Priority Bug?
« Reply #8 on: January 20, 2017, 11:26:17 PM »
The SNES had a similar limitation to the NES, as it can only display so many sprites per scanline. This is the reason for the display bugs that appear in the few battles they show up in.

119 bugs fixed and counting.

Madsiur

  • Tunnel Armor
  • *
  • Posts: 149
  • Gender: Male
  • FF6AE coder
    • View Profile
    • Madsiur's Lair
Re: Sprite Priority Bug?
« Reply #9 on: January 21, 2017, 12:23:20 AM »
i used bsnes v0.073 (Qt GUI) this time, considerably newer than what i recommended before.  the lack of an official changelog makes it hard to pin down when this feature went away, or maybe it's still in the source code waiting to be activated.

I found this: http://ngemu.com/threads/bsnes-v0-073-is-released.140465/

Not that version 0.073 is also the one used by Revenant for bsnes+, there could be a reason for this instead of using a more recent version...

assassin

  • Bane of Retards
  • *
  • Posts: 1,033
  • space bears are not gentle!
    • View Profile
    • My Barren Webpage
Re: Sprite Priority Bug?
« Reply #10 on: January 21, 2017, 06:42:34 PM »
Lenophis: huh, i might've heard of that limit before, but had forgotten about it, and never would've guessed it applied here anyway.  it's 32 sprites per scanline, and 34 8x8 sprite tiles per scanline.  sure enough, checking the Sprite Status in Geiger during that battle with Vomammoths indicates a ton of them with a starting Y coordinate in the high double digits to low 100s.

and from what i read, even the transparent parts of sprites count towards this limit.  i believe this explains what i'm seeing with Terra's damage numerals taking a tiny chunk out of the bottom Vomammoth.  the bottom of the visible digits is above the top of the foe -- but the numerals sprite must extend further down (as sprites in the battle are either 16x16 or 32x32 size).

why didn't Square just give the damage digits a wicked high sprite number (i.e. to lower the priority)?  do they need to take precedence over anything besides the entity receiving the damage?  (and if it's really short, maybe any entity right above/behind it.)  now, this wouldn't get rid of problems like those from the Heal Force sparkle, but seems like one of the simpler measures.

Quote from: TheNattak
The invisible mould is clipping into the sprite it seems: http://imgur.com/a/bcjL4
making it so the moulds do not intersect does indeed fix it from happening, but this is not a feasible fix since some of the formations look bad moving the monster too far up or down.

maybe not in some battles, but certainly a perfect one here.  it's funny to see that FF3usME pic and speculate about some Square employee turning down a layout of bordering moulds, and insisting that "no, no", the small (but eventually devastating) overlap is "just right".

also, condensing these formation layouts to fit on the GBA screen could've wreaked havoc, but it looks like the per-line limit works differently: http://problemkaputt.de/gbatek.htm
« Last Edit: January 21, 2017, 07:09:56 PM by assassin »

assassin

  • Bane of Retards
  • *
  • Posts: 1,033
  • space bears are not gentle!
    • View Profile
    • My Barren Webpage
Re: Sprite Priority Bug?
« Reply #11 on: February 07, 2017, 12:15:13 PM »
why didn't Square just give the damage digits a wicked high sprite number (i.e. to lower the priority)?  do they need to take precedence over anything besides the entity receiving the damage?  (and if it's really short, maybe any entity right above/behind it.)  now, this wouldn't get rid of problems like those from the Heal Force sparkle, but seems like one of the simpler measures.
nevermind, i'm daft.  as long as the max sprite count is being exceeded, this suggestion would instead make the numerals disappear, which is probably worse than current behavior. :isuck:

one measure some games take is to alternate priorities quickly, so you get sprite flicker, rather than chunks missing for longer.  this was apparently done plenty on the more limited NES.

thepatirckinator

  • Tunnel Armor
  • *
  • Posts: 159
  • Gender: Male
  • God bless you all!
    • View Profile
Re: Sprite Priority Bug?
« Reply #12 on: February 24, 2017, 06:30:27 AM »
In the original games, sprites that never made it into the game look glitchy when they are used. All the other sprites may not look glitchy because they exist in game data but are unused.