Legacy GM Very difficult question here about making arms, legs (different objects) with joints

Zuljaras

Member
Hello!

I have found this game on Youtube and I wanted to ask here if this kind of monster (objects) could be doe in GMS:

I have made the video at the exact second where the boss is shown.

I see its movement and I wonder how is it possible to make the legs move the body by not using hspeed or something like that. I mean it moves at exact steps like a puppet.

It might be done with image angles and stuff like that.

I wonder IF anyone here could share their experience with exact this thing? I need some pointers in order to create similar movement and behavior.

EDIT: I am sorry the video does not work at the exact second so the time stamp is: 14:50
 

JackTurbo

Member
Its called skeletal animation, basically its a bunch of separate images and code on how to assemble and move the images. Here's an example of skeletal animation I did in Spriter Pro.
https://twitter.com/JackTurbo/status/825853726241992705

Some examples of skeletal animation software for games are: Spine, Dragon Bones and Spriter Pro.
I know Gamemaker supports the Spine runtimes, not sure about the other packages though.
 

Zuljaras

Member
Hello!

I have found this game on Youtube and I wanted to ask here if this kind of monster (objects) could be doe in GMS:

I have made the video at the exact second where the boss is shown.

I see its movement and I wonder how is it possible to make the legs move the body by not using hspeed or something like that. I mean it moves at exact steps like a puppet.

It might be done with image angles and stuff like that.

I wonder IF anyone here could share their experience with exact this thing? I need some pointers in order to create similar movement and behavior.

EDIT: I am sorry the video does not work at the exact second so the time stamp is: 14:50
Its called skeletal animation, basically its a bunch of separate images and code on how to assemble and move the images. Here's an example of skeletal animation I did in Spriter Pro.
https://twitter.com/JackTurbo/status/825853726241992705

Some examples of skeletal animation software for games are: Spine, Dragon Bones and Spriter Pro.
I know Gamemaker supports the Spine runtimes, not sure about the other packages though.
That is cool but how does that make the movement look like steps. I mean when the one foot touch the floor it does not move until it is time to make the next step AND the body above is moving along with the steps. It is easy to make one giant skeleton just walk and when he walks his hspeed or x is moving. But is the skeleton animation the secret of that specific amazing moving?
 

JackTurbo

Member
I'll be honest, I'm not 100% what you mean.

There is nothing in that boss example that couldn't be done with a typical frame-by-frame technique, it would just likely be more resource intensive due to the large number of sub-images required.

Making a walk cycle look convincing is mostly down to the animation itself, having a sense of weight and motion.

Its also important that the speed the character moves at in game is matched correctly to the animations. If a character moves slower than the animation would suggest you get a strange effect that I can only describe as "running on ice". Where as if a character moves faster than their animation would suggest then you get a weird floaty gliding effect to the run cycle.
 

Zuljaras

Member
I'll be honest, I'm not 100% what you mean.

There is nothing in that boss example that couldn't be done with a typical frame-by-frame technique, it would just likely be more resource intensive due to the large number of sub-images required.

Making a walk cycle look convincing is mostly down to the animation itself, having a sense of weight and motion.

Its also important that the speed the character moves at in game is matched correctly to the animations. If a character moves slower than the animation would suggest you get a strange effect that I can only describe as "running on ice". Where as if a character moves faster than their animation would suggest then you get a weird floaty gliding effect to the run cycle.
Exactly that running on ice effect. But if you make that large object just walk will it have that kind of walk. I mean look at it - one foot steps and stays like that until the other foot makes its step. In the mean time the whole body above the legs is moving accordingly to the steps. And for another example look at the movement of this boss:

The character is able to go between its legs when it is moving in certain way.
 
A

anomalous

Guest
I mean look at it - one foot steps and stays like that until the other foot makes its step
No, he said its most likely frame by frame animation, and I agree. There is no waiting or response, its all someone posing it.

Think of it like stop-motion photography. You pose him, take a snapshot, then pose him again, take a snapshot.
You do that for every step (frame), for every animation. Ray Harryhausen can do it, so can you.

His foot is where they posed it, his body is where they posed it, his back foot is where they posed it. While it's true that many of us could try and not get it to look like that, a skilled animator can.

Maybe you are thinking that it was done with 2d physics or something, where you "move the giant", and his feet move appropriately based on friction, joints, etc. automatically. That's not the case here. Getting that to look good takes a small team probably, including some motion capture, etc.
 

Zuljaras

Member
No, he said its most likely frame by frame animation, and I agree. There is no waiting or response, its all someone posing it.

Think of it like stop-motion photography. You pose him, take a snapshot, then pose him again, take a snapshot.
You do that for every step (frame), for every animation. Ray Harryhausen can do it, so can you.

His foot is where they posed it, his body is where they posed it, his back foot is where they posed it. While it's true that many of us could try and not get it to look like that, a skilled animator can.

Maybe you are thinking that it was done with 2d physics or something, where you "move the giant", and his feet move appropriately based on friction, joints, etc. automatically. That's not the case here. Getting that to look good takes a small team probably, including some motion capture, etc.
This is very interesting. So the animation is made frame by frame but how is the actual movement made like if the boss made 2 steps which lets say is 20 frames what method is used to determine the position? Snapping of coordinates? I doubt that it is variable like speed or spd=5 or somethibg like that.
 

RangerX

Member
That boss in the Castlevania fan game up there is a mix of 2 techniques. Its easy to spot just by looking at it.
There are movements that "frame by frame", simply a huge sprite and there's also some skeletal stuff mixed in (like the arms that rotate/move up)

That huge mob in Order of Ecclesia is ENTIRELY skeletal.
 

Zuljaras

Member
That boss in the Castlevania fan game up there is a mix of 2 techniques. Its easy to spot just by looking at it.
There are movements that "frame by frame", simply a huge sprite and there's also some skeletal stuff mixed in (like the arms that rotate/move up)

That huge mob in Order of Ecclesia is ENTIRELY skeletal.
So you are telling me that Goliath from OoE can be done ,well similar to that boss, with Spine for example?

But the biggest mystery remains ... what method is used for the movement in order to look like it is made from 15 objects and it is not one big sprite with fancy skeletal animations!!!
 
A

anomalous

Guest
This is very interesting. So the animation is made frame by frame but how is the actual movement made like if the boss made 2 steps which lets say is 20 frames what method is used to determine the position? Snapping of coordinates? I doubt that it is variable like speed or spd=5 or somethibg like that.
That's a much more trivial answer. In gms, they use image_speed to determine which sprite index to draw in which game step. It's simply a speed. You personally watch it, if it looks slow, you speed it up, if it looks fast you slow it down, until its just right. Or, you calculate it if its something precise you timed out perfectly to match steps. But either way, this comes from the basics of animation in GMS.

The position is determined for you. Typically you create an object, which has an xy position. You associate a sprite with it, which has an xy origin. The sprite position is then anchored to the object. You can do GMS transformations of a sort using rotate, or do your own using a function and changing the x/y object position. When using skeletal animation, its similar, but they give you skeletal anchor points and in the skeletal editor (whichever you use), you can manipulate the position based on constraints. However even without a skeletal system, a skilled animator could do both a free form animation, or a skeletal-like animation, just using brute force (more common than some think for 2d and older 2d games). One potential advantage to skeletal is that it takes less texture page. You do the animating IN the skeletal animation tool, and the CODE is output. So taking the basic monster parts, all the animation is done via that code. This is not unique though, you can do that in GMS without a skeletal editor too, its just far easier for large animations or complex ones, using a dedicated animation tool.

How much experience with GMS do you have at this point? If the above was the info yo were looking for, I suggest if you have not already done so, its probably best just to do either tutorials or small mini-projects giving you exposure to all the basic systems provided by the GM engine/library. Make a person, make it animated, make it move, make it avoid walls, make a bad guy, make it chase him, etc. Do as much of that as you can, before even considering a tiny game prototype. Games look seductively simple but are often mind boggling in their complexity (by complexity I mean the code is actually simple, there is just a ton of it, and its often all interconnected). That will give you the tools to approach these problems easier.
 

Zuljaras

Member
That's a much more trivial answer. In gms, they use image_speed to determine which sprite index to draw in which game step. It's simply a speed. You personally watch it, if it looks slow, you speed it up, if it looks fast you slow it down, until its just right. Or, you calculate it if its something precise you timed out perfectly to match steps. But either way, this comes from the basics of animation in GMS.

The position is determined for you. Typically you create an object, which has an xy position. You associate a sprite with it, which has an xy origin. The sprite position is then anchored to the object. You can do GMS transformations of a sort using rotate, or do your own using a function and changing the x/y object position. When using skeletal animation, its similar, but they give you skeletal anchor points and in the skeletal editor (whichever you use), you can manipulate the position based on constraints. However even without a skeletal system, a skilled animator could do both a free form animation, or a skeletal-like animation, just using brute force (more common than some think for 2d and older 2d games). One potential advantage to skeletal is that it takes less texture page. You do the animating IN the skeletal animation tool, and the CODE is output. So taking the basic monster parts, all the animation is done via that code. This is not unique though, you can do that in GMS without a skeletal editor too, its just far easier for large animations or complex ones, using a dedicated animation tool.

How much experience with GMS do you have at this point? If the above was the info yo were looking for, I suggest if you have not already done so, its probably best just to do either tutorials or small mini-projects giving you exposure to all the basic systems provided by the GM engine/library. Make a person, make it animated, make it move, make it avoid walls, make a bad guy, make it chase him, etc. Do as much of that as you can, before even considering a tiny game prototype. Games look seductively simple but are often mind boggling in their complexity (by complexity I mean the code is actually simple, there is just a ton of it, and its often all interconnected). That will give you the tools to approach these problems easier.
This is my project in GMS
Just watch it without sound please!
I want to start with basic model not too complex but I wonder how to make the movement feel so real especially the steps!!! Just walking animation of 2 legs and a torso. Just marching left and aright. Nothing more for starters!

PS: Keep in mind that the video is very old and I have fixed many of the things in there!
 

GMWolf

aka fel666
You are asking how to avoid the feet gliding along the floor?
Well, its pretty simple.

When animating, add a constraint for the entire monster to move at a constant speed.
Then animate the legs, body etc over it so it looks like its moving correctly.
Now remove that initial constraint.
In game, simply add that constraint back with hspeed and vspeed.
 

Zuljaras

Member
You are asking how to avoid the feet gliding along the floor?
Well, its pretty simple.

When animating, add a constraint for the entire monster to move at a constant speed.
Then animate the legs, body etc over it so it looks like its moving correctly.
Now remove that initial constraint.
In game, simply add that constraint back with hspeed and vspeed.
Let me see if I understood the information.

Lets say I draw a monster that walks to the left. It has 20 frames. I add hspeed ONLY on certain frames for example when the legs are making the step I add hspeed like:
Code:
if image_index=>5 && image_index<=15 {hspeed=5}
else
{hspeed=0}
This is just a suggestion.

Also one more thing. Do you really think that the boss from Castlevania shown above when walking is just one object?!?!
 
Last edited:

andulvar

Member
Also one more thing. Do you really think that the boss from Castlevania shown above when walking is just one object?!?!
Why wouldn't it be? That's the benefit of skeletal animations. It's just a JSON text file telling the computer where to place sprites. The character object if just a frame for those sprites.
 

Zuljaras

Member
Why wouldn't it be? That's the benefit of skeletal animations. It's just a JSON text file telling the computer where to place sprites. The character object if just a frame for those sprites.
I have just tried this in my object:
Code:
if image_index>=4 && image_index<=9 {hspeed=-0.5}
else
{hspeed=0}
The object is just one leg that is walking alone. The frames from 4 to 9 are when the leg is touching the ground during its animation.
And the effect is very similar!!! The issue will be when I try to add another leg :)

When the leg is on the floor and sliding to the back the object is moving else it is still. Is this all there is to it really?! Everything else is just many sprite images glued together in Spine 2D (for example) in order to make its movement impressive and smooth?
 

andulvar

Member
Basically yes, the external skeletal animation does all of the sprite coordination, you then take it into your game add the movement of the object relative to your game world to add the final touches.
 

Zuljaras

Member
Basically yes, the external skeletal animation does all of the sprite coordination, you then take it into your game add the movement of the object relative to your game world to add the final touches.
ALL this time I thought that those were ALL separate objects joined together with joints, pivot points etc. that were animated separately into one large creature with many joints and difficult mathematical coding (angles and 💩💩💩💩).
 

JackTurbo

Member
ALL this time I thought that those were ALL separate objects joined together with joints, pivot points etc. that were animated separately into one large creature with many joints and difficult mathematical coding (angles and ****).
That is actually exactly how skeletal animation works conceptually speaking, the only difference is that its all dealt with by an external animation application such as Spine.
 

Zuljaras

Member
That is actually exactly how skeletal animation works conceptually speaking, the only difference is that its all dealt with by an external animation application such as Spine.
I made it to work with one leg but it is difficult to make it look and move (most importantly) more realistic with 2 legs. It looks just like any other walking sprite ;(
 

JackTurbo

Member
I honestly dont think your issues are a technical ones.

There is nothing more convincing or better looking about skeletal animation over frame-by-frame animation, if anything its the opposite. Certainly skeletal animation isnt going to be the silver bullet you're hoping it will be.

Take the Banner Saga, that is all frame by frame animation, and that is probably one of the highest fidelity 2D games around.

I think what you would benefit the most from, is learning some animation fundamentals.
http://www.angryanimator.com/word/2010/11/26/tutorial-2-walk-cycle/
https://www.pluralsight.com/blog/tutorials/12-steps-walk-cycle-animation
 

Zuljaras

Member
I honestly dont think your issues are a technical ones.

There is nothing more convincing or better looking about skeletal animation over frame-by-frame animation, if anything its the opposite. Certainly skeletal animation isnt going to be the silver bullet you're hoping it will be.

Take the Banner Saga, that is all frame by frame animation, and that is probably one of the highest fidelity 2D games around.

I think what you would benefit the most from, is learning some animation fundamentals.
http://www.angryanimator.com/word/2010/11/26/tutorial-2-walk-cycle/
https://www.pluralsight.com/blog/tutorials/12-steps-walk-cycle-animation
I have made a little progress. Both legs are one sprite. And I have changed the code to:
Code:
if
(image_index>=0
&& image_index<=3)
or
(image_index>=7
&& image_index<=11)
{hspeed=-0.5}
else
{hspeed=0}
The animation is non stop only the speed is changing.

Just need to work on the animation and I guess I have to buy Spine or try some other program for skeletal animation first and then adjust the hspeed to match the image_speed the best!
 
Last edited:

Zuljaras

Member
I honestly dont think your issues are a technical ones.

There is nothing more convincing or better looking about skeletal animation over frame-by-frame animation, if anything its the opposite. Certainly skeletal animation isnt going to be the silver bullet you're hoping it will be.

Take the Banner Saga, that is all frame by frame animation, and that is probably one of the highest fidelity 2D games around.

I think what you would benefit the most from, is learning some animation fundamentals.
http://www.angryanimator.com/word/2010/11/26/tutorial-2-walk-cycle/
https://www.pluralsight.com/blog/tutorials/12-steps-walk-cycle-animation
One more question. How the walk animation can be reversed in the middle of the animation. I mean the boss is walking and in the middle of the step he freezes and reverses (not playing new animation)
 

Zuljaras

Member
Reanimation this thread again.
I have tried to make this kind of movement like here:
But it is difficult. I am about to buy Spine 2d and try to create something similar but I still can't understand how one big object can move like that.
Its animations are reversed when it is hit couple of times. The issue I am having is to understand how and animation could be made to look like that.

Observe the feet of the boss. When he is struck its animation does not just stop and play its hitback animation. The images of the sprite go back in reverse.
 
Hey

I agree with JackTurbo, it's totally doable in softwares like Spine or Dragonbone and I'd recommend using thoses, it's very useful for that kind of animation.
The only real struggle here is that If you want to achieve something really precise you might have to do a ton of "mid-section" animations, such as "hitback after sprint" "hitback after walk" "hitback after attack" etc so it's not so sudden.
Once your character is properly rigged you can do any of thoses things you're describing easily.

Here's my first test with dragonbone and that was a long time ago:

How the walk animation can be reversed in the middle of the animation
There's a free GMS extension to create animation with different delay on each frame if you'd like, it's very easy to use.
With that, you can measure which frame the object is at when it gets hit and reverse the animation and/or start another one.
Something like "if the enemy is hit, change the animation to the same one but reversed (or just reverse it), and when it's over switch to another animation"

TLDR: Spine/Dragonbone + Animation Sequence
 
R

robproctor83

Guest
Yes, you just need to get your hands on Spine and read through the documentation, it will make more sense once you understand how it works, but to figure that out you need to dive in.

And, just my two cents: I generally prefer frame animation as skeletal tend to look too monotonous, but there are some animators out there that can really do amazing things with skeletal, like make 2d sprites animation look 3d, so it really boils down to the animator. You can also do dynamic animations a lot easier with skeletal, doing things like combing an attack animation and walk animation for moving attacks, but at the same time you can also do that with frame, but it may be more tedious depending on what your doing exactly.
 
Last edited by a moderator:
Top