Slow Rush Studios logo,
    depicting an apprehensive-looking snail rushing forward

Slow Rush Studios

◂  Status Update
News index
Fiddling with Fire  ▸

Ragdolls

Contents

Killed enemies now turn into physically-simulated corpses!

Finally a use for all that work to marry two physics engines together - phew.

The Anti-Fun Hitlist

Killing baddies is supposed to be fun, but right now it's not that fun yet.

I made a list of all the reasons why:

You get the idea - it was a long list.

Ragdoll Corpses

One item on the Anti-Fun Hitlist was that dead enemies just disappear - no corpses, no death animation, not even any particle effects.

So, corpses: should dead enemies just flip on their side and that becomes their corpse (like Broforce does)?

Nah, it seems cooler to have dead enemies physically slump down if they get killed (like in Noita):

Sorry, your browser does not support the video codec. Try a different browser! (or someone stuffed up and this video does not exist.)

Implementing Ragdolls

As always, I copied Noita's approach: first, take your regular enemy sprite:

The hound sprite from in-game.
Our starting point: our enemy's sprite image.

Step 2: manually split it into different pieces, one for each "ragdoll bone" (like a limb):

The hound sprite split up into separate bones, one per limb or other moving piece.
The same image, split up into 'bones'.

Step 3: automatically figure out where bones are meant to connect to each other, based on overlapping pixels between bones:

The hound sprite annotated with where joints between bones are.
Here I've manually marked in yellow the joints between bones, but normally this is calculated by the game.

Step 4: when the enemy dies, create those bones as moving bodies, set the colors of each atom to match that of the pixel and connect them up per the joints!

I also made a small refinement to allow some bones to be totally detached, so that the bow and quiver of a goblin archer could fall to the ground separately.

Sorry, your browser does not support the video codec. Try a different browser! (or someone stuffed up and this video does not exist.)

(Sometimes) On Fire

Since I've been using fire to kill the enemies, you may have wondered - shouldn't the enemies' corpses be burning?

The answer is Yes. (That's very astute of you to ask that question.)

But unfortunately, fire doesn't reliably burn moving bodies right now, so even though each moving body is made of burnable wood, your fireball spell will only actually set the corpse alight maybe 20% of the time.

So, fixing fire is a new entry on the Anti-Fun Hitlist!

Playable web build‎

Chuck some ragdolls around here (press G to use the grabbing tool on dead enemies, and - reminder - Tab, Tab to cast a little fireball spell):

Click to focus, then play with keyboard and mouse. No mobile support! Give feedback.

◂  Status Update
News index
Fiddling with Fire  ▸