Animating entities in the Track View

The animation of objects and entities in the Track View can be as complex or as simple as the animator or the designer requires. In this recipe, we will animate a dead tree falling into water. This will involve animating the tree itself as well as triggering some particle effects at specific times. The interesting part about this will be that we are not making a cut-scene but rather a scripted game play event that will alter the path of the character.

Getting ready

  • You should have forest.cry open for this recipe
  • You should have created a new sequence with the name my_second_cutscene

How to do it...

First, we must add some geometry to animate. It is important to remember the difference between a brush and the entities. Brushes cannot be added to the Track View.

  1. To allow us to animate the geometry we are using the basic entity found under the Entities | Physics section of the Rollout bar.
  2. Once placed, name the BasicEntity to falling_tree_01 and set its model string to objects/natural/vegetation/rocky_ravine/d_spruce_dead_a.cgf.
  3. Drag the Animobject somewhere near the water where it might be able to fall in and allow the player to walk up.
    How to do it...
  4. Create an initial key frame and then drag the active time slider over to 1 second.
  5. Reposition the tree to a fallen pose with the Record button set to active.

    For the ease of this recipe, we will only create two poses but you can of course add more key frames for a better looking animation.

    How to do it...

    Note

    With this kind of animation, you can rely on the preview timing for collision type events such as particle effects. The alternative would be to physically simulate this in the physics engine, which could be good but not deterministic enough to be used for a reliable game play.

  6. Next, let's add two particle effects to this sequence.

    The first will be the breaking of the tree at the base with a wood splintering effect.

  7. Add a particle effect from the database view under the particles/breakable_objects/tree_break/small to the scene and align it to the base of the tree.
  8. Add this particle effect to the Track View and create a key frame on the event timeline for the particle effect. The property on this key frame must be set to spawn. Create this key frame at the beginning of the scene to coincide with the destruction of the tree.
    How to do it...
  9. Scrub the timeline until you find the point where the tree impacts the water.
  10. Once you have found the first frame in contact between the water and the tree, place a second particle effect from the database view under particles/water/body_splash/corpse.
  11. Add the spawn key frame for this particle effect just at the contact time between the water and the tree.
  12. Play the sequence back to preview the results!

You can now trigger this sequence through a Flow Graph depending on many different events!

How it works...

Animating the entities can allow for designer or animator controlled scripted type events. This allows a fairly advanced manipulation of a wide variety of entities for these events. One important use of this kind of rudimentary animation is to white box certain cinematic events that may be further polished later on.

There's more...

You may want to know more about the different tracks available on entities or how to animate the scale of an object.

Entity visibility track

A track available to most entities is the visibility track. We can add this by right-clicking the entity in the sequence and selecting the visibility track.

When a key frame is created on this track, it will change the state of the object to hidden or vice versa. The easiest way to visualize it is to see that when the track is blue the object is seen, and when it is not, the object is hidden.

Entity visibility track

Animating scale

Scale is also accessible to most entities via the Track View. A scale track can be added by right-clicking the added node and selecting scale.

Entities and their tracks

Some entities have unique tracks. For example, characters can play animations and explosion entities can have explode events. Experiment with different entities in your cut-scene to see what is exposed.

See also

  • Go to the Creating a new Track View sequence recipe earlier in this chapter to refresh your memory on how to create a new sequence
  • Carry on to the next recipe to learn how to play animations on different entities in the Track View
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.226.187.233