Sit down

Sitting down in the game cycles: the knees and hips bend, the arms come out for balance and the feet stay exactly where they stood, onto the ground, a chair or a ledge depending on the on setting.

A cartoon person and a dog lowering down onto bent legs, arms held out for balance.

Use it in a cartoonOpen it in the block editorThe pack file (JSON)

What it is for

Sit down is the sit-down of the nine game cycles, the first third of sitting (sit down, sit, stand up): a game plays it the moment a character goes from standing to sitting, on the ground, a chair or a ledge at hip height, chosen by the on setting. The feet never slide while it plays; a sit, unlike a walk, is one of the few cycles that actually travels, since the hips genuinely come down and settle rather than looping in place.

The principle it shows: arcs

The same trick that keeps a walking foot from sliding keeps a sitting one planted too: the body's own position is worked out every frame from the exact angles the hips and knees are bending through, h·leg/2·(2 − cos(hip) − cos(hip−knee)), rather than from a separately drawn path. Because the lowering motion and the body's own travel come from one shared piece of geometry, the whole sit traces a natural arc down onto the seat instead of the hips and the feet drifting out of step with each other.

The program, line by line

settings: h = 540, leg = 0.24, on = 0
when it starts
  show the side view
  at the same time:
    — 1:
      glide hips 8, left leg 16, right leg 16, left shin 40, right shin 40, left foot 16, right foot 16, torso -12, left arm 50, right arm 50, left forearm 10, right forearm 10 over 0.3 s (in)
    — 2:
      set dx 0, dy 0
      for 0.3 s:
        dy follows (h*leg/2*(2 - cos(((0 + 24*pow(min(local/0.3, 1), 2)))*pi/180) - cos((((0 + 24*pow(min(local/0.3, 1), 2))) - ((0 + 40*pow(min(local/0.3, 1), 2))))*pi/180)))
        dx follows (-h*leg/2*(sin(((0 + 24*pow(min(local/0.3, 1), 2)))*pi/180) + sin((((0 + 24*pow(min(local/0.3, 1), 2))) - ((0 + 40*pow(min(local/0.3, 1), 2))))*pi/180)))
  set dx (-h*leg/2*(sin((24)*pi/180) + sin(((24) - (40))*pi/180))), dy (h*leg/2*(2 - cos((24)*pi/180) - cos(((24) - (40))*pi/180)))
  if (on == 0):
    at the same time:
      — 1:
        glide hips 20, left leg 85, right leg 85, left shin 75, right shin 75, left foot -30, right foot -30, torso -14, left arm 34, right arm 34, left forearm 30, right forearm 30 over 0.55 s (smooth)
      — 2:
        set dx 0, dy 0
        for 0.55 s:
          dy follows (h*leg/2*(2 - cos(((24 + 81*smoothstep(min(local/0.55, 1))))*pi/180) - cos((((24 + 81*smoothstep(min(local/0.55, 1)))) - ((40 + 35*smoothstep(min(local/0.55, 1)))))*pi/180)))
          dx follows (-h*leg/2*(sin(((24 + 81*smoothstep(min(local/0.55, 1))))*pi/180) + sin((((24 + 81*smoothstep(min(local/0.55, 1)))) - ((40 + 35*smoothstep(min(local/0.55, 1)))))*pi/180)))
    set dx (-h*leg/2*(sin((105)*pi/180) + sin(((105) - (75))*pi/180))), dy (h*leg/2*(2 - cos((105)*pi/180) - cos(((105) - (75))*pi/180)))
  if (on == 1):
    at the same time:
      — 1:
        glide hips 24, left leg 64, right leg 64, left shin 88, right shin 88, left foot 0, right foot 0, torso -22, left arm 30, right arm 30, left forearm 40, right forearm 40 over 0.55 s (smooth)
      — 2:
        set dx 0, dy 0
        for 0.55 s:
          dy follows (h*leg/2*(2 - cos(((24 + 64*smoothstep(min(local/0.55, 1))))*pi/180) - cos((((24 + 64*smoothstep(min(local/0.55, 1)))) - ((40 + 48*smoothstep(min(local/0.55, 1)))))*pi/180)))
          dx follows (-h*leg/2*(sin(((24 + 64*smoothstep(min(local/0.55, 1))))*pi/180) + sin((((24 + 64*smoothstep(min(local/0.55, 1)))) - ((40 + 48*smoothstep(min(local/0.55, 1)))))*pi/180)))
    set dx (-h*leg/2*(sin((88)*pi/180) + sin(((88) - (88))*pi/180))), dy (h*leg/2*(2 - cos((88)*pi/180) - cos(((88) - (88))*pi/180)))
  if (on == 2):
    at the same time:
      — 1:
        glide hips 24, left leg 64, right leg 64, left shin 88, right shin 88, left foot 0, right foot 0, torso -22, left arm 22, right arm 22, left forearm 30, right forearm 30 over 0.55 s (smooth)
      — 2:
        set dx 0, dy 0
        for 0.55 s:
          dx follows (-h*leg/2*(sin(((24 + 64*smoothstep(min(local/0.55, 1))))*pi/180) + sin((((24 + 64*smoothstep(min(local/0.55, 1)))) - ((40 + 48*smoothstep(min(local/0.55, 1)))))*pi/180)))
    set dx (-h*leg/2*(sin((88)*pi/180) + sin(((88) - (88))*pi/180))), dy 0

Written out in full, exactly as the engine prints them:

h*leg/2*(2 - cos(((0 + 24*pow(min(local/0.3, 1), 2)))*pi/180) - cos((((0 + 24*pow(min(local/0.3, 1), 2))) - ((0 + 40*pow(min(local/0.3, 1), 2))))*pi/180))

-h*leg/2*(sin(((0 + 24*pow(min(local/0.3, 1), 2)))*pi/180) + sin((((0 + 24*pow(min(local/0.3, 1), 2))) - ((0 + 40*pow(min(local/0.3, 1), 2))))*pi/180))

-h*leg/2*(sin((24)*pi/180) + sin(((24) - (40))*pi/180))

h*leg/2*(2 - cos((24)*pi/180) - cos(((24) - (40))*pi/180))

h*leg/2*(2 - cos(((24 + 81*smoothstep(min(local/0.55, 1))))*pi/180) - cos((((24 + 81*smoothstep(min(local/0.55, 1)))) - ((40 + 35*smoothstep(min(local/0.55, 1)))))*pi/180))

-h*leg/2*(sin(((24 + 81*smoothstep(min(local/0.55, 1))))*pi/180) + sin((((24 + 81*smoothstep(min(local/0.55, 1)))) - ((40 + 35*smoothstep(min(local/0.55, 1)))))*pi/180))

-h*leg/2*(sin((105)*pi/180) + sin(((105) - (75))*pi/180))

h*leg/2*(2 - cos((105)*pi/180) - cos(((105) - (75))*pi/180))

h*leg/2*(2 - cos(((24 + 64*smoothstep(min(local/0.55, 1))))*pi/180) - cos((((24 + 64*smoothstep(min(local/0.55, 1)))) - ((40 + 48*smoothstep(min(local/0.55, 1)))))*pi/180))

-h*leg/2*(sin(((24 + 64*smoothstep(min(local/0.55, 1))))*pi/180) + sin((((24 + 64*smoothstep(min(local/0.55, 1)))) - ((40 + 48*smoothstep(min(local/0.55, 1)))))*pi/180))

-h*leg/2*(sin((88)*pi/180) + sin(((88) - (88))*pi/180))

h*leg/2*(2 - cos((88)*pi/180) - cos(((88) - (88))*pi/180))

Try this

  1. Sit onto a chair instead of the ground (on 1 instead of 0). The hips drop onto the chair's own seat height, and the shins bend further, 88 degrees instead of 75, since a chair sits the knees at a sharper angle than the ground does.

    In the program: params.on 0 → 1

  2. Sit onto a ledge instead (on 2 instead of 0). The legs bend the same as the chair does, but the hips stay up at the ledge's own height instead of dropping onto it, exactly as the setting's own description says — the hips stay up over it and the legs hang.

    In the program: params.on 0 → 2

How it differs from Stand up and Sit

Stand up is this move in reverse, the same arcs unwinding back to standing. Sit is the loop this move settles into once it finishes: a long, quiet hold rather than the motion of getting there.

Works on

Worked out by the build: it plays the move in the engine on each body and checks what moves on screen. Nobody types this table.
BodyMoves?What moves
2 legs (a person)yeswhole body, turns, body, head, arms, legs
4 legs (a dog)yeswhole body, body, head, front legs, back legs, tail, ears
no legs (the monster with no legs)yeswhole body, turns, body, arms, tail, ears

c4c:beh:sit_down · version 1.0.0 · c4c-free · by Jabbertoon