Posted May 08, 2021 by TwistedTwigleg
Hey everyone! I'm super happy to be able to release both the next version of Twisted IK 2 and the showcase project! This release took quite a bit longer than I initially anticipated, but I hope it will be well worth the wait. Lets dive right into what's changed.
Twisted IK 2 version 2.4.0 has several new features and improvements! The first is a new IK solver in both 2D and 3D called DuoBoneIK. DuoBoneIK is a simpler, easier to compute version of TwoBoneIK. The reason for adding this new solver is that in 3D, TwoBoneIK is not very stable and the code isn't easy to follow, making it hard to debug when issues come up. The new DuoBoneIK solver fixes these issues and gives the exact same results visually. The humanoid on the showcase project (see video below) uses this solver, as well as one of the spiders in the showcase project. 2D also has the new IK solver, though its not as big of a deal because the 2D version of TwoBoneIK is pretty stable and straightforward. The only difference from a use-case perspective between the new DuoBoneIK and TwoBoneIK is that DuoBoneIK requires having a node to use a pole, so the IK solver knows which direction to bend in. Outside of that, the new DuoBoneIK solver is an exact replacement for the existing TwoBoneIK modifier.
One important thing to note: Starting in version 2.5.0 of Twisted IK 2, the TwoBoneIK modifier will be removed from 3D! This is for the reasons listed above and the DuoBoneIK solver replaces it without any loss of functionality. If you are using the TwoBoneIK solver, please switch to using DuoBoneIK.
The new IK solver isn't the only change! Work has been done to improve the Physics_Bone3D node as well! The big improvement is that PhysicsBone3D nodes can now follow ordinary Twisted_Bone3D nodes, which you can set right in the properties of the node. There are a couple ways to do this, following with joints or following without joints. There is few differences between the two modes, which are listed below:
Here's a GIF (kinda poor quality - sorry!) showing the physics bones following a FABIRK solve using Godot Joint nodes:
I'm really happy with how this turned out and I hope it will make it much easier to have physically aware characters, active ragdolls, and open up the door to potentially new game play opportunities. It still needs more work, but I think this release is a good step forward to making it possible to have really easily controllable, flexible, physics skeletons.
Finally, there was some minor bug fixes and changes. One notable minor change is now modifier stacks have a property to enable themselves on _ready, so you can have it run when the scene starts without needing to have the modifier stack run in the Godot editor.
One thing that I have wanted to do ever since releasing Twisted IK 2 is have better examples showing how it may be used in an actual game, or at least something closer than the development project that has been available up to this point. Today, I'm happy to say that its one step closer with the release of the showcase project! This project is planned to take Twisted IK 2 and make mini scenes showing how to use it for a certain use case.
Currently, there is 4 scenes, all showing how to make procedurally animated legs for moving across uneven terrain using IK. These scenes show how to make a Spider (FABRIK, DuoBoneIK), Dino (FABRIK), and Humanoid (DuoBoneIK). All of these examples are intentionally kept simple, so it is missing some things, like only moving the legs when another leg is on the ground (for more natural looking walking). You can see a video of what the project includes below:
I'm super excited to be able to offer this as a resource, and I hope it will help with showing how Twisted IK 2 can be used. As with Twisted IK 2 itself, this project will be extended and expanded over time to include new features, examples, and more.
That is all for this update! As always, please let me know if you have any questions, feedback, bugs, concerns, etc, in the Itch.IO forums below. Thanks for reading and for your support!