Topic: Game Animation Discussion

I am thinking of some ways to make my animations seamless, so here I am going to discuss some ideas I have.

Walk Animation:
Now, I already have a working 3rd person demo (not posted yet, because I want it to look good when I do). In order to get the transitions of the animations right, I had to make an idle animation whose last frame pose is the starting pose for the walking animation. When I press "W" the animation goes to the walking animation and when I let go, the animation goes back to the idle animation.

Driving Animation:
Also, I am thinking a little demo where the character can enter and exit a car. My idea is to use setPosition() to snap the character to a position near the car so that when I play the Climb() function it plays a climb animation that will be oriented the right way. Also I would probably use setRotation(). Using a quick camera change (so that you don't see the object snap to the position) and perhaps a fade effect(video style fade) I change the camera to a mid-shot of the character climbing. Then I change the camera again with a fade effect to another camera that is inside of the car.

Jump Animation
What about jumps? It would seem it is like the walk animation. The first frame of the jump animation is the last frame of the idle animation.

Tumble Animation:
Just like the walk and jump animations. However, the first and last frame of the tumble animation would have to be the first frame of the idle animation (he has to stand back up DURING the tumble animation)

When I think of more ideas, I will post them here.

Re: Game Animation Discussion

Driving

You can make the character walk to the correct position, instead of snapping.
Then you rotate him in the correct direction, and then play the animation to enter the car.
So it will look all smooth.

Re: Game Animation Discussion

255 wrote:

Driving

You can make the character walk to the correct position, instead of snapping.
Then you rotate him in the correct direction, and then play the animation to enter the car.
So it will look all smooth.

Wouldn't I need some sort of path-finding algorithm or something though? A sort of moveTowards() function?

I wonder if I can make some sort of rig using the follow behaviors with constraints and such.

Once I get my AI senses working, I could use that to do it I suppose.

Re: Game Animation Discussion

Rig, constraints? You're overcomplicating things.
And complex path-finding is not necessary because the player is supposed to already be near the door. Otherwise you don't even trigger the "enter car event". Yes, "moveTowards()" is enough and I think it shouldn't be too difficult to do in Lua.
In pseudo-code would be:

if keyPressed(ENTER)
if isPlayerNearCarDoor
   then
      movePlayerTowardsPoint(CarDoor->getPosition())
      inAutoMotion = true;
endif
endif

if(inAutoMotion)
  if(playerPos ~= CarDoor->getPosition())
      inAutoMotion = false
      playAnimation(enterCarAnimation)
      playAnimation(DrivingPose)
  else
      //keep going towards point
      playerPos += directionVectorNormalized * howMuchPerStep
  endif
endif

Last edited by 255 (2013-10-16 22:57:18)

Re: Game Animation Discussion

Okay, I will look into that, Thanks 255.

Adding a little more to the discussion:

Clothing:

After looking at my stage level, I am wondering how I would go about changing the clothes of the character and still have them animate.

The idea I have is to not change the entire character, but just export the character body and the character's clothes as two separate meshes and then parent them. The clothing mesh would still be animated at the same pace as the character.

Another way I am thinking of doing it is by animating an alpha material. I have noticed that in the mesh file, there is an opacity value for each material. I wonder if this could be animated in Lua. It seems it would have to be done in C++ on the engine level.

Re: Game Animation Discussion

Tutorial Doctor wrote:

Okay, I will look into that, Thanks 255.

Adding a little more to the discussion:

Clothing:

After looking at my stage level, I am wondering how I would go about changing the clothes of the character and still have them animate.

The idea I have is to not change the entire character, but just export the character body and the character's clothes as two separate meshes and then parent them. The clothing mesh would still be animated at the same pace as the character.

Another way I am thinking of doing it is by animating an alpha material. I have noticed that in the mesh file, there is an opacity value for each material. I wonder if this could be animated in Lua. It seems it would have to be done in C++ on the engine level.

I decided to research your question out of interest, and came across this...

I model each pieces of clothes in the same model file (blender), to include animation you need to make sure that the pieces of clothes are attached to the same armature of the model and correctly weighted

in Unity after importing my model, I just disable the mesh renderer for the clothes that must be hidden. Since the invisible parts are not rendered, performance is not affected.

when you play the animation, if the clothes were correctly weighted, they naturally follow your mesh

So basically he is saying, he puts all of the clothing on the character and hides all of the clothing but the outfit he wants to wear. And because all of the addition clothing are hidden there not being rendered so there is little or no performance loss.

To change clothes he just toggles the visibility of what he is wearing and what he wants to change into.


That sounds feasible My guess would be in maratis we would populate a table with instances of the child objects(clothes) of our parent object(character) then toggle there visibility.


Don't know if it will work, dont know what you have tried, but hay its another set off eyes on the problem.

Note it looks like setVisible() hasn't been wrapped for Objects yet, at-least I didn't see it in the wiki. Haven't tried in maratis eather.

    // visibility
    inline void setVisible(bool visible){ m_isVisible = visible; }
    inline bool isVisible(void){ return m_isVisible; }
    virtual void updateVisibility(MOCamera * camera){}

If its not there is should be fairly easy to wrap that particular function. I also wonder if updateVisibility is also needed? If so dealing with pointers in a binding is a bit more complicated.

Last edited by zester (2013-10-18 04:14:57)

Re: Game Animation Discussion

Wow, that is almost exactly what I was thinking of, but I don't know of a way to toggle visibility of each item, being that when you export a maratis mesh it comes in as one object, though in the mesh file you have options for adjusting the visibility of each object separately. That is why I would have to export the body and then each clothing item as a different mesh and use activate() or deactivate(). The the clothing would have to be parented is so that they clothes mesh can follow the body mesh.

Thanks for finding that Zester, because I was wondering if I was just hacking it, but it seems that is how it is done. haha.

My next upload might be an updated stage level with animated characters.