Smooth Ragdoll-Based Movement

  • Hey gang, I just started on a new project -- here's the gist of it:

    I'm working towards making a thriller/survival game of sorts. Each playable character will be equipped with a flashlight.

    For my past projects thus far, I've relied on image/sprite-based animations to achieve pretty solid looking gameplay. But, for this new project, I'm looking to make the core movement mechanics more "free." So, rather than making dozens and dozens of animations for each character, I'm trying to improvise with the use of physics.

    Mainly, I wanted to to implement physics so that the player's arm can follow the directional angle of the mouse: so if you raise your mouse, the character's arm will raise, etc.. The purpose being to allow the player the freedom to aim their flashlight wherever they'd like, such as the floor, up at the roof, or directly in front of them; an example of this arm movement would be Mister Bullet (reference: youtube.com/watch -- the character move's his arm to aim wherever you touched the screen). But, I also thought it'd be cool to have ragdoll-based running/walk cycles like in Stick Fight: The Game (reference: youtube.com/watch

    What I've done so far: I exported my test character into individual images (upper arms, upper legs, lower legs, etc..), and through the event sheet, I hinged them to the correlated reference point. It works fine; when I press play, the character falls in ragdoll form, and all the limbs remain attached to the body.

    The issue I'm facing: when I apply movement to the character, specifically the torso asset, the hinged limbs act spastic and start flailing around everywhere. I'm not sure if this is due to a confliction between the movement behavior and the physics behavior? As soon as I release the directional arrow, the limbs return to their position on the body and the involuntary movement usually stops.

    Does anyone have any better ideas to achieve the desired effect(s)? Just so we're clear, the character WILL be moveable via directional arrow, it's not going to be a click&drag ragdoll game like in seemingly all other ragdoll tutorials. If I have to compromise and scrap the Stick Fight: The Game style movements, that's fine. But I don't want to scrap the Mister Bullet style mechanics, as that'll be a core necessity of the game.

  • The physics behaviour is mostly a closed system, so it doesn't play well with other movement behaviours as you've found. Instead you should apply forces to the sprites.

    I'm not totally familiar with how the joints system works in Box2D ( which is what the physics behaviour uses ). You might be able to add rotation limits to the joints so that the character can support themselves, or alternatively when in contact with the ground you could apply a upwards force to the torso that is equal to gravity on the body. Then apply additional left/right forces to the body when keys are pressed to allow movement.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Nepeo ah, that's a good idea! I didn't even think about that! Thanks, I'll give it a go :)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)