priority for displaying sprites

A place for people with an interest in developing new shmups.
Post Reply
User avatar
ED-057
Posts: 1560
Joined: Fri Jan 28, 2005 7:21 am
Location: USH

priority for displaying sprites

Post by ED-057 »

When 2D objects overlap on the screen what kinds of things should come out on top? For instance I am wondering whether I should give the player the highest priority or if it would be better if enemy bullets and the like were displayed first. What do you think?
neorichieb1971
Posts: 7668
Joined: Wed Jan 26, 2005 1:28 am
Location: Bedford, UK
Contact:

Post by neorichieb1971 »

Surely whatever has the highest altitude would make sense. I don't know of any shmups where meshing sprites does not produce a hit, therefore eliminating both sprites.

In terms of "grazing" I would say its important for the bullet to be seen at all times, otherwise you can't see it. Sometimes this is done by changing the color of the bullet as it passes through/under/over the main ship.
This industry has become 2 dimensional as it transcended into a 3D world.
Zhon
Posts: 141
Joined: Wed Jan 26, 2005 1:12 am

Post by Zhon »

Enemy bullets/hazards on top of everything else
then Player sprite, then Enemy sprites (or these two reversed)
then Player shot
then Medals, Bonuses, Pickups
then come numerals indicating chain, bonus value, etc.

You want the most important/dangerous (enemy bullets, enemies themselves) to be on top, generally. This is especially key in manics. Of course, you can break the rules to make things interesting, like putting a cloud on top which obscures things, but this generally just annoys the player because under the cloud you have no idea where the bullet is, etc.
User avatar
fog
Posts: 38
Joined: Fri Feb 18, 2005 5:13 pm
Location: Newcastle, England
Contact:

Post by fog »

It's not always that straight forward though is it?

What about FX for explosions etc? For accuracy they should probably be on top but as this could obscure everything it doesn't always make it fair on the player or for good gameplay.

If there is any conflict like this then gameplay should always take priority.
kemical
Posts: 580
Joined: Wed Jan 26, 2005 1:14 am
Location: Tokyo

Post by kemical »

maybe something like this, bg/fg layers depend on how you're making the game though

hud / stats

fg layer 3

power ups

bullets enemy
player
bullets player (including impact effects)


enemy_alive air
explosions air (death)
enemy_death air

air to ground projectile/bombs
air to ground explosions

enemy_alive ground
explosions ground (death)
enemy_death ground

bg layer 2
bg layer 1
bg layer 0
User avatar
ED-057
Posts: 1560
Joined: Fri Jan 28, 2005 7:21 am
Location: USH

Post by ED-057 »

heh, well there aren't going to be quite that many layers as I'm working with the TG-16.

I'm thinking I will fix the score/etc. at the highest priority, and the player (and player's weapons) at the lowest. Everything else will be variable but perhaps I can have enemy projectiles always take the highest priority sprite that is available. When other objects are created they will be assigned to the lowest priority sprite that is available.

I should have a one-level demo finished in about two weeks.
User avatar
shiftace
Posts: 435
Joined: Tue Jan 25, 2005 10:18 pm
Location: yes

Post by shiftace »

I think there's a difference between layer and priority. In the case of layers, everything at layer A is either above or below everything at layer B. With priority, I think of it more as, "given that the processor might not be able to render every sprite before the frame has to be output, which sprites get drawn first?" This situation, when the hardware can't render everything in time, leads to either slowdown (render everything) or flicker (render only the highest priority sprites until time's up). The priority numbers can change from frame to frame.

I guess in that sense, priority was mostly a big deal for NES games. I don't know how good the PCE was with sprites. I don't recall any flicker in Blazing Lazers, but I never got to spend a lot of time at it.

For layers, bullets > enemies > powerups > player objects. I dunno about score, it could fit in anywhere.
User avatar
ED-057
Posts: 1560
Joined: Fri Jan 28, 2005 7:21 am
Location: USH

Post by ED-057 »

here's a work-in-progress screenshot

Image

If I release the source later, along with the gfx/level editor and music related utilities, how many people would think about making TG-16 shmups?
Post Reply