Scrolling Game Development Kit Forum

SGDK Version 2 => Help, Errors, FAQ => Topic started by: v6v on 2011-11-13, 12:32:29 PM

Title: Bone Animation or Single Sprit Animation
Post by: v6v on 2011-11-13, 12:32:29 PM
Ok, I have an issue here. One of my sprites is a bone animated sprite.
This presently means that it has seperate sprites for each limb. The Sprites move simultaneously.
This is giving me an FPS of around 20, which is bad, seeing as how my game will have up to 4 players, and most enemies will be bone animated.

But however, when I use single sprite animation, the FPS is DRAMATICALLY boosted.  ???

This game has a lot of customization. ;)
However, using bone animation, I don't have to create thousands of sprites and states, and each limb and body part is interchangable, AKA clothes, shoes, gloves, hair, armor, that kind of stuff.
It also allows me to make attacks specific. If the player wears a helmet and gets hit in the head, no damage is taken, but if the player lacks a helmet and wears full armor, any attack to the head does twice damage.

Using single sprite animation, I have to create dozens upon dozens of sprites. This dramatically delays the time and makes it harder to complete the game creation process.
Plus, I can't do any of the functions above.
But the FPS is faster... :(
I'm not sure yet, I might post a video here comparing both animations and showing the FPS associated with both.

Which method for animation should I use for a customization game AKA change Boots, Armor, Helmet

Title: Re: Bone Animation or Single Sprit Animation
Post by: bluemonkmn on 2011-11-13, 06:45:48 PM
I know it's possible to have hundreds of sprites with not too much effect on frame rate, so I suspect that your problem might not be the fact that your sprite is based on bone animation, but some of the code you used to help assemble it.  Can we get a look at the code?
Title: Re: Bone Animation or Single Sprit Animation
Post by: v6v on 2011-11-13, 07:27:47 PM
http://24.30.117.33/Src (http://24.30.117.33/Src)

There's the entire project.  :)

*It probably won't be accessible between 9pm and 4pm on any given day...*

If you have issues getting It Ill try to upload it to a file sharing site... sorry, I'm extremely busy at the moment.
Title: Re: Bone Animation or Single Sprit Animation
Post by: bluemonkmn on 2011-11-14, 05:10:16 AM
9pm comes after 4pm.  Do you mean that it will only be accessible from 4pm until 9 pm, or do you mean it won't be accessible from 9 am until 4 pm?  It's 5 am here and I can't access it.
Title: Re: Bone Animation or Single Sprit Animation
Post by: v6v on 2011-11-14, 04:21:59 PM
No No lol, I meant 9pm at night on a certain night to 4pm the next day ;). I'm going to upload it.... (Here)

http://www.megaupload.com/?d=MJ2UU6P0 (http://www.megaupload.com/?d=MJ2UU6P0)
Title: Re: Bone Animation or Single Sprit Animation
Post by: bluemonkmn on 2011-11-14, 05:20:45 PM
I don't know if this is good news or bad news, but when I run it, I get a solid 60 FPS.  I added 9 more instances of "HeadS" and I still get 60 FPS.  Then I added 20 more, and I *still* got a solid 60 FPS.  Maybe you just need a new computer :).  Although, reviewing your graphic sheets, it might help if you didn't waste so much space.  If your video card doesn't have enough memory to hold all the graphics sheets at once, it might slow things down.  For example, in the "HeadAccessories" sheet, why do you have so many sets of different colored hair when you could just have one that you tint using color modulation on the frameset.  And of course there's all the empty cells too.  When a graphic sheet is used to draw images on the display, I believe it has to load the whole thing (empty space and all) *decompressed* into video memory.  And if it doesn't all fit, I'm not sure what happens, but it might explain slowness on low end computers.
Title: Re: Bone Animation or Single Sprit Animation
Post by: v6v on 2011-11-15, 03:29:27 PM
Makes sense. Thanks. I should just reduce the size of the graphics sheets.

It actually does seem to run faster with more instances for me.. which doesn't make any sense..
But in any case, thanks again. I'll fix the hair to use tints, as I did the skin.  :)