Playing Mystery World Dizzy, I noticed something I had not seen before (or did not pay attention). It's about hiding the object (sprites) behind the background (for example, a large pillar at the beginning of the game).
It is known that bit5 in the OAM attribute is responsible for displaying sprites behind or in front of background elements/tiles. Only from what I know, it works on all the elements of the background at the same time.
I wonder how it was done that the character / sprite smoothly enters behind pilar, but at the same time being partially visible on a completely different part of the background (front of the wall).
I am very curious how it was done.
OAM Sprite Attribute Bit 5 (Priority: front/behind BGR)
Moderator: Moderators
Re: OAM Sprite Attribute Bit 5 (Priority: front/behind BGR)
If two sprites are overlapping, the overlapping pixels are determined by only one of them: the sprite lowest in OAM. If bit 5 of the lowest sprite is set, the overlapping pixels will be rendered behind the background, regardless of the other sprite's attributes.
In your image, I'm guessing that opaque sprites are being drawn where the columns are, and that these sprites have bit 5 set and are lower in OAM than the sprites of Dizzy. The overlap of these sprites with Dizzy will render as the background, thus creating the effect you see.
In your image, I'm guessing that opaque sprites are being drawn where the columns are, and that these sprites have bit 5 set and are lower in OAM than the sprites of Dizzy. The overlap of these sprites with Dizzy will render as the background, thus creating the effect you see.
Re: OAM Sprite Attribute Bit 5 (Priority: front/behind BGR)
Yup, high priority (i.e. low OAM index) opaque sprites with the "behind the background" bit set, positioned along the edge of the column. If other sprites try to overlap those, they lose the battle because their OAM indices are higher, but then, when it's time to draw the winning high priority sprites, no sprite pixels are drawn because they are "behind the background".
This trick allows you to make sprite masks in whatever shape you need, as long as you don't blow your sprites-per-scanline budget.
This trick allows you to make sprite masks in whatever shape you need, as long as you don't blow your sprites-per-scanline budget.
Re: OAM Sprite Attribute Bit 5 (Priority: front/behind BGR)
Ok, everything is clear. Thanks. I did not notice that at the moment when the Dizzy touches the pillar, additional sprites are placed on the edge of the pillar.
A similar effect is in Wonderland Dizzy, but there visible Sprite overflow reveals the use of additional sprites to make the character hide behind the wall.
A similar effect is in Wonderland Dizzy, but there visible Sprite overflow reveals the use of additional sprites to make the character hide behind the wall.
Re: OAM Sprite Attribute Bit 5 (Priority: front/behind BGR)
Another game that uses this trick is Nightshade. The very first room in the game has a pillar in the foreground that allows you to observe this effect.