How could I create "flow" to animations?

P

Power_Michael

Guest
How would I apply that "flow" or smoothness that bigger game titles such as GTA 5 and LIMBO have when transitioning through different animation cycles? What I mean is when I begin to start walking in these games...I don't go STRAIGHT from my arms being down at my side (idle sprites) to moving up and down rapidly (walking sprites)...it just isn't natural. What happens in these bigger titles is when you go from arms down at your side and standing still TO moving forward...your arms begin smoothly move into their rhythm rather than an abrupt JERK from being at their side to up and moving. If you still don't get what I am saying, I understand...this is a concept most people probably don't bother to look into...

RECAP: Basically, I'm not sure how to create smooth transitions between the animations of my player...if you look at a game like limbo or GTA 5...when you are staying still...your arms may not be moving, but when you begin to move your arms don't JERK into motion...they smoothly begin to move....Limbo captures this more so in their jumping animation. Would this be an issue of of programming? Having to add a sort of rag doll effect to your limbs to capture this flow? If so how would you do that? If it is an issue of animating (or both animation and programming), please give me some tips and tricks....thank you so much and if you don't understand something too well I will try to elaborate further upon request.
 
L

Lotias

Guest
GTA 5 definitely uses and LIMBO probably uses skeletal animation, where animations are defined by 'bones' moving rather than pixels. The image or 3D model is then distorted or moved based on the movement of the bones or other fixtures. This allows the game to calculate the in-between animations you describe. Short of using that (Spine is the only solution integrated directly into Game Maker: Studio, but there's a converter for the free DragonBones program into the Spine format) you can animate the important transitions yourself if you want to keep that sprite look.
 

Roderick

Member
To do that with sprites, the key would be to use a transitionary sprite and state machine.

Code:
if (state == idle && movement_pressed)
{state = transitioning;
sprite_index = spr_transitioning;}

// Transitioning end animation event
sprite_index = spr_running;
That's super simplified pseudo-code, but it should help get you started.
 

kamiyasi

Member
I recommend Spine if you want to do that kind of animation. I think it's only about $60 and you can do cool things with it like combine different animations, which means you can do things like have an eye blinking animation that runs independently of what the rest of the body is doing.
 
C

CoderJoe

Guest
Yeah you could probably do what Roderick suggested. Gamemaker does not have any kind of animation controller (like Unity's animation blends and that stuff) but you could program one I guess. Look into image_speed, image_index, sprite_index in the gamemaker manual, that might help a bit.
 
Z

zircher

Guest
Search the forum for Dragon Bones if Spine is out of your price range. Some fun stuff going on there as well.
 

obscene

Member
Spine makes it as easy as one line of code. It's worth the money.

I've got a friend working on a program that will probably replace Spine someday though. ;)
 
P

Power_Michael

Guest
GTA 5 definitely uses and LIMBO probably uses skeletal animation, where animations are defined by 'bones' moving rather than pixels. The image or 3D model is then distorted or moved based on the movement of the bones or other fixtures. This allows the game to calculate the in-between animations you describe. Short of using that (Spine is the only solution integrated directly into Game Maker: Studio, but there's a converter for the free DragonBones program into the Spine format) you can animate the important transitions yourself if you want to keep that sprite look.
So let me get this straight, DragonBones....is a free animation program...and is it just as good as spine? Regardless...I can convert projects made in Dragonbones to the spine format which is recognized by gamemaker?
 
P

Power_Michael

Guest
Spine makes it as easy as one line of code. It's worth the money.

I've got a friend working on a program that will probably replace Spine someday though. ;)
Can you tell me more about spine....and how it makes it so much easier? Because as far as I know, in GameMaker I have to do frame by frame animation. I have seen glimpses of programs that you can animate in that use skeletal animation or, BONE MESHING...either way though, both methods still use the same code....right? Help me out ;D.
 
P

Power_Michael

Guest
To do that with sprites, the key would be to use a transitionary sprite and state machine.

Code:
if (state == idle && movement_pressed)
{state = transitioning;
sprite_index = spr_transitioning;}

// Transitioning end animation event
sprite_index = spr_running;
That's super simplified pseudo-code, but it should help get you started.
Yes this is a great start. This is pretty much what I thought I would need, but I was thinking about putting it into the step event of the player....afterall that is where all of my other movement/animation code is....where would you recommend I put the statemachine?
 

Roderick

Member
State machines go in the step event most of the time. You could break them up between a number of different keyboard, mouse, and other types of events, but I'd consider that messy and inefficient.
 

YanBG

Member
Are we talking about 2d or 3d? GTA is 3d so i don't get the comparison with Spine, can you import 3d models from Spine? All i've seen with skeletal animations is 2d sprites that face only one direction. Even for a 2d game if you want 5 directions would Spine work any different than just having the animated sprites?

I use rendered sprites and i started to notice this JERK issue as well. In addition to the slowing with code, you'd need your frames to make seamless transition between the animations. With what pose your walking starts?

With pose 1 the legs would jump too much from the idle but 2 and 4 seem very close to it. For the arms you'd probably need the idle to start and end with position close to the walking one and then the middle of the idle to have them more relaxed or really "idle" :D
 

obscene

Member
Can you tell me more about spine....and how it makes it so much easier? Because as far as I know, in GameMaker I have to do frame by frame animation. I have seen glimpses of programs that you can animate in that use skeletal animation or, BONE MESHING...either way though, both methods still use the same code....right? Help me out ;D.
Spines uses skeleta animations. You set bone positions visusally along a timeline and GM animates it in your game in real time. There are no frames.

Watch their video to see how it works... http://esotericsoftware.com/

Then in GM, you just write code like skeleton_animation_set("Walk") and set the image_speed to speed it up or slow it down just like a normal sprite, however it always looks smooth.

When you want to mix an animation, like from Walk to Run...

skeleton_animation_mix("Walk","Run,".25) (One time in the create event)

And now anytime you switch from walking to running GM will automatically transition the animation across .25 length of it.

Also if you have multiple characters you can reuse the animations and just change out the sprites.
 
P

Power_Michael

Guest
GTA 5 definitely uses and LIMBO probably uses skeletal animation, where animations are defined by 'bones' moving rather than pixels. The image or 3D model is then distorted or moved based on the movement of the bones or other fixtures. This allows the game to calculate the in-between animations you describe. Short of using that (Spine is the only solution integrated directly into Game Maker: Studio, but there's a converter for the free DragonBones program into the Spine format) you can animate the important transitions yourself if you want to keep that sprite look.
Part 2: I did some quick research on the SPINE format, and it shows it as a ".JSON" and Dragonbones can export in that format too. Do you personally know if the Dragonbones JSON format is just as compatible in GameMaker as is Spine's?
 
W

Wraithious

Guest
It really depends on how you create your sprites and add movement, if you have a sprite of a character walking forwards with 3 sub images (arms back, arms down, arms front) and when you press the right arrow key the character speed is set to 5 and the image speed set to 1 you're gonna get a sloppy mess, but if you have 6 or more sub images per direction and slowly and proportionally increase the character speed and image speed it will look nice.
 

Mick

Member
Part 2: I did some quick research on the SPINE format, and it shows it as a ".JSON" and Dragonbones can export in that format too. Do you personally know if the Dragonbones JSON format is just as compatible in GameMaker as is Spine's?
The dragonbones json format is close to the Spine json format, a converter is being worked on:

https://forum.yoyogames.com/index.php?threads/free-skeletal-software.7793/

I think you would still need a spine license if you are to release a game, because gamemaker is using the spine runtime which requires a valid spine license to use if I understand it correctly.
 
Z

zircher

Guest
Interesting, I looked at all the licenses on the launcher and none of them even mentioned Spine or any limitations. It would be nice to get some official clarification on that.
 
P

Power_Michael

Guest
The dragonbones json format is close to the Spine json format, a converter is being worked on:

https://forum.yoyogames.com/index.php?threads/free-skeletal-software.7793/

I think you would still need a spine license if you are to release a game, because gamemaker is using the spine runtime which requires a valid spine license to use if I understand it correctly.
That would be very odd....is there more info on this? Because that sounds VERY odd... *bump* *bump* *bump*
 

Mick

Member
The first time I added a Spine sprite in Gamemaker there was some license text concerning the Spine runtime. I googled around a bit and found this:

http://es.esotericsoftware.com/forum/Runtimes-LICENSING-4984

Nate from Esoteric software says: "If you want to use the Spine Runtimes in your applications, you are granted rights to do so simply by licensing Spine."

This is another thread:

http://esotericsoftware.com/forum/GMSpineAPI-Gamemaker-port-of-Official-C-Runtime-1344

Nate says "Basically if using code from the official runtimes a Spine license is required. This is needed so someone can't build a tool that replaces Spine and benefits from all the Spine runtimes, which were built for and intended to be used with Spine."

Maybe somebody from the YoYo staff can enlighten us on this?
 

Yal

🐧 *penguin noises*
GMC Elder
Or you could consider using my recently finished skeleton animation tool: https://yaru.itch.io/simple-skeletal-animation

It basically only uses built-in maths functions, so it should be fine without a Spine license. It's more limited than Spine, but it's also easier to use as a result (and $58 cheaper :p). I basically made it after finding the whole limited-to-one-proprietary-format deal too limiting, so I hope someone finds it useful~
 
C

Chim

Guest
The first time I added a Spine sprite in Gamemaker there was some license text concerning the Spine runtime. I googled around a bit and found this:

http://es.esotericsoftware.com/forum/Runtimes-LICENSING-4984

Nate from Esoteric software says: "If you want to use the Spine Runtimes in your applications, you are granted rights to do so simply by licensing Spine."

This is another thread:

http://esotericsoftware.com/forum/GMSpineAPI-Gamemaker-port-of-Official-C-Runtime-1344

Nate says "Basically if using code from the official runtimes a Spine license is required. This is needed so someone can't build a tool that replaces Spine and benefits from all the Spine runtimes, which were built for and intended to be used with Spine."

Maybe somebody from the YoYo staff can enlighten us on this?
This is kinda d*ck move, but well i can understand it too, no one want's to work hard and other get the money.
 

Yal

🐧 *penguin noises*
GMC Elder
With what pose your walking starts?
I actually find starting with pose 1 to look the most natural for sprite animation, since it makes the character visibly take steps even if you just tap the button to adjust your position a few pixels. With pixel animations, you need to make them snappy and responsive to compensate for them being naturally more limited.
 
P

Power_Michael

Guest
This is kinda d*ck move, but well i can understand it too, no one want's to work hard and other get the money.
It is understandable that things would be this way, but the thing is it is odd that even though I have the license to Gamemaker Studio, I still don't have full access to all of its features because I have to purchase the license to another program, that is what is odd. Personally, I don't read any terms of use, but unless it says something about needing the spine license to use this feature included in Gamemaker then I don't think that is true. But as WitchMaster has already said, it would be nice if someone from the YOYO staff could enlighten us on this...making another thread about this subject is probably the best way to go.
 
P

Power_Michael

Guest
I actually find starting with pose 1 to look the most natural for sprite animation, since it makes the character visibly take steps even if you just tap the button to adjust your position a few pixels. With pixel animations, you need to make them snappy and responsive to compensate for them being naturally more limited.
Thank you for the insight, personally I suck at pixel art and animations in general. That is...when drawn by hand. I would be better off using skeletal animation and bone meshing.
 
Top