CryENGINE®3 is the first PC, Playstation®3, and Xbox 360™ all-in-one game development solution that is Next-Gen ready with scalable computation and graphics technologies. Using the CryENGINE®3, you can start the development of your next generation games today. CryENGINE®3 is the only game engine that provides multi-award winning graphics, state-of-the art lighting, physics and AI, out of the box. The famous CryENGINE®3 Sandbox™ editor is a production proven, third-generation real-time tool suite designed and built by AAA developers. CryENGINE®’s powerful real-time renderer is now even better! DirectX 11 (DX11) support significantly enhances the capabilities of the renderer within CryENGINE®3, allowing for some of the best visuals ever seen.
In this article we will explore some advanced components of CryENGINE 3 by creating a new vehicle for your player to drive around in your level.
Posted by INtense! on Aug 2nd, 2011
Advanced Mapping/Technical.
In this article by Dan Tracy, author of CryENGINE 3 Cookbook, we will cover:
In this recipe, we will show you how to build the basic mesh structure for your car to be used in the next recipe. This recipe is not to viewed as a guide on how to model your own mesh, but rather as a template for how the mesh needs to be structured to work with the XML script of the vehicle. For this recipe, you will be using 3DSMax to create and export your .CGA.
.CGA (Crytek Geometry Animation): The .cga file is created in the 3D application and contains animated hard body geometry data. It only supports directly-linked objects and does not support skeleton-based animation (bone animation) with weighted vertices. It works together with .anm files.
Create a box primitive and four cylinders within Max and then create a new dummy helper.
After creating the basic primitives within Max, we need to rename these objects. Rename the primitives to match the following naming convention:

Remember that CryENGINE 3 assumes that y is forward. Rotate and reset any x-forms if necessary.
From here you can now set up the hierarchy to match what we will build into the script:
Your hierarchy should look like the following screenshot in the Max schematic view:

Next, you will want to create a proxy mesh for each wheel and the body. Be sure to attach these proxies to each mesh. Proxy meshes can be a direct duplication of the simple primitive geometry we have created.
Before we export this mesh, make one final adjustment to the positioning of the vehicle:
Once complete, your left viewport should look something like the following screenshot (if you have your body still selected):

After setting up the materials, you are now ready to export the CGA:
This setup of the CGA is a basic setup of the majority of the four wheeled vehicles used for CryENGINE 3. This same basic setup can also be seen in the HMMWV provided in the included assets with the SDK package of CryENGINE 3.

Even though the complete HMMWV may seem to be a very complicated mesh used as a vehicle, it can also be broken down into the same basic structure as the vehicle we just created.

The main reason for the separation of the parts on the vehicles is because each part performs its own function. Since the physics of the vehicle code drives the vehicle forward in the engine, it actually controls each wheel independently, so it can animate them based on what they can do at that moment. This means that you have the potential for a four wheel drive on all CryENGINE 3 vehicles, all animating at different speeds based on the friction that they grip.
Since all of the wheels are parented to the body (or hull) mesh, this means that they drive their parent (the body of the vehicle) but the body also handles where the wheels need to be offset from in order to stay aligned when driving. The body itself acts as the base mesh for all other extras put onto the vehicle. Everything else from Turrets to Doors to Glass Windows branch out from the body.
The dummy helper is only the parent for the body mesh due to the fact that it is easier to export multiple LODs for that vehicle (for example, HMMWV, HMMWV_LOD1, HMMWV_LOD2, and so on). In the XML, this dummy helper is ignored in the hierarchy and the body is treated as the parent node.
Here are some of the more advanced techniques used.
A more advanced trick is the use of dummy helpers set inside the hierarchy to be used in later reference through the vehicle's mod system. How this works is that if you had a vehicle such as the basic car shown previously, but you wanted to add on an additional mesh just to have a modified type of this same car (something like adding a spoiler to the back), then you can create a dummy helper and align it to the pivot of the object, so it will line up to the body of the mesh when added through the script later on.
This same method was used in Crysis 2 with the Taxi signs on the top of the Taxi cars. The Taxi itself was the same model used as the basic civilian car, but had an additional dummy helper where the sign needed to be placed. This allowed for a clever way to save on memory when rendering multiple vehicle props within a single area but making each car look different.
Adding the basic body and four wheels to make a basic car model is only the beginning. There are limitless possibilities to what you can make as far as the parts on a vehicle are concerned. Anything from a classic gunner turret seen on the HMMWV or even tank turrets, all the way to arms for an articulated Battlemech as seen in the Crysis 2 Total Conversion mod—MechWarrior: Living Legends. Along with the modifications system, you have the capabilities to add on a great deal of extra parts to be detached and exploded off through the damage scripts later on. The possibilities are limitless.
In this recipe, we will show you how to build a new script for CryENGINE 3 to recognize your car model as a vehicle entity. For this recipe, you must have some basic knowledge in XML formatting.
Open DefaultVehicle.xml in the XML editor of your choice (Notepad, Notepad++, UltraEdit, and so on). This XML will be used as the basic template to construct our new vehicle XML. DefaultVehicle.xml is found at the following location: MyGameFolder\Scripts\Entities\Vehicles\Implementations\Xml. Open the MyVehicle.max scene made from the previous recipe to use as a reference for the parts section within this recipe.
Basic Properties:
Downloading the example code
You can download the example code files for all Packt books you have purchased from your account at PacktPub.com. If you purchased this book elsewhere, you can visit PacktPub.com and register to have the files e-mailed directly to you.
For now, we will skip the Damages and Components cells as we will address them in a different recipe.
Finally, you will need to implement the MovementParams needed, so that the XML can access a particular movement behavior from the code that will propel your vehicle. To get started right away, we have provided an example of the ArcadeWheeled parameters, which we can copy over to MyVehicle:
After saving your XML, open the Sandbox Editor and place down from the Entities types: Vehicles\MyVehicle. You should now be able to enter this vehicle (get close to it and press the F key) and drive around (W = accelerate, S = brake/reverse, A = turn left, D = turn right)!

The parts defined here in the XML are usually an exact match to the Max scene that the vehicle is created in. As long as the naming of the parts and the name of the subobjects within Max are the same, the vehicle structure should work.
The parts in the XML can themselves be broken down into their own properties:
The def_vehicle.xml file found in MyGameFolder\Scripts\Entities\Vehicles, holds all the property's definitions that can be utilized in the XML of the vehicles. After following the recipes found in this article, you may want to review def_vehicle.xml for further more advanced properties that you can add to your vehicles.
Now that we have created a basic template for a car within the game, we can now start manipulating more of the fun properties that the XML holds. Let us start out by giving this car a bit more speed.
Complete the Creating a new car XML recipe. Then open MyVehicle.xml in Notepad or an equivalent editor.
Under the ArcadeWheeled cell, you will find the Power tag; within the Power tag you will find a property called topSpeed=32. It is a simple matter of increasing this value to increase the car's overall top speed.
The Arcade Wheeled movement property is a new movement behavior since CryENGINE 3. Dealing away with the confusing gear ratios, new backend code has been written to create the Arcade Wheeled for the purpose of being able to tweak the major values on wheeled vehicles much easier.
The following are the common properties of an Arcade Wheeled:
In this recipe, we explore some of the possibilities of manipulating the Massbox that we created when first creating the car's XML. With increasing the Massbox of the car, we will see how the car is able to push lighter objects out of the way.
Complete the Creating a new car XML recipe. Then open MyVehicle.xml in Notepad or an equivalent editor.
As simple as the previous recipe was, this one will be just as easy to make a massive change to your vehicle. Begin by finding the car's part named massBox. To increase the mass of the MassBox, simply increase the mass = 1500 to a higher value such as 3500. The mass in CryENGINE 3 is measured in kilograms.
A simple method to see the results of how easy it is for the car to move objects out of its way is to place down a basic entity with a mass of 1000 and then drive into it with the previous MassBox properties. Then repeat the process again with the 3500 MassBox value.
After changing any XML values on the car, you can reload the XML on the car by right-clicking on the vehicle and selecting Reload Scripts.
The MassBox is a special part of the vehicle that handles all of the physical interactions of the vehicle as a whole. Along with Arcade Wheeled as the movement behavior, the Massbox is the main point of reference for the car and all its parts for mass physics calculations (as long as all those parts remain on the vehicle).
Be aware that increasing the mass of the MassBox will also change the driving characteristics of the car.
It is possible to define the mass of other parts besides the Massbox. However, with Arcade Wheeled movement parameters, this property change will do virtually nothing, but with other movement behaviors it may change the driving mechanics such as the Wheeled Legacy (which should not be used as that movement behavior is no longer supported).
Still, there is a use of this property and that is if ever we want to create a part to be detached from the vehicle, this part requires a mass in order to follow the laws of physics for the CryENGINE, such as gravity.
Up to this point, we haven't addressed the issue of the player hanging out of the side of the vehicle every time the they enter it. This is due to the fact that there is no sitting position defined for the driver position and thus leaves the player in the last position and pose before entering the vehicle. In this recipe, we will fix this problem by creating a new helper within the vehicle XML.
Complete the Creating a new car XML recipe. Then open MyVehicle.xml in Notepad or an equivalent editor.
This simple seat helper lets the vehicle code know where the passengers of that particular seat need to be positioned in the vehicle. Be aware that this only aligns the root pivot of the character to this position. So in order to pose a character to sit in this position, it is a good practice to create a new animation graph and animation that moves the character so that the root pivot aligns to a bone on the character such as the pelvis.
You can use the HMMWV animation graph to give a seated position to your character. If no changes to the player model have been made to the skeleton, then we will be able to utilize the animation graph from the SDK's HMMWV to pose our character. Within the same Seat name="driver" cell, add the following property: agVehicleName="HMMWV"
This will use the animation graph to play the same animations used for entering and exiting the vehicle as well as utilizing the same sitting pose as the one used for the HMMWV.

Over 90 recipes written by Crytek developers for creating third-generation real-time
Awesome :D, i'm waiting for cryengine 3 to be released to indies :D.
This is really useful, there was a vehicle I was going to get working in CE2, never got round to getting it to work.
Can't say the guy will fit in it though...
Awesome