AncientBeast icon indicating copy to clipboard operation
AncientBeast copied to clipboard

sprite sheet animation support

Open DreadKnight opened this issue 5 years ago • 3 comments

The modular unit abilities classes should be extend to properly support animation sprite sheets which will be rendered in blender and assembled using https://github.com/FreezingMoon/Spritify Will need to store the animation info in different files: assets/units/animations/unit_name.json.

DreadKnight avatar Jul 08 '20 23:07 DreadKnight

Using sprite atlases would probably cut down page load times quite a bit.

I checkout out Spritify, linked above. There's the Sharp library on npm that doesn't require ImageMagick to be installed on the user's system.

I've got a simple sprite atlas creator that uses Sharp. It's really simple though. It only makes a single "page" of images and doesn't care much about efficiency. (I was just making pixel art games and everything easily fit in a single 1024x1024 image, so I didn't bother improving the packing or implementing multiple pages.)

With an extra script, we could have multiple "pages" – but I don't know if it's worth implementing for the current version of AB.

Fwiw, I've already put it into the Vue/Three.js version I've been working on. Here's the current sprite sheet.

atlas

andretchen0 avatar Jul 07 '23 20:07 andretchen0

Using sprite atlases would probably cut down page load times quite a bit.

I checkout out Spritify, linked above. There's the Sharp library on npm that doesn't require ImageMagick to be installed on the user's system.

I've got a simple sprite atlas creator that uses Sharp. It's really simple though. It only makes a single "page" of images and doesn't care much about efficiency. (I was just making pixel art games and everything easily fit in a single 1024x1024 image, so I didn't bother improving the packing or implementing multiple pages.)

With an extra script, we could have multiple "pages" – but I don't know if it's worth implementing for the current version of AB.

Fwiw, I've already put it into the Vue/Three.js version I've been working on. Here's the current sprite sheet.

atlas

Nice, wasn't aware of Sharp, could come in handy. The sprite sheets are important when we'll have unit animations, hence why later in the milestone. For now we could use it for unit sets avatars, like in unit grid and queue, #1736 Pagination will be good, as there are plans for 2 more unit sets; Dark Priest could be skipped to stick with power of 2.

I'll update #198 in a bit to be about Phaser, but same idea, that way we'll reduce 1-3 Dark Priest sprites. And in v0.6 we can migrate to Phaser v3 #1584 so that we can implement #678 and make the game be lightweight initially & load fast.

DreadKnight avatar Jul 08 '23 21:07 DreadKnight

Death animations should deprecate #2520 if accepted.

DreadKnight avatar Oct 28 '23 16:10 DreadKnight