Fake Springs and Fixed-Time Sproing-oing-oings
Added 2017-07-27 23:39:11 +0000 UTCFirst, read the $1+ tier post on damping, since this feeds off that. Good? Good! Ok, so - like I said, I made something cooler.
Namely, this! Behold the FakeSpring.
What this does is produces very spring-like behavior, but in a very controllable way. You specify precisely what the attack-rate is for the springing back, you control how many bounces it takes, and how much velocity it loses with each bounce. Want a loose spring that lazily bounces 3 times like an ancient spring door (but then comes to rest instantly instead of cycling forever)? You can do that. Want a door-stop sproing-oing-oing that comes to rest in a specific, easily artist-tweakable way? Also doable!
Want some example values?

Horiz Wave are the settings I use for when my fists tilt in the direction you're moving/turning. It gives a nice, assertive snap-to without being too fast, and then they come to rest nicely. Note that the Horiz Wave Bounce Damp does nothing here, because since Damp is at 0, <shrug>.
Vert Wave relates to camera shake on being hit in the face. That's your head snapping back (rotation along X axis), then returning to stable. There, you'll note I allow a small amount of springs. INCREASE THE SPRINGS OR REDUCE THE DAMPING ON CAMERA SHAKE AT YOUR OWN PERIL. I can not stress how unpleasant camera-induced motion sickness is, and it can make you feel ill for hours after even a few minutes playing with bad values. So mind your stomach.
Now, for bonus code-tier info, behold: Fixed Time Sproing-oing-oing
What I'm doing here is taking an actual spring equation, but poking in basically fake values. Here's the ones that drive my enemies going sproing-oing-oing when you hit them. There are physical equations you can use to derive what the spring equation needs, I just don't care - treat them as artist tweak values.

Now, the secret sauce is that taper factor. Let's look closely at it:

That says no matter how crazily the spring oscillates, or doesn't, it ALWAYS reaches stable state by precisely the time you set. This makes it ideal for springs that must spring, but be done springing precisely when the associated animation ends. Like, for instance, springing-on-pain-face.
Why do I need to do this? Well remember when I said "treat the spring constants as tweak factors"? By doing that, I'm creating springs that by definition don't work. They either only reach rest state on a geological timeframe, or possibly just explode if you let them go too long. The thing is, though, that broken springs look pretty cool... if you can wrangle them. So, just stuff the damn thing into the box and jump on it until it fits. That's what the lerp is doing. Works great. DON'T TELL THE MATH POLICE OK.
That wraps this month's post up. Go forth, and make things jiggle!
(no, not THOSE - you are not allowed to use this on those)