Time for action - creating animation using rigid body data

Let's create some of our own .anm files that will animate a series of nodes we will create in 3ds max:

  1. In 3ds Max, create two simple sphere primitives in the scene.
  2. Convert the primitives to an editable poly by right-clicking on the object and selecting the function Convert To Editable Poly.
  3. As we will be exporting a .anm file for a .cga geometry, we must convert all the objects that will be animated to the Tension Continuity and Bias controller or TCB.
  4. Change the controller types for Position and Rotation to TCB under the 3ds Motion Tab.
    Time for action - creating animation using rigid body data
  5. Now, create a very simple animation for the objects in the scene (bouncing the spheres is a simple animation to make).
  6. Next, we must export the geometry before exporting the animation for it.
  7. Select all the objects and add them to the Object Export list by clicking on Add Selected.
  8. For this example, make sure Export File Per Node is set to false, because we would like to have both the geometric objects in a single .cga file.
  9. Next, make sure that the CGA file type is selected in the Export To drop-down box.
  10. Save the max file as mycustom_bouncing_spheres.max under the game/objects/bouncingspheres folder.
  11. Click the Export Nodes button.

    This will export the objects to the same folder in which the source file is located.

    The file will assume the source file's name unless you check Custom Filename. This will allow you to type in a unique name.

    Next, for good workflow, we should examine our newly created .cga in the character editor.

  12. Open CryENGINE Sandbox and the Character Editor.
  13. Click File| Open and navigate to the folder to which you exported your .cga file.
  14. Each CGA file contains a default animation and it is the length of the time line that was active when the .cga file is exported.
  15. As we now have an existing CGA file that we want to add a selectable animation to, create a second animation for the .cga file.
  16. When the animation is complete, navigate to the object export section of the exporter and set Custom Filename to true; set a filename that uses the name of the .cga object you are adding it to as a prefix in the name.
  17. As an example, the test.cga file contains the object you are animating, plus the default animation. In our case, you need to name the .anm file test_[n].anm, where n is the name of the additional animation.
  18. Click on the Export Nodes button.
  19. The .anm file must be saved to the same folder as the .cga, otherwise you will not be able to preview it in the character editor.

What just happened?

.anm files are the simplest animation that you can export to the CryENGINE. They do not require as much processing power as a skinned mesh and can be animated fairly easily. These types of animations can be used on a variety of environmental objects, which require some moving parts. The .anm file format is also the principal animation format for any vehicle animation.

Have a go hero - using pre-baked physics with .cga objects

To pre-bake physical destruction, you can use .cga objects with baked .anm animations.

This can be very useful for the complex destruction of large objects.

The same rules apply when creating pre-baked physics for .cga objects, because all the position and rotation controllers of the objects in CGA need to be set to TCB.

When exporting pre-baked physics animations, select merge all nodes in the export options.

Turn off all bone export options, but tell the exporter to export every '1' frames.

Select one object that is not moving and parent all the other pieces to it. This object can be the one you set to unyielding. In buildings, use the foundation.

The current animation will show up as Default in the CGA you export; no .chrparams file is needed to play it.

Open your CGA in the Character Editor and play the animation labeled Default; you should see your animation play here.

Note

When using the pre-baked .cga in the game environment, it must be placed as an animobject.

There are two important properties available when using pre-baked .cga; the first is that ActivatePhysicsThreshold is a fraction of levels gravity, so a heavier piece will be harder to activate, since the gravity force that acts on it is stronger. The second is the mass. Mass is set as the overall value for the entire CGA; for instance, a Mass of 100 on a CGA with 100 pieces would yield 1kg per piece.

..................Content has been hidden....................

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