Find nearest existing sprite angle

Remember it never hurts to ask, but you might not get it.
Post Reply
User avatar
Marscaleb
Posts: 89
Joined: Sat Jun 25, 2016 12:57 pm
Location: California or Utah
Contact:

Find nearest existing sprite angle

Post by Marscaleb »

This is one I've thought of for a while. I'm just gonna post this here and then disappear into a puff of smoke for a few months again.

There are basically three options for how a sprite is viewed. It is either viewed the same from all angles, it has eight versions to be viewed from eight angles, or 16 versions for 16 angles.
And when you use one of the latter two, you absolutely have to have all those angles available. If you don't, when the game tries to render the missing angle, you just see a question mark.

I'd like to see an option where the engine will instead basically just grab the nearest angle that actually exists.

For example, instead of having the death animation be drawn solely for being seen from the front (and instead of drawing that sequence eight times for each angle) you could draw a second animation viewed from behind. And which of those two animations is displayed just depends on if the player is closer to the back or the front. (Or a more practical method would be to draw the animation from the rear 45 angle, or just the side, but the same principle applies.)
For a second example, maybe I want to draw animations for my character for the angle just between front and the front 45, just to make its movements look a little more natural from the front, which is where the player usually sees the character. But I don't want to double the amount of sprites needed to fill out the full 16 angles. And for projectiles this is especially true; I definitely want to be able to make my rockets and fireballs have that extra distinction for those few extra degrees near the front.

The whole point of this is that you can add some extra angles to your characters just where you want it without having to draw out every single possible angle. The engine will just display the frame from the closest angle that exists, whatever that may be.

The more I think of it, the more I think this shouldn't even be an option, it should just be the way the game always works.

CeeJay
Posts: 224
Joined: Sat Jan 26, 2013 9:56 am

Re: Find nearest existing sprite angle

Post by CeeJay »

Sounds like a good idea to me, even if it wouldn't be used all that much. I've come across sprites from various FPS games that use limited angles in a similar fashion, such as front, side and back (three angles) and ones where only the front and back are used.

As long as it doesn't mess up the normal sprite handling, I'm all for it.

User avatar
Marscaleb
Posts: 89
Joined: Sat Jun 25, 2016 12:57 pm
Location: California or Utah
Contact:

Re: Find nearest existing sprite angle

Post by Marscaleb »

CeeJay wrote:Sounds like a good idea to me, even if it wouldn't be used all that much.
It's something that I've thought of when designing new enemies. Really just for the exact examples I used above. It would be really nice if there was just one more angle for the death animation. Or just slip in one more angle near the front so if an enemy is shooting near but not-quite at you, you can distinguish it better.
It would be more pertinent for a co-op game, but still. It adds a bit of detail and improves the look, but without having to draw eight times as many frames.