Wednesday 6 August 2008

Walk and Chew Gum Conundrun

Actually that should be run an aim-down-sight animation so that when the player looks up and down it aligns correctly with the eye node. It ain't as straight forward as it sounds...

This counts as multi-tasking, as does walking and chewing gum. Multi-tasking seems a big thing in the games development industry - which kinda makes you wonder why there aren't more women working in it.....

As a one-man dev machine, multi-tasking is rather essential, regardless of the average male's inability to perform it. The average male in this case is my player/ai model.


I mean how hard can it be? and ignore the terrible hands model

So what I needed was an aim anim - easy enough, boot-up Blender, align eye, mount0 and where the weapon sight would be. Then it's a simple case (it wasn't) of having my aim anim play over the blended look animation. And this is where it all went wrong.

My aim aligns fine in the root along the horizontal, and it aligns fine at the extremities of the look anim (that's up and down for real people), it's just the bits in between where the aim wandered out of alignment. Unfortunately that makes up 160 degrees of 180. Ah....

There appeared to be a disparency between the angle of looking and the speed at which the animation plays, it's just not a constant speed as the mouse moves. It's quicker at the 45 degree angles than the 90s where it slows down. Time consuming trial-and-error tweaking of my look animation was called for, but it soon became apparent that wasn't going to work - or if it was, it wasn't going to work this decade.....

So locking the view at every 45 degree angle and then tweaking the animation until it lined up at each interval proved to be the way forward.

I did cause myself a few extra problems. Having a single bone to the spine just wasn't going to cut it and I reckon at least 2 are a must. The real human spine isn't a flat board and is rather flexible - it's just that mine keeps trapping nerves and jamming (and I'm not talking about my model here). And of course I wanted a fairly nice third person aim too for my patented ;P Gears of Yorkshire vibe.


Aim goes down - aim goes up - aim keeps pointing at centre of screen

The crosshair only shows up when the player aims and is in Third Person view. In both First and Third person the HUD (in my case currently just the health bar) disappears to give a clearer and less distracting view and the camera zooms in dependant on what weapon is being used.


Obligatory poor quality YouTube vid of it all in action

It all took a bit longer than planned --- though considering everything takes longer than planned it probably took just the right amount of time. There are many techniques available to make life easier in developing (with the TGEA 1.7.1 engine in my case) - it's just a question of finding them.

Now, back to environment content creation like I was supposed to be doing before I got distracted by animation tweaks and gameplay elements.

No comments: