Jump to content
  • Advertisement
Sign in to follow this  
Daikessen

Segmented 2D Sprites

This topic is 3983 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I was wondering if this was the right way to approach implementing this feature: So you have parts of a character sprite: Head, Arms, Weapon, Headgears/Miscellaneous, and the Legs and Torso(which both of these are combined). If you need a good example >> http://www.spriters-resource.com/squenix/finalfantasy/fft/display.php?file=Delita.png At this point, the way I was thinking of having it work is that depending on the direction of the Legs/Torso, the Head, Arms, etc would be put at different offsets on the sprite to make it appear as one whole sprite. then here's the problem for me, is that I'm not sure how to go about the animation process. the semblance of an idea I have is depending on the state that the character is in, the parts change accordingly. I'm not able to visualize this into code easily, though. I'm still getting around normal animation, so would it be better to use a scripting language for this, or just hard code it? I've heard that Pi Story uses FSMs for character animation, I think. anyone have any ideas on this one? Pseudocode would work wonders for me if you could.

Share this post


Link to post
Share on other sites
Advertisement
Basically you'd need to transform each child sprite by it's parents transform. Pretty easy to do if you're using matrices.

For example, say the forearm sprite is the parent to the hand sprite. To get the hand's final drawing position, you multiply it's world matrix (position, rotation, scale if you want) by the equivalent for it's parent. Does that make sense?

If you can wait a couple of months I'll be releasing a library for handling this sorta stuff.

[Edited by - barakus on January 15, 2008 12:30:43 AM]

Share this post


Link to post
Share on other sites
Not yet, though I'll be using it in the game I am making (forum link on my sig). At the moment it's in C# with XNA but I am working on porting it to OpenGL with C++. It comes with an editor to rig the characters.

You might like the look of this editor for the moment though. You'd still have to write your own code to handle the skeletal system though, but have a crack at it, it's much easier than what it seems.

Share this post


Link to post
Share on other sites
It might be easier to just draw the different body parts for each frame of the animation, with some transparent areas around it. It may not be the most resource-friendly solution, but it is sure to work better and easier. Is there any reason you can't (and I shouldn't) implement it this way?

Share this post


Link to post
Share on other sites
Soldat uses a simple 2D skeleton (images of the different bodyparts) with stiff spring joints, which always try to follow a set of predefined points (the animation data).
I do not know, if that is what you are looking for, but at least you can see it in action and then determine your mind :)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!