Update
Added 2023-01-02 12:38:38 +0000 UTCHi everyone! Hope you all had a good new years.
I finally finished most of the improvements that I wanted to make with respect to NPCs getting up from being ragdolled. There ended up being a lot of things to fix in the base game for this, but I'm pretty happy with the result, especially for humanoids. This had been bugging me forever, so I'm glad to have that done with.
I spent some time during my time off at the end of the year to play around with a few things.
The first was some things related to physical parrying of weapons. I first tested something simple, which was to just give weapons a kind of physical "ghost" that just detected collisions, and then some simple logic of if you touch their weapon within some time before getting hit, you block it, but I wasn't too happy with that. Instead, I'd like to give NPC weapons more of a real physical presence, where they can be influenced and propagate back to the rest of the NPC's ragdoll. I've kind of managed to accomplish this by modifying the hand of the ragdoll to incorporate the weapon's collision shape, as the hand and weapon are kind of tied together (they aren't really, and there's some annoying stuff to deal with to keep the two in sync for this, but that's the idea). Here is a little bit of footage of some early results.
The other thing is a better way to do the more "physics-y" grab that higgs has. It's used when grabbing ragdolls, including live ones, and it really kind of breaks down when grabbing long objects, especially constrained ones like the weapons held by ragdolls, so it kind of needs to be improved if I'm going to be doing the physical weapons thing. The current method works by just directly setting velocities of the object you have grabbed, which doesn't go well when you use a long object and it collides with something in a way that would make it kind of act as a lever. I'm playing around with using physics constraints instead of this, part of which involves more of a point-to-point relationship between the hand and the object rather than driving the entire object as a whole. Here's what the current velocity-based grab looks like when holding a sword, and here's what it looks like with the constraint-based approach instead. It shows where the actual controller is vs. where the hand/weapon ends up, and you can see in the second case the point-to-point relationship makes the behavior better as the object rotates more when colliding with something as opposed to staying straight. Here is another example, where I'm holding a bucket which starts to get weighed down more and more as I add bottles to it, which is kind of neat I think. I spent some time experimenting with different types of constraints and tuning, but I'm not entirely happy with it yet so it still needs some work.
Anyways, these are the next big things I'll try and get done in the relatively near term. Should be fun, I think! Have a great year everyone, and thanks again for all the support.