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

SGDK only sub forum

Moderator: Stef

Post Reply
cloudstrifer
Very interested
Posts: 118
Joined: Mon Feb 19, 2018 7:31 pm

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

Post by cloudstrifer » Thu Oct 10, 2019 9:12 pm

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 8867 times
rom_003.jpg
rom_003.jpg (50.15 KiB) Viewed 8865 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 8867 times

Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

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

Post by Stef » Fri Oct 11, 2019 8:04 am

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.

cloudstrifer
Very interested
Posts: 118
Joined: Mon Feb 19, 2018 7:31 pm

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

Post by cloudstrifer » Fri Oct 11, 2019 1:42 pm

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!

cero
Very interested
Posts: 338
Joined: Mon Nov 30, 2015 1:55 pm

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

Post by cero » Fri Oct 11, 2019 5:17 pm

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.

cloudstrifer
Very interested
Posts: 118
Joined: Mon Feb 19, 2018 7:31 pm

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

Post by cloudstrifer » Fri Oct 11, 2019 5:48 pm

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!

Miquel
Very interested
Posts: 514
Joined: Sat Jul 30, 2016 12:33 am

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

Post by Miquel » Fri Oct 11, 2019 8:50 pm

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.
HELP. Spanish TVs are brain washing people to be hostile to me.

cloudstrifer
Very interested
Posts: 118
Joined: Mon Feb 19, 2018 7:31 pm

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

Post by cloudstrifer » Sat Oct 12, 2019 1:01 am

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!

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

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

Post by Chilly Willy » Sat Oct 12, 2019 7:42 pm

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.

cloudstrifer
Very interested
Posts: 118
Joined: Mon Feb 19, 2018 7:31 pm

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

Post by cloudstrifer » Tue Oct 15, 2019 3:56 pm

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);

Post Reply