Wednesday, 30 January 2013

30/01/13 - Character Rig Creation, Rigging

This week, as i mentioned in the presentation i gave last week, i felt confident enough to move onto creating the model and rig for the Small, Speedy, Straitjacketed game character.

Concept art created by our Artist Lewis Coleman

I was given the Photoshop document you see below, it contains an arrangement of all the body parts in separate layers as well as different facial expressions and alternate hands holding either food or drink items.



I took each of these layers and saved them as separate images, then booted up Maya. I set about creating the planes that i would be using for each of the body parts first, but before doing anything else i created one plane and imported its texture as this was something i hadn't practiced, though it was something we had done in our first year Maya sessions. Whilst my technique was fine, i immediately i ran into a problem: Image stretching.

My hope was that the images would simply appear on the plane scaled normally but cropped by the edges if the plane wasnt big enough to fit it, and that it would simply be a case of making each plane fit the image it was displaying. Sadly i instead found that Maya would stretch or squash the image to fit in the plane on to which it was being applied, and there was no way (as far as i found) to change this. Luckily it didn't take me long to invent a solution to this problem.

This solution was to take each of the body-part images and save them in a square resolution so that i could then create a plane that had a matching size (e.g. image with 450x450 pixel resolution would be applied to a 4.5x4.5 default Maya unit plane) allowing for a consistent scale to the model, hopefully giving a result that looked imperceptible from the Photoshop image i had been given. The results were exactly that, i used a template image to make sure the scale was correct and to match the pose, giving the result shown below.


The template image (left) looks a little strange and that's because i had to go back to the Photoshop document and make the hidden body parts visible so i could pose them properly.


Skinning the model was a simple enough process, i used the same technique as i used with my Test Rig, though i had to use the Outliner to make some selections as the overlapping planes made it difficult or impossible to select the body parts i was trying to bind the model to.

When creating the IK handles for the rig i encountered a problem i hadn't faced with my test rig. I found that both of the arms on my model would only bend in the wrong direction. To solve this i basically had to unbind the bones from the rig entirely, after which i arranged the arm parts in a concave shape before binding them to the bones again. Due to the way IK handles are created, they must have some indication of the direction in which they are supposed to bend before being created, hence bending the limbs slightly before creating them.

After this my rig was finished and ready to be animated!

So in celebration i whipped something up to test it out (apologies for the horrific video quality but you get the idea):



Wednesday, 23 January 2013

23/01/13 - Progress Presentations

At the end of the last session our lecturer informed us that we would each be presenting our progress in the form of a powerpoint presentation, and that it must consist of what we had done so far, what we were currently doing, and what we would be doing next. Below you can see a summary of what i presented to the class.

What have i done?:

- Pre - production:
Reference Vids

Selection of animation software
- Took a very long time
- Program we eventually chose was practically staring us in the face the whole time
- Decision based on video ofa 2D animation rig created using Maya

What am i doing?:

- Creating a test model and animation rig as a proof of concept

What i will be doing?:

- Creating rigs for the characters in the playable version of our game
- Creating animations for said rig
- Animate various other assets for the game if needed

Wednesday, 16 January 2013

16/01/13 - Rigging: Test

Rigging, in animation, is the process of taking a 3D model and creating a 'skeleton' of 'bones' that allow for the manipulation of designated parts of its geometry, allowing for the creation of animations for said model.

Myself and Tim, having decided how we would create animations for our game, immediately jumped into Autodesk's Maya to see what we could create. Having previously dabbled in 3D Modelling and Animation in Blender a few years ago, as well as using Maya in the first year of this course, i felt fairly confident that i could create something without using the internet to find out what i needed. I managed to create a test model, which consisted of a series of re-sized and carefully arranged planes, for a human character. I also found out how to create the bones for this test model; either by having 'Animation' selected in the drop down box at the top-left of the UI (Animation Mode), then finding the 'Skeleton' list at the top of the screen and selecting 'Joint Tool', or by selecting the 'Animation' tab from above the 3D workspace then clicking the 'Joint Tool' button, which looks like this:


Once i had the bones in place i realised i didn't actually know how to make the bones interact with the model, luckily Tim had encountered this same problem and already found a solution so he showed me how; to attach a bone to geometry you must have the bone and the part of the model you wish to assign to it selected. Then, in Animation Mode, you must select 'Skin', followed by 'Bind Skin', then selecting one of the options from the list. What i found was that using 'Smooth Bind' as Tim suggested, caused the bones to interact with more than the desired geometry, as well as warping it, which is not what we wanted to do.


Through some experimentation I discovered that selecting 'Rigid Bind' and in its 'settings' window changing the 'Bind to:' drop-down to 'Selected Joints' gave the desired result, which was to have each individual plane attached to a specific bone in the rig.

Next came the task of making the rig easier to animate. It would be perfectly reasonable to create the animations by moving each of the bones individually, but the time this would take is enormous when compared with the time saved by using IK solvers.

IK Solvers or Inverse Kinematic Solvers as i understand them, allow you to manipulate a chain of bones through a single IK handle that is placed at the end of the chain. Moving this handle causes the bones in the chain to bend and rotate so that they are still linked but not overlapping, and that the end bone is still in contact with the handle. It is commonly used to allow for easier and more convincing animation of limbs in human character models.



When setting these up for my test model, which consists simply of selecting the 'IK Handle' tool from the 'Skeleton' list and clicking the top and bottom joints of the chain you wish to create a handle for, i ran into a problem.

Simply put instead of being all bendy and flexible my joints were becoming completely rigid when i set up my IKs, the chain was achored at the shoulder or hip as it should have been, but would stay completely rigid when i moved the handle around and did not flex at all. I was utterly stumped as Tim had managed to create a test rig himself with joints that flexed just as they should have done. In the end i resorted to recreating the rig and found that if i set up the limbs separately before linking them all together i achieved the flexible bendy IK's that i desired, though it was not an ideal solution.


The final part of the creation of our test rigs was to create constraints that would anchor the feet to the floor, as we saw had been done for the rig in the video that led us to use Maya. Having this constraint would mean that the legs of our character would not be able to go past a certain point on a desired axis, for us this was the vertical axis as we wanted define a 'floor' point that would cause the feet to stop and the legs to bend if the rest of the model was moved below it. Such a thing proved very hard to do, or at least to find out how to do...

Initially we just tried out the different options from the 'Constraints' menu in the hope that one would give us the results we wanted. I spent a very long time searching the internet for a solution without success,while Tim continued experimenting with the different options, and while he did manage to achieve what we were trying to do he did it by accident and couldn't see how he had managed it. So we continued looking and eventually found the solution was to use the 'Point' constraint but to make sure the vertical axis was the only thing being constrained.

Words cannot express the relief that was felt after finally solving this problem, but we at least felt that we had reached a point where we could comfortably start on our actual work for the game, the modelling and rigging of the 3 in game characters, Large medium and small. I chose to create the small rig.

Wednesday, 9 January 2013

09/01/13 - Eureka Moment

Today Tim and I continued our struggle to find a suitable program to use to animate our game characters. After trying so long to find a 2D animation program that would allow for easy implementation with Unity, unsuccessfully, we decided to go back to one of our original ideas which was to use Maya, and create our 2D animations using a 3D workspace. Realising this method may have slight disadvantages such as a slightly unrefined look due to separated limbs, we went in search for examples and stumbled across THIS VIDEO. After watching this glorious video that depicted exactly what we wanted to do to create our animations we decided that Maya would be perfect.
Having finally found a suitable program to create our animations with, and given the need for separate limbs, we asked Lewis to create the assets we would need, and provided him with this list, which includes another list of extra animation points that would be useful for attaching accessories to the characters without having to completely redo animations.
- Head
- Neck
- Torso
- Upper Arm (Left and Right)
- Forearms (Left and Right)
- Hands (Left and Right)
- Hip Region
- Upper Leg (Left and Right)
- Lower Leg (Left and Right)
- Foot (Left and Right)

Potential Assets (Item/Accessory Slots)
Idea: Create ‘points’/placeholders in animation templates where DLC/Customisation items can be attached to a character.

- Headwear
- Facial Accessories
- Neck Accessories
- Chest Accessories
- Arm Accessories (Upper/Lower/Hand)
- Hip
- Leg Accessories (Upper/Lower/Foot)
I believe using this technique will prove far more efficient for creating our animations than anything else, and if the rig can be loaded into unity, it would allow for greater variety of animations through the ability to play two different sequences simultaneously. This would also decrease the workload and file size used by saved animation sequences.

With this new revelation Tim and i were able to write up our section of the GDD:
"Animation for this game will be implemented through the Unity Engine and created through Autodesk Maya.  The animation for this game will be using a 2D Skeletal  System on 3D Models because of the camera angle doesn’t require the use of a 3D Skeletal System. The animation for the game will encapsulate the style found in games like Plants vs. Zombies with the animation being very loose and comical."