keth (@kethdev) header
keth (@kethdev) profile picture

cs student. building tools and games.

Joined January 2021
Photo by keth (@kethdev)Photo by keth (@kethdev)Photo by keth (@kethdev)Photo by keth (@kethdev)Photo by keth (@kethdev)Photo by keth (@kethdev)Photo by keth (@kethdev)Photo by keth (@kethdev)Photo by keth (@kethdev)Photo by keth (@kethdev)
Include

Only show posts containing:

Exclude

Hide posts containing:

Time range
-
Minimum likes
Replying to @north_easy
amazing
2
28
keth retweeted
Same 14 kg ball, same rapier.js world. Left: the joint motors switch off at contact, so it's a plain ragdoll. Right: 12 joint motors keep pulling toward the pose. It staggers and stands back up. Watch 👇 ▸ The problem Ragdolls fall like puppets with cut strings, and keyframed hit reactions ignore what actually hit them. An active ragdoll sits in between: the body is fully simulated, but every joint has a motor that tries to hold a pose. Topic via @kethdev. I built one on rapier.js to see what it takes. ▸ How it works 1. Every limb is a rigid body: 13 bodies, 86.7 kg in total. No animation clip or IK moves them. The physics engine does. 2. Every joint is a revolute ImpulseJoint with a position motor, configureMotorPosition(target, stiffness, damping). With MotorModel.ForceBased, stiffness is torque per radian of error. So the motor is a spring-damper the solver applies inside the joint constraint. 3. Targets are a standing pose with slightly bent knees. Hips, knees and ankles get 1,500 N·m/rad. The spine gets 0.7× that. Arms get 0.04× or less, so they flop. 4. A balance rule runs every step. It measures how far the centre of mass is from the feet, and how fast it's moving. Then it adds that offset to the ankle and hip targets, so the body leans back over its feet. ▸ What I hit Pose tracking alone doesn't balance anything. After a hit, the motors hold the shape and the whole body tips over its heel like a statue. The heel is only 10 cm behind the ankle. The balance rule fixed small hits. In early tests it survived an 8 kg ball and fell at 9 kg. So I added a third piece that many active-ragdoll setups use: a capped upright torque on the pelvis. It's 300 N·m/rad, capped at 112.5 N·m. It isn't a joint muscle. It's a helper force, and the video labels it. With MotorModel.AccelerationBased, the same numbers couldn't hold the body up. ForceBased did. ▸ My build rapier.js 0.19.3 (the newest release at commit 9f638c5), stepped headless at 240 Hz with 8 solver iterations, then played back in three.js. The mannequin, pendulum and balance rule are mine. The ball hits the chest at 5.0 m/s. The active body leans back 27.5° and is upright again 2.8 s after the hit, without moving its feet. The stiffness sweep: at 400 it can't hold the pose and falls. At 10,000 it stays rigid and skids 0.9 m across the floor. ▸ Trade-offs + Hit reactions come from the actual impulse, so no two are alike + One stiffness value trades floppy for stiff - In this rapier.js version, only revolute and prismatic joints have motors in the JS API (ball-joint motors are commented out). So my rig only bends in one plane - It can't take a step, so a hard enough hit still knocks it down - Every value is tuned for one body. Change the masses and you retune ▸ When to use it Melee and physics games where hits should look different every time, and the character has to stay on its feet without an animator authoring each reaction.
2
1
4
430
maybe, i'll look into it.
1
21
Replying to @gwyddling
a bit of both. there's a rig underneath, but both are hollow, with layers on the stone one.
1
1
55
Replying to @CloudXStargazer
we do!
1
83
Replying to @centredsteve
noted, i'll try
2
92
Replying to @softyv3
that's exactly the kind of game i want people to build with jeve
1
2
251
Replying to @LincolnMargison
thanks! saw your ragdoll video a few days ago, really liked it
2
498
Replying to @kdpisda
out of scope for now. jeve is single player first
216
Replying to @playfarecho
the get-up is a mix. it blends animation with physics. but the hits, the falls, the stumbling and the dents are all physics
1
1
290
Replying to @XHandsomeHam
i plan to, it's something i have in mind.
2
201
Replying to @omarselimx
some things are too sacred to hit...
1
2
25
Replying to @omarselimx
at what
1
193
Replying to @Drinkkkyyy
soon!
87
Replying to @browsingcyber
i don't think a shrink would fix that...
1
762
Replying to @LonelyTowel
funny you say that, i was working on a wood one
1
239
Replying to @JUSTTHAT115935
yeah, i'll release something soon.
160
Replying to @7thWonderrrrr
well, now that's terrifying. thanks, i'll make a note of it
1
1
258
Replying to @Spidermanzdev
wherever the hammer lands. every hit is worked out live
1
256