Wednesday, 27 February 2013

27/02/13 - Modelling and Rigging for Third Character - Large

Despite assuming the majority of my work had been completed for this module, the fact that Tim and i had accounted for three different body types in the game had been looming over us both, so given that we had both finished the animations for our characters, we decided to split the workload and get all three characters done. I would be creating the model and rig for the large character, as well as two of his animations; idle and running. Tim would be creating the rest. I went into this one feeling a lot more confident that I could do a really good job of it, i also hoped it would be easier to do as i had effectively done it before. I was also hoping that i may be able to avoid some of the IK issues i had such as twisting along unwanted axis when keyframed if i made and rigged the model correctly. But enough about what i was hoping to achieve, here's how i went about it.

When creating the model i used exactly the same process as i used for the model for my small character, though of course the whole process was sped up by avoiding the mistakes i made first time around, this is also why i have summarised what i did into bullet points.

- Obtained assets from Lewis
     o Addition of liquid effect to model for drinking animation
- Used PSD to create square, flipped images of each body part
     o Made sure to name all images that would have sequences appropriately
- Started Maya
- Created Materials for all body parts
     o Named all materials appropriately
     o Created two hand materials to allow for food and drink animations
- Used same technique as small character to create planes for each body part
     o Used image size to create Maya planes that would be the correct size for body parts
- Arranged body parts onto a background picture of the asset sheet that was given to me by Lewis
- Rearranged planes along the depth axis so that body parts wont intersect and the model looks exactly as it does in the imag


Above you will see the final model, created with no problems whatsoever, and with all images and planes scaled appropriately to allow for various extra sequence images. Going well so far!

Next thing was to create the initial rig, which you can see below.:


I decided to be more thorough with my rigging (and modelling) this time around, making sure to name all the bones and planes appropriately. I even added 'Left' and 'Right' labels to the bones though these can only really be seen in wireframe mode. This was part of the increased discipline i wanted to exert when creating this rig, partly for professionalism, but mostly because the rig would be being shared with another person and would hence need to be as clear and easy to use as possible.


The next thing i did after finishing the above rig, was to test out the creation of the IK's for the arms and legs, unfortunately i managed to run into my first problem: The IK's were rigid and had no flexibility just as had been a problem with my test rig, and that time i'd ended up having to redo them. I tried binding the bones to the model before attempting to create the IK's again with exactly the same outcome. Then the license server connection was lost and given i could only work from my college at the time, i may have had a moment of slight raginess. Especially as the server didn't come back up for several hours afterwards...

But anyway, when i finally managed to get back on i tried out a solution i had been reading about in the meantime: right clicking a bone in Maya brings up a menu system of contextual options, one of these is to 'Set preferred angle'. Meaning the angle from which the IK's should be being solved.

Again this proved unsuccessful.

Again i got rather... frustrated. This is most likely due to the fact i had hoped that i wouldn't have any major setbacks during the creation of this model. I believe this was a useful lesson to learn for the future!

So, after this i decided to start over, just as i did with my test rig, this time however i wanted to pay very close attention to the bones i was placing as i noticed that they did not always use the same axis for rotation for some bizarre reason. So i went about recreating the skeleton, paying close attention to the angles of the bones i was placing, finding that alot of the time the bones would be offset by 90 degrees in unnecessary angles. Paying attention to this, and although it took far longer than it normally would to create the rig, i managed to make sure all bones used the same axis for rotation, and also that they all had positive rotation values as i believe this was the culprit for some of the unnexessary twisting between keyframes in my previous rigs.

I tried locking the y and z rotation values at 0 for the joints in another attempt to clamp down on any undesired rotation by right clicking their respective 'Joint Orientation' value boxes and clicking 'Lock Attribute'.

An ominous crash from Maya followed shortly after... would it be better for me to create the bones then manoeuvre them using the transform tool rather than rotating them?

Before i had a chance to test this idea i made a discovery that blew everything i had just tried into irrelevancy, and it was so simple!

Upon looking at the joint tools options window (by pressing the little square next to the option in the drop-down menu) i discovered that you could have all the joints you create be orientated to the World axis automatically!! Not only this but you could limit the degrees of freedom each bone had before you'd even created them!!!!

A breakthrough, just what i needed.

Once again, i scrapped my rig and started over, but using the joint tool this way solved the axial inconsistencies and the bizarre rotation problems i'd been having COMPLETELY. Leaving me with a consistent, clean rig to use with the model.

Sadly even with my incredible mastery of the joint tool, it wasn't enough to stop the problems i was having with the IK's... rigid as ever.

So given i still hadn't found a solution i decided it was time to actually post my problem online, and after waiting a couple of hours i was provided with what would lead to my solution:

It seemed that all the effort i was making to lock down the rotation to the x axis only was causing problems for the IK solver, and all it took to change this was to unrestrict the limits on the degrees of freedom from the bones that were at the top of my IK chains (Upper Arms, Upper Legs)

So from here i went on to test this solution with all my other IK's and did so successfully! After this i went on to bind the bones to the model with the IK's still there (I believed this may have cause some problems but was proven wrong.) Next i created the point constraints just as i had done for my test model and the small character to stop the feet from going through the floor, I also made sure i named all the IK's and Constraints appropriately using the Outliner window.


And finally, i put the character into a nice silly pose for some screenshots/rendering and that was the large character rig finished!



Despite a major setback during the creation of the IK handles and despite looking no different to it (at least on the surface), i believe that this model is of a far higher quality than the model i created for the small character. It shows better discipline through the clear naming of all assets within the model and rig, and the rig itself shows a much better understanding of the process required to create a 2D animation skeleton. Overall it shows how my skills have improved in such a short space of time and serves as a fitting testament to the standard of work i have submitted for this module. I was very pleased with how it turned out and was confident that the issues i had had with my smaller rig would not be a problem when creating animations with this one.

Monday, 18 February 2013

06/02/13 - Creating Animations for the Small Character

In this post i will be documenting my progress on the creation of the animations i need to create using the small character rig. Below is a quick list of those animations, read on to see how i got on!
Idle + Variations
Idle-to-Running
Running
Jump
Duck
Jump Fail
Duck Fail
Eat Item
Drink Item

Idle + Variations

Starting nice and easy, i created the idle animations. The small character is known to be slightly mad so i wanted him to appear twitchy and excitable. So for all the idle animations he bounces up and down on his feet abnormally quickly and in the variations his foot twitches or his head jerks down to his shoulder spontaneously.

As i said these were the easiest animations to create so i didn't have any problems making them, especially as they involve no significant movement of the limbs.





Running

For the running animation i originally wanted the characters sleeves to be flailing behind him but after finding out there would be a 'speed-boost drink' in the final game i decided he needed a standard running animation and that i would create my original idea if it was necessary.

The first problem i ran into here was fitting the animation into the 60 frames (2 seconds) we had allotted to each animation, it took a little time and some experimentation to create a run animation that fit the two second slot as well as the character i was trying to portray, that of a zippy madman in an unbound straitjacket.

I also ran into more IK problems during the creation of this animation, i found that although the joints wouldn't warp or rotate in undesired directions when i was moving it about manually, the joints tended to do just that when moving between keyframed positions. I found no obvious solution to this so i ended up having to add extra keyframes to stop the joints misbehaving in this manner.


At this point i assumed the animation was finished, but while acting out a jump as a reference for my jump animation i realised that i had my characters body lowering and rising at the wrong times. Moving the key frames forward solved the issue and gave a profound improvement to the final result.


Before:



After:


Idle to Running

This animation is simply (and obviously) the transition from the idle state to running, in my case with a 'warm-up' animation prior to assuming the running pose at the end. It is intended to be played right at the start of a race.

Given that i wanted to show the character raising his arms and shouting some unintelligible war cry before moving off, this was the first animation i created that made use of the extra faces that Lewis made. Thankfully i was saved the time spent searching for a method to achieve this as my fellow animator had already encountered and overcome this problem, and all it involved was changing the file names for each of the Head images. Adding .00x to each of them (with x being the image number) whilst making sure the main image name is the same (so Head.001.png, Head.002.png, etc.) helps the image sequence option detect the different states for the image. Through right clicking the box into which you set the image number, you can set a key and from this to create animation sequences that play along with the rest of the animation. This was everything i needed to gain the animated screaming face that i desired for this animation.

After creating this initial part of the animation i ran into the difficult situation of transferring the starting pose of my running animation into the idle-to-running animation which had been created from one of the idle animations, i needed this so the animation would transfer smoothly into the running animation. This was the part i was dreading the most and the very long time that i spent searching for a solution without success seemed to confirm my suspicions. In the end i simply tried my own idea of opening the two files in two separate instances of Maya and copying the coordinates for each separate limb that was affected by the pose, the results were such that i had transferred the pose exactly into my idle-to-running, though i had to do everything more than once as i forgot to keyframe all the joints when moving between frames!


And here you can see the final result:


Jump

A jump animation is required, as well as a duck animation, as there will be obstacles that require player input to leap over or duck under during the race. Below you can see the jump animation i created, i feel it may be a tiny bit floaty but this game is a bit of a zany cartoony affair so it fits with the style. I believe this was one of the most straight-forward aniamtions i created, that's not to say it didnt take plenty of time and a lot of tweaking to get it to a satisfying standard, i just encountered no significant problems. The jump animation takes place across a 30 fram segment i 'cut' out of the running animation.


Jump Fail

As well as having animations for jumping and ducking animations we also needed to have animations for when the player fails to provide the input needed to successfully traverse the obstacles. Hence the creation of 'Fail' animations.

I decided that given these animations are failures they would need to incur a penalty, i took this penalty idea and used it as an excuse to make the fail animations twice as long as all the other animations. So 4 seconds each. Even so, i stuck to the '2 second rule' and split the fail animations in two, this meant i would have another chance to employ the copied coordinates technique i used for the idle-to-running animation.

Creating the first part of the animation was another straightforward affair, i simply manipulated the finished jump animation so that he didnt make it. With tweaks and quality checks on my part before continuing. Simple!

My original plan for the second animation, given that it starts with the running pose and ends with the character floored, was to swap these poses over. This didn't go to plan due to an error on my part which meant i lost the 'floored' pose (I basically managed to overwrite the keyframes for it by accident), so i ended up using the copied co-ordinates technique.

Thankfully the rest of the animations creation went smoothly, giving the result you see here.



Duck

To create the ducking animation i used the same method i used for the creation of the Jump animation. There were no issues with this one, though i found that to fit my planned animation in i had to allow a devote a larger segment of the run animation to it. I was happy with how it turned out:


Duck Fail


Again no issues creating this animation which, like the jump fail, was split into two parts. I was however, very happy with the results. This is certainly my favourite animation.




Eating/Drinking

These are the animations i made for the eating and drinking actions made by the characters when using different items during a race. Similar to the jump and duck animations, and given that using items only takes place during the race, i created these animations by manipulating the running animation.

After altering the hand images so that i could switch between the regular hand and the food or drink hands (to do this i had to create a duplicate hand image and material in maya for the Left and Right hands), i encountered a problem. Simply put i hadn't factored the food/drink hands in while i was creating the square images for Maya so the planes I modelled for the hands weren't big enough. As such when i switched to the image they appeared slightly squashed on the model.

Thankfully the solution, though slightly inelegant, meant that i didn't have to de-skin and remodel the hands. All i had to do was create a scale keyframe before the switch to the item-in-hand image that would stretch the plane in such a way that it became indistinguishable in size from the reggular hand, then rescale it once the character had eaten/drank the item. By doing this in the space of one keyframe the change in scale is instantaneous and completely unnoticeable.

As a final note i will add that i think particle effect such as crumbs for the eating animation would greatly improve the overall look of these animations. Though such a thing is currently beyond my ability.



And with that one done, my animations for our small character are DONE! All i have to do now is hand them over to Dean Stone our Coder who will put them into the prototype. The next step is to see what else i can add to the game to help finish it off, but in the mean time i have found something that despite being incredibly frustrating at times, was very enjoyable to do. This is a very big step for me as it has given me an area of game development i can truly say i enjoy working in, and a potential focus for the future.

I decided as a final addition i would do a very brief write-up of the technique i emplyed when creating the majority of my animations (aka once i had gotten the hang of it):

  1. To start with i would take the main 'back/spine' bone that acts as the central point of the rig and moves all the bones therein, and keyframe some basic rotations and transformations to get the basic movement down.
  2. I would then move on to keyframing in the movement of the limbs, often starting with the legs first and, once happy with them, moving on to the keyframes for the arms.
  3. Next i would adjust the heads position and rotation as its movement is in direct correlation with the spine's, this would involve keeping the character looking ahead or bending in to emphasise the anticipation for the jump, etc. After this i went through a similar routine with the feet as having the IKs for the legs based at the ankle joints meant that the feet would bend in undesired ways at times.
  4. Finally i would create the facial animation keyframes (if they were required of course) before going back and making any more tweaks or adjustments i felt were necessary.
  5. At this point i would simply sit back and let the finished animation play over and over whilst feeling very proud of myself.