Revamped animation and a sweeeeet new control scheme

posted in The Inner Circle
Published March 16, 2014
Advertisement
My animation system needed rethinking, as it didn't quite fit the gameplay, plus it was overcomplicated. So I let that stew all week until I had something worth coding in C++ yesterday.

First step was to ask: what controls do I want? A: Simple ones!
Just gamepad Dpad+ABXY or keyboard WASD+arrows. Nothing analog. Aim by moving around, emphasis on timing.

hmmm.... 4 attack buttons, 4 arms and legs.
Not QWOP-style though - running's instinctive! So, A=left jab, B=right cross, Y=kick... or hold the button to grapple... X to pull your opponent toward you. All kinds of *natural* combos emerge. Down-up-B=uppercut. Y-B-X=trip. A+B=head grab, X+Y=knee smash... awww yeah!

With this scheme, animation makes sense. Originally, I had a stack of animation cycles - stand, run, jump, sword swing, sword thrust - which could each control any combination of bones in the skeleton. Now there's ONE looping "base action" cycle (stand, run, fighting stance) for the whole body, and ONE temporary override cycle (punch, kick, etc) for each arm and leg and the head+torso. Temporary overrides correspond directly to the attack buttons... although some attacks control 2 or 3 limbs. For instance, the torso leans forward to give right-hand attacks the same reach as left-hand attacks. Realistic? Hell no - but it *feels* realistic. I take that as a damn good sign I'm on the right track. smile.png

Next: collisions...

In the demo I made for LD26, I did line-intersection tests between all bones of each character. Weapons dealt damage, and *any* collision caused a 50-pixel knockback. You can't walk past each other. It's also too easy to impale yourself on the enemy's sword with them even trying. So... now I'll *only* do collision tests on *attacking* weapons (including hand/elbow and foot/knee)... and I want more body hits, so arms will only protect you if you execute a well-timed block (X+A?)
Then... gore!

I just remembered... in HTML5 Canvas I showed cuts as red dots because I couldn't draw accurate cuts without killing performance. If I just drew a red line across on arm, it'd stick out into the air. Now, with the OpenGL rendering technique I'm using in C++, I've got this lovely stencil buffer to crop it. So that's cool. And if I can be a really productive coder... a powerful slash delivered to a wrist, elbow, neck, etc, will sever said appendage and blood will spurt out of the stump -- in the adult version with the badassery knob cranked up to 11. ph34r.png
Previous Entry C++ porting progress
Next Entry Archery
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement