About : This tutorial will explain how to import a model into Unreal Engine 3, and a number of important properties involved in the process. Note how this tutorial will only focus on the creation of static meshes, and not on animated meshes, which is a wholly different process.
Target Audience : Beginner
Platform : Unreal Engine 3
Last Update : November 2007

What it can and can't do
Importing a model into the engine and configuring its flags is very easy and takes less than 10 seconds once you know what to do. We'll start this tutorial with a shortlist of the things the engine supports and offers, and the things it does not.
Can do
Can't do
This tutorial will focus on how to export a mesh from 3DSMax. XSI and Maya users will need to download the Unreal plugin before they can commence modeling for Unreal. Max users do not need to as Max supports ASE exporting by default.
The plugins for Maya and XSI can be found here.
Setting up a model, exporting, and importing
Your 3D package should preferably use a type of Generic Units as grid size. The actual unit size doesn't really matter in the end though, as whatever unit you had in the 3D package will simply translate as 1 unit in Unreal. 400 Units width in the 3D package means 400 units in Unreal. Usually the player size is between 80 and 250 units. This depends from game to game, as the size of a character is freely customizable.
The implications this has on you, is that there is no true way to translate an Unreal unit into the metric system. One can't say X Unreal Units equals X meter (or feet) as this varies from game to game.
A model must have UV coordinates and it must have correctly configured smoothing groups (preferably).

These materials can be set to the mesh by using the Set ID feature in the Edit Poly and Edit Mesh modifiers.

Once your mesh is ready, make sure it is positioned on coordinates 0, 0, 0 as the world's center will become the pivot of the object once exported. Export the mesh by going to the top menu of 3DSMax File - Export Selected - Select ASE as type.
Following menu will pop up:

Note that models cannot be exported together. Every model needs a separate ASE file or it will merge itself with other models into one big object.
Once the model has been exported, open up the editor, and go to the Generic Browser. If it isn't open already, you can open it by the button on the top toolbar (marked on the upper left of the screenshot).
In the Generic Browser go to the File menu - Import - and select your file. Once you ok'ed the import dialog, a new window will pop up.

Once imported, you should browse to the package, and double click your mesh in it. The Staticmesh Properties window will open.

Optionally you can also configure the Lightmap information. For more information refer to my Lightmap tutorial.
You're done! Add the staticmesh to the world by using the rightclick menu, or by holding S on the keyboard and clicking somewhere in the world.
Collision
Three different types of collision exist:
Usually only larger and more complex meshes have their collision made in external packages. Anything that will do with cubes, cylinders and similar shapes is done in the editor. Large natural objects such as caverns often use per poly collision.
# Collision made in an external package
All you need to do is to give the mesh you wish to use as collision the prefix UCX. Example: if the regular mesh is named Tree, the collision for Tree should be named UCX_Tree. Select both, and export both together into the same ASE file. Upon import the engine will recognize the UCX mesh, and assign it as collision model. It will not show up in the Generic Browser.
# Collision generated by the editor
Three subtypes exist: DOP models, auto generated convex models, and BSP made collision. You are free to use whatever type you want, although usually DOP models are easiest to apply.
DOP collision models are simple shapes like boxes and cylinders. 6DOP for example is simply a box which transforms the bounding box into a collision model. Experiment with the DOP's to see what each one does.
Note that you can preview collision by enabling the marked button.

Convex collision creation allows you to generate a collision model that fits your model better than standard DOP models. It can be accessed in the same menu as displayed in the DOP collision image (Collision - Auto Convex Collision)

It is possible to use the shape of the red builder brush as collision model. This allows you to create quite complex collision models without the need of creating those in an external application.
To assign the shape of the brush to the model, place the brush where you want the collision to be, and select both the brush as the model and rightclick them. Select Save Brush As Collision to assign it.

# Per-poly collision
In the properties of a staticmesh, simply turn off the two settings marked to force per-poly collision. UseSimpleBoxCollision and UseSimpleLineCollision. Optionally you can also turn off UseSimpleRigidBodyCollision so physics too use per-poly collision.

Batch exporting
By using KeensBatchExport script for 3DSMax, you can mass export dozens of meshes within a second, dramatically speeding up the process.
Download the script
Bind it to a button on a menubar or on the keyboard, and then open it.

This script will automatically place all meshes on location 0, 0, 0 before exporting, and it will place all meshes back on their original location after the export. This way you can easily have dozens of meshes in the same Max file, and easily transform their own pivots into the ingame pivot.
It automatically names the ase files with the names the meshes had in the Max files.
Common problems
Some materials in 3DSMax may be sharing names, thus confusing the engine. Fix it by renaming offending materials.
In this example both materials share the same name (Material #25), even while they do have different textures assigned.

You might have forgotten to save the package! Packages need to be saved manually, or changes will not be saved.
If that is not the solution to the problem, you might be using shared package names. Package names must be unique and may not contain spaces and similar non standard characters. Unreal does not see file extensions so a package called Dog and a code file Dog are identical to the engine, and it will get confused. Likewise for a level and an asset file with the same name.







