Asset Creation Manual
ContentsIndexHome
PreviousUpNext
Pickable Objects

Pickable Objects

 

Introduction

In CryENGINE® 2 objects can be turned into "pickables". The player can pick them up with one or two hands, carry them around and drop them again. The picking-behavior is dependent on the game script. 

In the Crysis Game script, there are two types of picking behavior: 

 

  • One-handed

The player will pick up the object with his left hand and holds the object in this hand. The weapon in his right hand is still usable. If the player holds a two-handed weapon, the weapon will be switched to the fists. 

 

  • Two-handed

 

The Player will pick up and hold the object with both hands. The hands itself are not visible in the fist person view. No weapon is usable during that. 

Requirements

An pickable object can be set up in a DCC-tool by having: 

  • a NoDraw collision proxy attached to it.
  • mass or density defined (either set up in the 3D Max object properties or in the entity in Sandbox).
  • a grab-helper with the correct name linked to it.

 

Basic Setup in a DCC-Tool

3D Studio Max

In order to define the object’s position on the ingame-screen, a helper needs to be linked and aligned to the object. The presence of such a grab-helper in the object hierarchy turns the object into a pickable object.In Crysis, the pivot of this grab-helper is aligned to the “item_attachment”-bone, which is located in the skeleton of the frag grenade first-person animation.The orientation of this bone is: +X right, +Y front, +Z= up. In the one-handed pickup animation the “item_attachment”-bone position is in the left hand of the player. For a two-handed pickup the bone is located in the center between the player’s hands. 

USe the "Local" Coordinate system when adjusting the rotation of the grab-helper. 


One-handed pickable objects

Example-File 

 

Example Hierarchy 


 

Setting up the helper: 

 

  1. Open your .max scene and create a “Dummy” helper.

Name it “ grab_onehanded_01 ” (name needs to be correct!)

  1. Link the grab_onehanded_01 helper to you object.

 

  1. Align it to the object.

 

Proceed with export 

Two-handed pickable objects

 

File

 

Example Hierarchy 


Setting up the helper 

 

  1. Open your max scene and create a "Dummy" helper.

Name it "grab_twohanded_01" (name needs to be correct!) 

 

  1. Link the grab_twohanded_01 helper to you object.

 

  1. Align it to the object. In Crysis the helper should be positioned below the

object, so the player can see the object, since he can not see his own hands in two-handed mode. 

Proceed with export 

Pieces of Destroyable objects

Overview 

When a destroyable entity is destroyed, it will spawn pieces as well as a remaining object. These objects can be set up as pickables too. 

The process is equivalent to the one for one-handed and two-handed pickables, but the name of the object the helper is linked to needs to be added as a prefix in front of the helper name (e.g. remain_ grab_twohanded_01). A grab-helper for the non-destroyed version of the object (“main”) does not need to have a prefix.

File

 

Example Hierarchy: 


Basic Setup in Max: 

 

  1. Open your max scene and create a “Dummy” helper

for your object. Name it as described in the overview (e.g. remain_ grab_twohanded_01 or piece_banana01_ grab_onehanded_01). 

 

  1. Link the grab-helper to your

object. 

 

  1. Align it to the object.

 

In most of the cases, the helper should be positioned below the object, so the player can see the object, since he can not see his own hands in two-handed mode. 

Note: The pivot of these spawned pieces/remain, that you can see in your DCC-tool, doesn't match necessarily the entity position in game. This means, that placing the helpers for these objects could require a bit more of "trial and error". It should be a good idea to use always the non-destroyed version of the object as reference to align your helper. 

 

  1. Repeat step 1-3 for all pieces/remains that

should be pickable. 

Proceed with export 

Using the pickable helper template file

Overview 

During the Crysis development we developed an advanced technique to align one-handed grab-helpers to pickable objects in 3D Studio Max. We created a template file that contains the player’s arms in the grab-pose that will be seen in the first person view of the game, and a camera that replicates the first person-camera of the game. It is also a grab helper included that is connected to a helper with a transformation-constraint. This makes it easier to rotate the whole template file and the grab-helper at the same time without unlinking the helper. 

The key about this technique is to rotate the whole arms-template including the grab-helper, until the result looks as desired in the first person camera. 

The disadvantage of this technique is that the scene might become complex, especially if more than one template is merged into the scene. Efficient layer usage will become helpful for this. 

Pickable helper template file: 

pickable_template.max 

Setup in 3D Studio Max: 

1  

Merge in the ”pickable_template.max”-file. Select all the objects in the merge-window 1 Link the “grab_onehanded_01” helper to your object. 1 Adjust the position and rotation of the “pickable_template”-helper until you are satisfied with the position. The “grab_onehanded_01” helper is constrained to the “pickable_template”, so it will inherit all transformation changes of the “pickable_template”-helper 

Proceed with export 

Example for a well aligned pickable helper template: 

Export

1 Add the root node of your pickable object to the export list 1 Make sure “export by node” is checked and "merge all nodes" unchecked. 1 Click export. 

Note: Everything linked to this object including all the sub-objects/helpers will be exported into one file.

Setup in Sandbox

In order to make your pickable object working in Sandbox, place it as a GeomEntity or any Entity which has set “Pickable” and “RigidBody” to “true”. “Usable” has to be disabled. Pickable objects-types are: 

  • Entities with “Pickable” and “RigidBody” set to “true” and “Usable” to “false”.
  • Particles containing a grab-helper.
  • Ragdoll objects containing a grab-helper (e.g. Dead bodies)
  • "Default"-Class entities (pieces of broken vegetation)
  • Procedural Vegetation with “Pickable” flag set to true.

Example-properties of a pickable entity: 


 

Picking of animated non-AI characters

Overview 

Non-AI-Characters can be set up to be pickable, too (Animals for example). 

In this case we can not set up the grab-helper attachment in a DCC-tool but in the Character Editor. 

The grab-helper will be will be added to the character as a bone attachment. So the orientation of the helper is dependent on the bone it will be attached to. You don’t necessarily need to apply an object to the attachment, but for easier alignment it is recommended to use an object with a clearly visible orientation. The object will be removed from the attachment later on when the desired result is achieved. 

 

 

Attachment Creation: 

 

1  

Open the .chr or .cdf file you want to make pickable in the character editor. 1  

Add a new attachment. 1  

Apply this attachment as a bone-attachment to any bone (preferably root-bone of the rig, since it is not animated) 1  

Move and rotate the object until you think it might be aligned correctly later in the first-person view. 

1  

Save your work as a .cdf file. 1  

Place your animated non-AI character in the Perspective view in Sandbox (Animals are usually placed from the ArchetypeEntity Library). 1  

Go into game-mode, pick up your animated non-AI character and see if its alignment looks as desired in the first-person view. 

1  

In order to remove the object that was used as helper for the alignment, open your .cdf file in Notepad and remove the object path 1 Repeat steps 4. - 7. until the desired result is achieved. 

During the alignment:
 


 

After removing the Object path in notepad: 


 


Notes

Changes on the pickability behaviour of AI-Characters and procedural breaking environment objects have to be modified in the game code. For AI-Characters, the name of the bone which serves as a grab helper needs to be defined by game code. The grab position of pickable procedural breaking environment pieces is located on an offset to its pivot, which needs to be defined by game code

Debugging

e_debug_draw 15 displays all grab_helpers 

Copyright © 2008 Crytek GmbH. All rights reserved.