Vehicles are special geometry objects, which are driven by scripts, which also determine the functionality.
Vehicles are complex objects that need careful setup in the 3d package. Basically, the setup should be applicable to any package. Polycounts need to be carefully calculated, as extended functionality increase object (drawcall) and polycount drastically.
Example: Rotation and position of the chassis pivot:
Every moving part needs to be a separate object within the 3d package. The pivot needs to be set correctly within the 3d package as the engine will use the object's individual pivot to make transformations.
For Maya what you have instead of linking is groups. Be sure that you have a _helper node encompassing your other assets. Basic hierarchy should look like this:
After everything is organized accordingly, you will have to include UDP (User Defined Properties) to the wheels, chassis etc...
(The UDP window can be found under the Crytek tab, make sure you have the Crytools installed)
Every moving part needs to be a separate object within the 3d package. The pivot needs to be set correctly within the 3d package because the engine will use the object's individual pivot to make transformations.
Naming is needed for scripts to identify the objects and interact with them. The examples below reflect the asset names used in Crysis - they can be different for other games.
The wheel proxy must be simple enough to be recognized as cylinder by physics. Support for an additional detailed proxy (if the wheel's shape demands it) will follow.
Vehicles are complex objects and simplifying collision calculation is very important for performance. Therefore it is advisable to create two physics proxies. one is for collision with the terrain and characters, one for collision with bullets, grenades...
You can have different number of LOD levels for different parts of the vehicle. i.e. the chassis of a car may have 4 LOD levels whereas the door, being a more simple object, has only 2.
LOD switching is based on screensize, smaller objects will switch earlier than big ones. Keep this in mind when doing LOD's.
The damage model for vehicles is a separate asset which replaces the vehicles on destruction. It can be a simple static model or a complex prebroken object.
To manage objects easier, it is recommended to sort LOD's via layers.
You can test if your animations are exported and playing correctly by loading the vehicle to the character editor, and clicking on the animation on the right.
Vehicles are very complex objects and can cause major problems, if the exporting is not done carefully. To avoid complications in the scene:
Setting up named selection sets can help you in re-exporting your assets.
In order to work properly, a vehicle script is required. Otherwise the vehicle can only be judged visually as a Geom Entity.
Please refer to section for information on the vehicle editor.
There are some useful commands you can use to check your asset, and see if it works as expected. Some of these are listed below. (You can turn off any of these drawing modes by entering 0 after the command instead of the number given here!)
CVar | Description |
---|---|
p_draw_helpers 1 | Used to check physique proxies. |
e_debug_draw 1 | Used to check LOD's. Using this variable you can see the bounding box of the object, see the name of it, number of LOD levels available for the object, the one which is currently displaying, and the polycount of the current LOD. |
e_debug_draw 2 | Displays polycount only for the given LOD. |
e_debug_draw 3 | Different LOD levels are represented in different colors, so you can clearly see the transition between two LOD levels. Also see the total number of LODs and the one currently displaying. Blinking one shows up if the given object does not have an LOD. |
e_debug_draw 5 | Shows how many material ID's are in use on the given objects. |
e_lod_min 0 - 6 | Shows the specified LOD number as LOD0 - very handy for debugging LOD's in the engine. |