gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Coding > VERY VERY Strange problem with sprite/bg's and prioritiesWTF

#21572 - TwinD - Tue Jun 01, 2004 2:01 am

Ok, the problem:
I have a menu system, the layers are laid out like this:

BG0 - Priority 3 - Sky Blue BG
BG1 - Priority 2 - the first set of windows
Sprite Text - Priority 2 - First set of text
BG2 - Priority 1 - the second set of windows

OK, now just these together all work fine, no problem, everything is laid out the way it should be.

now we add another layer of Sprite Text with priority of 1 and I get this:

[Images not permitted - Click here to view it]

This is just COMPLETELY f'ed up. Can anyone tell whast going on here? The bottom sprites start showing THROUGH the background despite their priorities being correct in OAM and the BGs priorities being correct.[/img]

#21578 - TwinD - Tue Jun 01, 2004 5:13 am

here's a link to a rom that shows off the problem, just press a on inventory to bring it up:

http://www.sarinsoft.net/bol.rar

#21603 - Lord Graga - Tue Jun 01, 2004 7:51 pm

This probably won't fix it, but I suggest that you let the BG's go in their "natural" position (E.G, bg0 is on top, then comes bg1, and so on).

#21606 - abilyk - Tue Jun 01, 2004 8:52 pm

I'd take a look, but I don't have a rar extracting program. For such a small file, I wouldn't compress it at all, but if you're going to, I personally suggest doing so into a .zip. I imagine more people would be able to deal with that format.

#21610 - poslundc - Tue Jun 01, 2004 9:05 pm

Are you using a raster technique to conserve OAM? If so, I'll reckon the problem lies there somewhere.

Dan.

#21614 - TwinD - Tue Jun 01, 2004 10:41 pm

Already fixed it, thanks though.

#21619 - sajiimori - Tue Jun 01, 2004 11:46 pm

What was the problem?

#21659 - tepples - Wed Jun 02, 2004 7:11 pm

Use the priority field of OAM attribute 2 only for sprite-to-background priority, and use OAM ordering for sprite-to-sprite priority. Using priority for sprite-to-sprite priority won't produce what some may naively expect. Details in the Graphics section of the Beginners' FAQ.

Was this the problem?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.