fishfolk / punchy

A 2.5D side-scroller beatemup, made in Bevy

Home Page:https://fishfolk.github.io/punchy/player/latest

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Aesthetic attachments (hats++)

erlend-sh opened this issue · comments

There is a reference implementation of this in Jumpy:

Though in Punchy it gets more advanced because our characters have more varied movement sets that need to be animated properly. A hat attachment is harder to do right if a character can perform a head-butt, tilting their head at an angle.

CE1C9DB6-DDCB-4727-AFE9-DCFFAA818E48
99E6F920-0854-4814-801B-9AA5532022C8
AF466C6A-8A07-43A7-BAEE-2A182F73B344

Even harder if a character has a tattoo variation:
4DABF2ED-3685-43D5-B25C-FC0B3DFE02AF
0F0AC534-1310-4565-ACA2-7062CE9172B7

Yet we’re obviously looking at the same core model for both of these examples respectively. What techniques are available to us if we wanna treat these aesthetic variants as attachments that don’t require us to fully hand-paint each new character variant?

I might need to think about this more, but here's my first thought for possible strategy:

  • Hats can just be a layer placed directly on top of the fighter sprites.
  • Because of the complicated animations, I think we'll just have to say that a hat must have all the same animation frames as the fighter that it is able to be placed on top of.
    • In other words, it would be a spritesheet of the same dimensions as the fighter, and if you were to layer the hat spritesheet directly on top of the fighter sprite sheet you would see the fighter with the hat on through all his animations.
  • Because different fighters have different animations, each hat will be designed to be compatible with a certain fighter animation.
    • If multiple fighters have the same animations, but different colors/aesthetics, the hat could be compatible with all of them.

This should be easy to implement, and it allows for maximum expressiveness with hat designs. They don't even have to be hats, as shown above, they could be belts, bandanas. They could even be animated masks or particle-like effects.

The downfall is that you can't just make a single hat sprite and have it fit the player, but I don't think that would produce the desired aesthetic anyway. The animations are just too complex.

We could add an "easy hat" mode that would use a single sprite for the hat, but that makes implementation more complicated potentially because we have to mount that hat to some sort of "bone" or collision box representing the players head, and it wouldn't look great, so I feel like that isn't worth the effort.

Okay I basically think its unlikely we will be able find a way around having to make animation frames for hats/attachments, but one thing that could be reference is this https://www.youtube.com/watch?v=HsOKwUwL1bE.

It seems like trying to do something like that could almost work for our application, but it also seems like even if we could implement something like that it might be a complex and unfamiliar workflow for actually making the assets which might not be worthwhile.

A tool like https://github.com/Bauxitedev/bitmapflow by @Bauxitedev might come in handy here. Some key animations would still need to be handmade, but the ‘inbetweens’ would be computer-generated.

This might play into how we deal with item/weapon animations as well. I suspect we might want generic/a few variations of swing animations for fighters, which can have an item placed in their hand. #86

I'll claim this, I think the animation based route is the best one, it'll probably look the best, and with the tools above the animation part will be easier.

For this I was thinking of making a attachment component, and with it we could deal with the hats and other attachments more globally, that would work for items like the box and the weapons, and also with the hats.
That would also deal with sprite facing and transform facing changes.

I really like the idea of having a standard way to handle attaching things to the player. 👍