• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
Brian Ra

High framerate 2d animations

11 posts in this topic

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). 

0

Share this post


Link to post
Share on other sites

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.

0

Share this post


Link to post
Share on other sites

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.

0

Share this post


Link to post
Share on other sites

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.

 

[url=http://www.mapeditor.org/]Tiled does this.[/url]

1

Share this post


Link to post
Share on other sites

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.

1

Share this post


Link to post
Share on other sites

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.

0

Share this post


Link to post
Share on other sites
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.
0

Share this post


Link to post
Share on other sites

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.

0

Share this post


Link to post
Share on other sites

 

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
0

Share this post


Link to post
Share on other sites

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? 

0

Share this post


Link to post
Share on other sites
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
1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0