Page 1 of 1

Sprite half in front of PLAN_A and the other half behind.

Posted: Thu Oct 10, 2019 9:12 pm
by cloudstrifer
Hi!

PLAN_A have priority = TRUE and Sprite have priority = TRUE, I've checked if my code change it in somewhere, but it doesn't happens.
There is a explanation for it?

Thank you!


My issue
rom_002.jpg
rom_002.jpg (56.26 KiB) Viewed 9102 times
rom_003.jpg
rom_003.jpg (50.15 KiB) Viewed 9100 times

ROM DOWNLOAD
https://www.mediafire.com/file/1irl8z11 ... m.rar/file


Is it works like the animation bellow, correct?
79148279.gif
79148279.gif (73.51 KiB) Viewed 9102 times

Re: Sprite half in front of PLAN_A and the other half behind.

Posted: Fri Oct 11, 2019 8:04 am
by Stef
You also need to have correct priority sprite wise (which are disconnected from high / low priority stuff). If you are using SGDK you can use the SPR_setDepth(..) method to change inter-sprite priority.

Re: Sprite half in front of PLAN_A and the other half behind.

Posted: Fri Oct 11, 2019 1:42 pm
by cloudstrifer
Solved.

Issue caused by Pirate depth (Prio = FALSE and depth = MIN_DEPTH +40 aprox.) , after changed to MAX_DEPTH it works.
How sprite depth can afect PLAN_A tile depth?
I don't understand.

Thank you!

Re: Sprite half in front of PLAN_A and the other half behind.

Posted: Fri Oct 11, 2019 5:17 pm
by cero
You have another sprite covering your high-prio-bit sprite. That low-prio-bit sprite is higher in sprite priority, which means it covers your high-prio-bit sprite, but lower in the plane bit priority, which means it's below the high-prio plane.

Tricks like this are commonly used back to the NES era for various effects.

Re: Sprite half in front of PLAN_A and the other half behind.

Posted: Fri Oct 11, 2019 5:48 pm
by cloudstrifer
It's so strange :shock: .
Looking how SNES version of Goof Troop works, I saw the inverse, something like a "reveal area", I don't know if it is easily possible on Sega Genesis.

:D :D :D
Thank you!

Re: Sprite half in front of PLAN_A and the other half behind.

Posted: Fri Oct 11, 2019 8:50 pm
by Miquel
The whole effect can be done even better using only one plane:
- Launching bombs characters are low priority
- Using only plan B with low priority, except for
- The tiles which are in front of the bomb launchers
- Set black as the background color, and the same color number as index 0 on that palette

Apart for only using only one plane, can you see why is better?

About the running bombs on weed, you need a new sprite to draw the shadow on bottom of the bomb, so that will hide the lower bomb part.
To my point of view, is gross that bomb launchers have shadows and bombs haven’t.

Re: Sprite half in front of PLAN_A and the other half behind.

Posted: Sat Oct 12, 2019 1:01 am
by cloudstrifer
Miquel wrote:
Fri Oct 11, 2019 8:50 pm
- The tiles which are in front of the bomb launchers
I agree, it's better.
I think SNES version do it too.

I don't know how to change depth of specific tile.

Thank you!

Re: Sprite half in front of PLAN_A and the other half behind.

Posted: Sat Oct 12, 2019 7:42 pm
by Chilly Willy
cloudstrifer wrote:
Sat Oct 12, 2019 1:01 am
I don't know how to change depth of specific tile.
Most significant bit of the tile entry in the map is the priority bit.

Re: Sprite half in front of PLAN_A and the other half behind.

Posted: Tue Oct 15, 2019 3:56 pm
by cloudstrifer
Nice!
Now it's using only PLAN_B.
First I put full screen with low priority, then it load's 7 little tile maps (4x4) to put in front with high priority.

Code: Select all

VDP_loadTileSet(boss_hide_02.tileset, *paramInd, DMA);
paramMapA = unpackMap(boss_hide_02.map, NULL);	
VDP_setMapEx(PLAN_B, paramMapA, TILE_ATTR_FULL(PAL0, TRUE, FALSE, FALSE, *paramInd), 7, 12, MapXPosInTile, MapYPosInTile, 4, 4);
*paramInd += boss_hide_02.tileset->numTile;
MEM_free(paramMapA);