Characters in my 2D isometric game are composed of several sprites corresponding to particular body parts (head, torso, upper arm, lower arm, etc.) which let me extensively customize my characters in-game and do skeletal animations.

I would like to avoid creating animations in all eight directions and since I cannot use 3D models - there are many reasons for that and please do not suggest using 3D - I'm looking for a way to fake 3D so the character could be freely rotated in all directions, but use only one animation.

I imagine that this fake 3D could be achieved by an algorithm which would change body parts locations (x, y), their scale (xscale, yscale) and drawing order. How would I go about it?

Should I add to every sprite a fake z variable? What then? Are there any known examples of something similar?

Throw me some ideas

  • \$\begingroup\$ You are going to have to do a better defense of your objection to 3D. What you are describing is 3D. 2.5D is 3D. 3D would solve all your problems. Creating an "algorithm" would mean implementing 3D. Please explain more why it's impossible. \$\endgroup\$ Apr 10 '13 at 22:27
  • 1
    \$\begingroup\$ Freely rotated in all directions? Or just the 8 directions? See my answer here under Creation/3D Skeletal animation \$\endgroup\$
    – MichaelHouse
    Apr 10 '13 at 22:29
  • \$\begingroup\$ No, I cannot use 3D and its final I'm afraid - I already tried it :'( Character shadows, skeletal animation system and art style all require the game to be in 2D. Yes, I need to fake 3D, by creating my own 3D algorithm. Sprites which characters are composed of need to be interchangeable in-game so Project Zomboid solution is not for me. \$\endgroup\$
    – Anna
    Apr 10 '13 at 22:41
  • 1
    \$\begingroup\$ How do those things "require" the game to be in 2D? That makes very little sense. In any case, this seems too open-ended to me, so I voted to close. \$\endgroup\$
    – user1430
    Apr 11 '13 at 0:36
  • 1
    \$\begingroup\$ Since it's 2d, try Spriter for modular animation, yet still sprites. \$\endgroup\$
    – monkey
    Apr 11 '13 at 3:50

New answer:

You can still make the skeletons 3D, in game. Animate them once in 3D or generate their animations procedurally. Now, when you're rendering in game, use that 3D skeletal information to apply z levels to the 2D sprites that make up the body parts of your characters.

Now, when the 3D bone moves, use the 2D screen translation (of the current viewing angle) of the 3D bone as your X,Y movement for your 2D sprite body part. Use the translation perpendicular to the screen as your scale factor (z axis). This will change for each viewing angle. So a character waving from the front view will only have a change in X,Y of the hand body part. From the side, the scale of the hand body part will be changing.

This will be very tricky to get looking good. But you've place a lot of restrictions on yourself, and they'll be challenging to overcome. The above is the best method I can think of. Good luck!

Old answer

There is no algorithm that can guess what the other side of your 2D sprite looks like.

The way to fake this is to use 3D, but export all the frames for each animation, for each direction. It's a lot of sprites, but it means your game won't have to do anything 3D. Think about implementing 3D as it might be a little more resource friendly. For example, a single animation might be 20 frames. For all 8 directions, thats 8 (directions) * 20 (frames) = 160 sprites. 160 sprites just to represent one animation, for one character.

This method is far less work than creating the 2D art by hand, but likely more work than just using 3D.

As for known examples, Project Zomboid is doing this for their isometric animation system.

  • \$\begingroup\$ Game uses skeletal animation so I'm afraid this answer is not applicable:/ \$\endgroup\$
    – Anna
    Apr 10 '13 at 22:44
  • \$\begingroup\$ I don't understand how it's not. Unless you're talking about 2D skeletal animations, because the method I'm talking about uses 3D skeletal animation. \$\endgroup\$
    – MichaelHouse
    Apr 10 '13 at 22:45
  • \$\begingroup\$ Difference is quite huge in using frame-by-frame animations from skeletals and actually using skeletal animations:/ \$\endgroup\$
    – Anna
    Apr 10 '13 at 22:47
  • \$\begingroup\$ So, you have some kind of IK in game? Where the animations are dynamic in game? \$\endgroup\$
    – MichaelHouse
    Apr 10 '13 at 22:49
  • \$\begingroup\$ Yes, its forward kinematics BTW. \$\endgroup\$
    – Anna
    Apr 10 '13 at 22:52

I really think you will have an easier time following Clint Bellanger's method, which is assemble a fully 3D mesh and "photograph it" from the 8 isometric angles. Goblin example.

  • \$\begingroup\$ Skeletal animation... not applicable... \$\endgroup\$
    – Anna
    Apr 10 '13 at 22:45
  • \$\begingroup\$ Anna I'm not understanding your rejection here. You don't need to actually do the animation in your game, just run all the possible animations in the 3D modelling package, take screen shots for sprites, and use those sprites. No actual 3D animation required in the game, just replay of the right sprite sequence. There are a couple of packages like Model-2-Sprite and SpriteForge that will automate a lot of this. \$\endgroup\$
    – Tim Holt
    Apr 11 '13 at 4:30
  • \$\begingroup\$ Dozens of body part sprites = literally hundreds of possible combinations. It would take weeks to do what you propose and still it would be pointless. \$\endgroup\$
    – Anna
    Apr 11 '13 at 20:29
  • \$\begingroup\$ op said it doesnt work \$\endgroup\$
    – GameDev-er
    Apr 11 '13 at 23:07

Not the answer you're looking for? Browse other questions tagged or ask your own question.