Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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

share|improve this question

closed as not constructive by Josh Petrie, Byte56, Anko, bummzack, Trevor Powell Apr 12 '13 at 13:42

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

    
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 –  Byte56 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. –  Josh Petrie Apr 11 '13 at 0:36
1  
Since it's 2d, try Spriter for modular animation, yet still sprites. –  monkey Apr 11 '13 at 3:50

2 Answers 2

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.

share|improve this answer
    
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. –  Byte56 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? –  Byte56 Apr 10 '13 at 22:49
    
Yes, its forward kinematics BTW. –  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.

share|improve this answer
    
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 4: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

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