Hello everyone!
In the world of 《Drifting》, most enemies are either human-like or mechanical creatures, which means the enemy either requires a bipedal rig or no rig at all. The idea of an organic tentacle poses an interesting challenge in terms of animating its behavior and simultaneously directing part of its body to a specified location via scripting. In this week's update, I like to share the solution I've made to overcome these challenges and the resulting outcome.
After delving into the problem, I found out the biggest challenge lies in its attack behavior. To perform a successful attack, the head-bone of the tentacle needs to reach to the precise location of where the player's at, which means the attack location and rotation cannot be pre-determined. Using IK to direct head-bone solves the problem, however, that also means all of the spine-bones above the head-bone need to be in the IK chain, this, in turn, renders animating the spine-bones obsolete. Using FABRIK in UE4, there is an alpha pin to tweak the strength of IK, but after some testing, lower alpha value results in (not surprisingly) less accuracy for IK.
Approaching this problem by using IK alone, essentially results in a tradeoff between less IK accuracy or less animated spine-bones, both cases are not a desirable outcome for what I am aiming for.
After some thought experiments, I came up with an idea that may have a chance to get me closer to what I want.
(This setup has the head-bone 100 percent IK-driven and spine-bones 100 percent physics-driven.)
Instead of using animation to drive the spines, I set up all the spine-bones to be physically driven and the head-bone remain 100 percent IK-driven. The idea is to let the IK head motion "direct" the spine-bones via the engine's physic system. After tweaking some parameters the result is quite close to what I envisioned in the first place:
(Notice the slight twist of the spines when tentacle finishes its attack,
these are all physically driven, not animated.)
A disadvantage for this approach is that, since the attack motion happened in an instant, sometimes the physic spines will have a hard time to catch up with head-bone IK, causing the head to thrust inside the spine temporarily. That being said, I am pretty satisfied with the end result and it's fascinating to see physic driven animation could be on par with key-framed animation in today's engine.
Here is a short video demonstrating the combat between the player and the tentacle:
(The tentacle attacks only when the player gets near the ocean surface. It has a very fast attack speed yet a very obvious weak point, overall, it is a minor but annoying enemy in the game.)
And that wraps up this week's update. I hope you enjoy reading my article, feel free to leave a comment or like!
Have a relaxing weekend! ヽ(‘ ∇‘ )ノ
I've seen enough H to know what's going to happen -_-.
Hi peluche-nerv,
I assure you it's nothing like that :P
Thank you for your interest in my article and I wish you a great weekend!
Cool idea, would this work for a whip lightsaber? Also, have a great weekend all.
Hi TwilightBringer,
I've thought of using whip as her main weapon during the prototype phase, however, I lack the animation resource at the time.
It's probably a bit too late to add new weapon right now, however, I'll see what I can do for my next game.
Thank you for your interest >.0
Nice work you got there. The tentacle looks smooth and snappy and ready to grab something.
Hi Felix-Argyle,
Thank you for your good words.
Feel free to press the "Game Watch" checkbox on the top right corner to follow this project if you are interested in the game.
Have a productive day! :)