0

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

Anna
  • 25
  • 1
  • 2
  • 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. – Seth Battin Apr 10 '13 at 22:27
  • 1
    Freely rotated in all directions? Or just the 8 directions? See my answer here under Creation/3D Skeletal animation – House Apr 10 '13 at 22:29
  • 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. – Anna Apr 10 '13 at 22:41
  • 1
    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. –  Apr 11 '13 at 00:36
  • 1
    Since it's 2d, try Spriter for modular animation, yet still sprites. – monkey Apr 11 '13 at 03:50

2 Answers2

3

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.

House
  • 73,224
  • 17
  • 184
  • 273
  • Game uses skeletal animation so I'm afraid this answer is not applicable:/ – Anna Apr 10 '13 at 22:44
  • 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. – House Apr 10 '13 at 22:45
  • Difference is quite huge in using frame-by-frame animations from skeletals and actually using skeletal animations:/ – Anna Apr 10 '13 at 22:47
  • So, you have some kind of IK in game? Where the animations are dynamic in game? – House Apr 10 '13 at 22:49
  • Yes, its forward kinematics BTW. – Anna Apr 10 '13 at 22:52
  • If animations are dynamic, what exactly are you animating? – House Apr 10 '13 at 23:01
  • I misunderstood your question - animations are not dynamic, they are just procedural and prerecording them using a 3D model is not really an option. – Anna Apr 10 '13 at 23:14
  • OK Anna, see my update answer. – House Apr 10 '13 at 23:25
  • I really don't understand how that's supposed to work? If you have a 2D image of the characters head. You "rotate" it with this pseudo-3D method, you still won't be able to see the back-side of the head. There's no way around generating additional content. – bummzack Apr 12 '13 at 07:12
  • Ah, I kind of left that part out. You would have the body part sprites from the 8 sides, you would display the side that best fits the angle of the bone. So you would use the bone direction and rotation to choose which sprite to display. Honesty though, the whole thing sounds like a little coding nightmare, but with the restrictions placed, it's the best I could come up with. – House Apr 12 '13 at 13:53
1

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.

bobobobo
  • 17,074
  • 10
  • 63
  • 96
  • Skeletal animation... not applicable... – Anna Apr 10 '13 at 22:45
  • 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. – Tim Holt Apr 11 '13 at 04:30
  • 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. – Anna Apr 11 '13 at 20:29
  • op said it doesnt work – GameDev-er Apr 11 '13 at 23:07