Sign in to follow this  
mypel16000

Animations

Recommended Posts

mypel16000    14

Hi, I have got to the state where i need to create animations for my game. I know the basic, having a strip of images ang saying draw this one.... after so many frames draw this one..... But this seams like a very time-consuming method. I use C++ and SFML. Surely there must be a way to add animations in a simpler way. I guess there might be some software to create this stripe of images and a library for c++ to read these strips. How do I make good animations. And I mean good as in LIMBO.

Share this post


Link to post
Share on other sites

I know the basic, having a strip of images ang saying draw this one.... after so many frames draw this one.....

Yes.

But this seams like a very time-consuming method.

Time consuming in what way? To create the art, or to write the code?

I use C++ and SFML. Surely there must be a way to add animations in a simpler way.

Do you mean, easier to create?

I guess there might be some software to create this stripe of images and a library for c++ to read these strips.

Depends on your API. SFML doesn't have native support for animations, because it just uses the "draw one frame, draw next frame" method. Which works perfectly fine.

How do I make good animations. And I mean good as in LIMBO.

To make good animations, you just make more frames.
If it's 5 frames per second, it runs clunkily. 10 frames is slightly smoother. 20 frames is better.

To make smoother animations, and to make better art, you need better artists.

Share this post


Link to post
Share on other sites
mypel16000    14

Thanks, good help, but are you saying this method is the only one? I have an artist that works with me, but it takes very long for him to make 20 frames for each animation, seeing as we have many. Is there some piece of software where you can easily create 20 frames from a base image and export it as a strip?

 

I think I'm OK in the programming side, but just a quick doubt. 

I have a player class with many functions, variables..... and one of them is a sprite. I have another class which handles the animation. Basically, it takes a reference to the player object, a file name for the animation and an "interval". What it does, is that it changes the player's sprite to the first frame of the animation's strip. Then it waits for the interval (number of frames) and then adds the width of each frame to a variable so that it changes the player's sprite to the second one. When it's done, it changes the sprite back to it's original image. Is this the correct way of doing it?

Share this post


Link to post
Share on other sites
Liuqahs15    819

Unfortunately, there is no easy solution. Wait until you start using giant sprite sheets with animations all over the damned place. You'll be smashing your head against the desk. As far as I know, there's no simple method for animating 2D better, and getting better animations requires more frames. A lot of people are going to try to act like this isn't a bad thing. I dunno why. That's how people are on this forum, I guess. But yes, it does suck. It's just that for now there aren't too many ways around it.

Share this post


Link to post
Share on other sites

You can use skeletal animation on 2D sprites, but it gives them a very distinctive art style that may not be what your game requires.
Yes, it takes time to make art. It takes time to program too!

Your artist, once he's done making one human, should be able to make variations for different humans faster (but still not 'fast').

You can also use paper-dolling (drawing multiple images to compose the character - hair, armor, pants, shirt, weapon, etc... so characters can then be rapidly 'assembled' from various sub-pieces), or even use a program to generate some pre-paper-dolled characters for you.

Another option is creating 3D models, and texturing them, then pre-rendering them to 2D images - but if your artist doesn't know 3D modelling, that requires even more work.

Share this post


Link to post
Share on other sites
Fs02    477

Surely there must be a way to add animations in a simpler way. I guess there might be some software to create this stripe of images and a library for c++ to read these strips. 

 

For SFML, i think you should use AniSprite Class :)

Share this post


Link to post
Share on other sites
papulko    1418

Another option is creating 3D models, and texturing them, then pre-rendering them to 2D images - but if your artist doesn't know 3D modelling, that requires even more work.

 

This is definately how I would do it, since animating a 3D model requires far less work once the actual model has been made. Besides, a 3D model allows for much more dynamic animations. I believe Limbo has some kind of  ragdoll-like physics engine which makes animations much more dynamic than just using frame based animations. This effect is very visible whenever the character is killed, when his head, arms and legs all individually respond to forces like pressure, gravity etc. 

Share this post


Link to post
Share on other sites
dougbinks    529

Not sure if this is useful, but came across this 2D animation package recently: http://www.synfig.org/cms/

 

It can export to multiple .png files, which you should be able to stitch together into your sprite sheet (google texture atlas tools if you want to find something to do this for you).

Share this post


Link to post
Share on other sites
mypel16000    14

Wow, thanks everyone. This will hopefully help people in need. I was just wondering, because I though you probably would be able to quickly create sprites. I did some extra research and found this:

 

Spriter

 

It is a piece of software to create animations. It is very easy to use and works with key-frames, so hopefully, it will be useful for many. You basically have a timeline in which you can add transformations. For a simple, enlarging animation, you could start with a scale factor of 1 and add a keyframe after a second which had a scale factor of 2. What this will do is gradually increase the size of the sprite until it doubles at the end of the second. It can then be exported with as many frames as you want (you don´t have to do them individually!) Great help, seriously

Share this post


Link to post
Share on other sites
Khatharr    8812

Unfortunately, there is no easy solution. Wait until you start using giant sprite sheets with animations all over the damned place. You'll be smashing your head against the desk. As far as I know, there's no simple method for animating 2D better, and getting better animations requires more frames. A lot of people are going to try to act like this isn't a bad thing. I dunno why. That's how people are on this forum, I guess. But yes, it does suck. It's just that for now there aren't too many ways around it.


Shouganai.

It's not that no one recognizes the problem. It's just that people do what they have to do to solve it. In the end it's either handled or it isn't. There's no benefit from complaining about it even if it sucks.

As for 'giant sprite sheets', good organization, both of the sprites and the frame-finding code, can make that a non-issue. Edited by Khatharr

Share this post


Link to post
Share on other sites

Wow, thanks everyone. This will hopefully help people in need. I was just wondering, because I though you probably would be able to quickly create sprites. I did some extra research and found this:
 
Spriter
 
It is a piece of software to create animations. It is very easy to use and works with key-frames, so hopefully, it will be useful for many. You basically have a timeline in which you can add transformations. For a simple, enlarging animation, you could start with a scale factor of 1 and add a keyframe after a second which had a scale factor of 2. What this will do is gradually increase the size of the sprite until it doubles at the end of the second. It can then be exported with as many frames as you want (you don´t have to do them individually!) Great help, seriously

 
1) You can scale and rotate sprites with almost any art program - you don't need to pay for more software that specializes in that.
2) This creates special files in a special format that you'll have to add programming support for in your game (or use the community-provided plugins available).
3) It's trying to sell itself, so it's optimistic about (and likely over-exaggerates) the benefits it actually provides.
4) This is paper-dolling and skeletal rigging - which is nice (and both were already mentioned), but doesn't solve the primary difficulty of animations.
5) If someone is trying to sell you a piece of software for $25 dollars that makes art so easy that "you don't even need to hire an artist", stop and ask yourself why everyone who runs businesses making games bothers to high artists anyway.
 
The primary difficulty in sprites is drawing the same object from different angles. No software can solve that problem. Observe:
 
Guy wearing hat
 hattedsprite.png
 
Guy no longer wearing hat - the software cannot re-draw the hat at a different angle.
hatlesssprite.png 

 

An artist had already pre-created the human at different angles (the software didn't generate it either, afaik), but the hat, which was drawn during the video, wasn't pre-created, and thus has to be manually re-drawn at each unique camera angle.
 
Software can only rotate 2D images (that are pretend 3D objects) along the z axis, which has never been a problem for artists. It's when trying to rotate the 2D images along the x and y axes that require the 2D image to be redrawn by the artist and cannot be calculated by the computer (unless you 3D model the object, in which case you are rotating a 3D model and not a 2D image).

 

If I draw a basketball, it's a 2D image. If I asked a computer to re-draw it at a new angle, the computer doesn't know if the 2D image is a pretend 3D image, and if it is, whether it's a flat disc, a sphere, or any number of potential possibilities (maybe it's a round pillar that you're looking straight down on). You just can't create a 3D object from a 2D shape, unless you provide (model) the details of the 3D shape.

 
I'm not saying the software is useless (it looks very interesting, and would be useful in a number of situations), just that it probably isn't the silver bullet that you might think it is, and is only beneficial to certain types of games. You mentioned Limbo in terms of quality, if your game is also sidescrolling like Limbo is, then it might be a worth using! But you'll have to decide that for yourself (in conjunction with your artist), understanding the pros and cons, and understanding the programming cost as well, and recognizing that it still won't solve all the art problems.

 

Since there is a free version, try it out and see! Talk with your artist about it, and if it resolves even 20% of your workload, I'd say it's worth it. But it won't lesson it by 20% for every game project, only with certain ones.

Share this post


Link to post
Share on other sites
mypel16000    14

Very good points, Servant Of the Lord. I have been trying it out and it has been useful for many circumstances ( or at least my artist says it has ) so I was just showing others that it is quite good for 2D games which require animations such as skeletal ones ( as you mentioned earlier )

 

And just to make things clear:

 

 

 

2) This creates special files in a special format that you'll have to add programming support for in your game (or use the community-provided plugins available).

 

Actually, it uses these files sort of like a photoshop's PSD, to save the actual, real-time animation and all its different sprites. There is actually an "Export to PNG option"

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