04 Mar 2015
On the surface Button Up! is a simple casual game, but there's more than meets the eye when it comes to the FTUE (First Time User-Experience).
I've been through several iterations of content, but the one element that felt "just right" is the dynamics of Lord Mountbutton. With a little back and forth with Gavin McPhail (graphics) I rigged him up in a few days.
Here I will describe the basic logic that goes into the Inverse Kinematics with a stretchy twist.
In most Inverse Kinematics tutorials you will read about skeletons and bones etc. terms used to describe components of fixed length. Lord Mountbutton however, has a "telescopic" needle that allows us to extend the range of pointing. This required an extra step in the kinematic logic
The forearm image contains the arm, hand and telescopic needle, "3-slicing" allows the image to stretch along the needle shaft:
Essentially, we need to convert length a into length c and angle B, this can be acheived by solving the triangle. After that, it's a case of restricting the motion of the arm to natural looking angles and deciding which routine to use.
Simple as that!