Jump to content

  • Log In with Google      Sign In   
  • Create Account

High framerate 2d animations


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
11 replies to this topic

#1 Raña   Members   -  Reputation: 107

Like
0Likes
Like

Posted 05 June 2013 - 07:28 PM

I'm working on a game with one other guy.  I'm the artist and he's the programmer.  I just started animating our 2d characters in after effects for some sick smooth animations.  However, we've been simply using a sprite sheet to read the animations into the program up until this point.  Now that our animations are 30 frames per second, this doesn't seem practical anymore.  What is a conventional method for implementing ultra smooth graphics in a game programmed in something like java or c++? (example: the character animation in castle crashers). 



Sponsor:

#2 Steve_Segreto   Crossbones+   -  Reputation: 1532

Like
0Likes
Like

Posted 05 June 2013 - 10:19 PM

If you describe your characters using shockwave/flash animations they could be described as vector-based shapes with fill colors. Then you don't need to store 30 different positions of the vectors to achieve smooth 30 FPS, you could just use math to lerp between keyframes.



#3 slicer4ever   Crossbones+   -  Reputation: 3894

Like
0Likes
Like

Posted 06 June 2013 - 05:40 AM

on the programming side i'd still use sprite sheets,  but i'd probably use a tool that'll accept a series of images, and generate the sprite sheet for you, as well as a file that gives you tile data in an xml file.  their was a program I used awhile back that did this, but I don't remember it's name off the top of my head, and i'm not on a pc atm.


Check out https://www.facebook.com/LiquidGames for some great games made by me on the Playstation Mobile market.

#4 MarkS   Prime Members   -  Reputation: 882

Like
1Likes
Like

Posted 06 June 2013 - 04:57 PM

Raña, the manor in which you store the sprite frames has no effect on how smooth your animation is. Whether you store the sprite in a sprite sheet, individual frames or some other format, the smoothness of the animation is a function of the skill of the artist and programmer. If your sprites have a thousand frames of animation, it will ,of course, be smoother than the same sprite with a dozen frames. However, if the sprite engine is based on frame rate and not time, even a thousand frames will not look smooth in many circumstances. You mention 30 FPS. On modern hardware, you should be seeing frame rates well above 100 FPS. I just implemented sprite/tile sheets using OpenGL 3.3 and shaders and I am getting nearly 10,000 FPS drawing a single sprite. If the engine is just NOW reaching 30 FPS, something is wrong with the code or you are attempting to use very old hardware.

I have to admit that I find your question very unclear. What is the issue, exactly? There are few reasons for a sprite to have more than a dozen or so frames per unique animation and even that is a high figure. 
 

their was a program I used awhile back that did this, but I don't remember it's name off the top of my head, and i'm not on a pc atm.

 

Tiled does this.



#5 Raña   Members   -  Reputation: 107

Like
1Likes
Like

Posted 07 June 2013 - 03:38 PM

Mark, I think you may be misinterpreting what I'm asking.   First, the framerate I can render my animations at is purely at my will.  I CHOSE 30 fps.  That's not an artifact of my system performance.  And basically, I know it doesn't matter how you store the frames.  I'm basically asking if there's some way using an animation program like After Effects, to not even use the frames individually, but use some sort of pre-animated file.  I'm basically asking how games nowadays do it, because you look at games like castle crashers and everything is so fluid and seemless, that it doesn't quite seem like they're using sprite sheets, but rather dynamically animating moving parts in-game.



#6 Raña   Members   -  Reputation: 107

Like
0Likes
Like

Posted 07 June 2013 - 03:41 PM

If you describe your characters using shockwave/flash animations they could be described as vector-based shapes with fill colors. Then you don't need to store 30 different positions of the vectors to achieve smooth 30 FPS, you could just use math to lerp between keyframes.

Steve, could you elaborate on this?  This looks like it's on the right track to answering my question.  I'm using Adobe After Effects, with imported Adobe Illustrated vector images.



#7 ElfGems   Members   -  Reputation: 256

Like
0Likes
Like

Posted 28 June 2013 - 11:29 PM

Hi, I am not sure but probably my tool (http://elfgems.com/) can help you. It is intended to create sprite sheets from animated 3D models and has a special option for target frame rate.

#8 marcClintDion   Members   -  Reputation: 431

Like
0Likes
Like

Posted 29 June 2013 - 02:47 PM

AH!  I think I know  a code example that will help smooth out your sprite transitions, it's super easy and has been sitting on the nVidia website for about ten years now.  

 

https://developer.nvidia.com/cg-toolkit-download

 

Once you install it you can find it in the following directory:  \Program Files (x86)\NVIDIA Corporation\Cg_3_1\examples\OpenGL\basic\07_two_texture_accesses

 

It blends two textures together as it swaps them, instead of just swapping them.  It uses the key-frame animation formula to do it.  This smooths the animation out very nicely.  It only takes a few lines of shader code to do it, and it will easily port to HLSL or GLSL shader languages.

 

The CG and HLSL shader programs both use: 

lerp(texture1, texture2, blendFactor);

 

GLSL uses: 

mix(texture1, texture2, blendFactor);

 

They are the same thing, just different names.  If you want to do this blending on the CPU instead of the GPU, you could use the following formula:  

 

blendedTexture = textureA * (1.0 - time) + textureB * time;

 

This formula can be used for keyframe animation, blended sprite swapping and even for mixing different lighting equations together.  It's a good one to know.


Consider it pure joy, my brothers and sisters, whenever you face trials of many kinds, because you know that the testing of your faith produces perseverance. Let perseverance finish its work so that you may be mature and complete, not lacking anything.


#9 Steve_Segreto   Crossbones+   -  Reputation: 1532

Like
0Likes
Like

Posted 29 June 2013 - 06:02 PM

 

If you describe your characters using shockwave/flash animations they could be described as vector-based shapes with fill colors. Then you don't need to store 30 different positions of the vectors to achieve smooth 30 FPS, you could just use math to lerp between keyframes.

Steve, could you elaborate on this?  This looks like it's on the right track to answering my question.  I'm using Adobe After Effects, with imported Adobe Illustrated vector images.

 

Basically you need to save your assets in vector format and then your game needs a rendering engine inside it that can load and render vector formats. Google Scaleform, OpenSWF, etc.

 

BTW - Can you elaborate a bit more on your actual problem? Is it simply that your sprite sheets are overwhelmingly large assets to load (and have become even larger now that you use 30 frames/second)?


Edited by Steve_Segreto, 29 June 2013 - 06:05 PM.


#10 marcClintDion   Members   -  Reputation: 431

Like
0Likes
Like

Posted 30 June 2013 - 09:24 AM

Let me see if I am interpreting your issue correctly.  You are using image swapping for your animation and now that your partner the programmer has decided to limit the game to 30 frames per second there is a very noticeable, choppy flicker as the images change from one to the next? 


Consider it pure joy, my brothers and sisters, whenever you face trials of many kinds, because you know that the testing of your faith produces perseverance. Let perseverance finish its work so that you may be mature and complete, not lacking anything.


#11 Xaer0   Members   -  Reputation: 592

Like
1Likes
Like

Posted 30 June 2013 - 02:53 PM

it sounds like you want a 2d bone animation system. in this setup instead of having a sprite sheet that has each frame of animation, you have a texture atlas (or seperate images) that contains different parts of a character your animating, (legs, arms, torso, heads etc) the images are positioned to the bone structure setup for the character, then you animate the transforms of the bones which effect the sprites they're parented to, with the occasional texture swaps for each keyframe, the engine then lerps the transform values from key frame to keystroke while playing an animation

the advantage is you can have lots of animations while only using a handful of sprites unlike spritesheets and u still control the fps you want your playback to be
-Jawshttp://uploading.com/files/eff2c24d/TGEpre.zip/

#12 kalle_h   Members   -  Reputation: 1394

Like
0Likes
Like

Posted 01 July 2013 - 08:50 AM

You could try Spine. It has runtime for most game frameworks. http://esotericsoftware.com/






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS