RPG animating 4 directions

Hello, I am building a 2d multiplayer isometric rpg using LibGDX where the players and npcs can face north, south, east, and west. I’m currently using a walking spritesheet from http://gaurav.munjal.us/Universal-LPC-Spritesheet-Character-Generator/ which was easy enough to animate but I want to be able to dynamically equip the characters with weapons and armor and also sync that information over the network. The player will ideally be able to face 4 directions, sit, swing a sword, shoot a bow. These are all fine to do on a base sprite but the gear needs to attach properly during these animations.

The awful first solution I got working was to create a spritesheet for the weapon so that as the players hand moves in the animation, the weapon animates to follow the hand. This is just unsustainable to make a spritesheet with like 60+ frames for each piece of weapon and armor, also the overhead to load all these files and split them in to textureregions and animations I can see really destroying performance.

I have looked in to software like spline and spriter and it seems really complicated and mostly for just animating one side and flipping, so you have 2 directions.

I guess another option is to go 3d but I’m already pretty far in to making my game that starting over i 3d would be a huge setback.

I plan to use the same naked man spritesheet as the base for a lot of npcs so another idea I have is to make an array of the x and y of all the hand locations during the animation and then move the sword to that position in each frame, but then there’s also rotating the weapons as they move to look proper, and armor will have to line up to different leg positions, etc.

How do games such as Tibia accomplish this? Open to any solutions, thank you!

Just so you know, flipping instead of creating a sprite for each direction a comprise. That is, you are trading speed for memory.

Also, are you pooling your sprites? Images are very big resources, esp. when not compressed. If you pool, then hundreds of entities can share the same sprite. Images and sound are usually the only resources that you should pool.

Also, i recommend you load all assets at startup. Else, seperate your scene into chunks.

Also, your animations do not need to be complete. You would surprised how powerful the human eye is. Just wait a few frames or a specified duration before moving on to the next part of the animation.

In PS1 games, namely The Legends of Dragoon, they used pre-rendered scenes with dynamic entities. They used a green color which stated the player would be behind the pixels drawn. They cut out what would be in front and replaced with green.

Why am I bringing this up?
You can use the same method easily, with shaders of course. Load in a texture atlas into a unit as well as the weapon, and use logic to determine the output pixel. Of course you will still have to keep track of the position of the sword. I would NOT animate a sword character from a bow character. The only things you need are his positions.

Wrong forum section for JGO re: libgdx and all, but I’ll give my two cents despite this being an older post.

Since you are using libgdx check out Spine.

Potentially consider purchasing an asset set such as https://mobilegamegraphics.com/product/isometric-tower-defense-assets/

What is really nice about this tower defense asset set is that there are 27 characters that already have Spine animations in all iso directions; for $40!

Just like there is an API and support for loading tile maps in libgdx there also is a library addition that handles runtime concerns of using Spine animated models for libgdx. For $40 you can get all those assets and the animation support which can more or less be dropped into libgdx. Spine would be a worthy purchase as well for continuing to tweak or create anything animated such as switching weapons. Conceivably if the base characters follow the same animation templates you could potentially separate the base characters from the weapon animation.

Here is a post on the Spine forum about this.