Login x
User Name:
Password:
Social Links Facebook Twitter YouTube Steam RSS News Feeds

Members Online

»
0 Active | 86 Guests
Online:

LATEST FORUM THREADS

»
CoD: Battle Royale
CoD+UO Map + Mod Releases
Damaged .pk3's
CoD Mapping
heli to attack ai
CoD4 SP Mapping

Tutorials

»
CoD4 Mapping
ratings:
Awful Rating
Poor Rating
Average Rating
Good Rating
Excellent Rating
Porting Custom Models Guide (Assets Manager + Export-Import )
Versions: You must be logged in to view history.

Since making video about this is pretty hard and time consuming, and since many people ask about this kind of knowledge that no one ever seemed to bother explain publicly, I decided to try and explain it myself given what I know so far and it will hopefully be helpful to many folks out there. In short, this guide will explain step by step the procedure of importing a custom model in COD4, whether it is from a later cod game, or an entirely custom one. Be warn, it requires you to have at least the basic understanding of COD4 file system and raw file sorting. This is going to be a long one because importing models in COD4 is not the simplest thing in the world.

INTRO:
Since making video about this is pretty hard and time consuming, and since many people ask about this kind of knowledge that no one ever seemed to bother explain publicly, I decided to try and explain it myself given what I know so far and it will hopefully be helpful to many folks out there. In short, this guide will explain step by step the procedure of importing a custom model in COD4, whether it is from a later cod game, or an entirely custom one. Be warn, it requires you to have at least the basic understanding of COD4 file system and raw file sorting. This is going to be a long one because importing models in COD4 is not the simplest thing in the world.

Required:

Before we even start talking about custom models, you need to make sure you have a stable and functional call of duty 4 mod tools directory. That means that you have to have a call of duty 4 full game installed, that includes both Single and Multiplayer, that you have the official mod tools installed, that your mod tools are set up properly and that you have ran converter on the mod tools.

What is "Run Converter"?

Call of Duty 4 Mod tools include various applications that are necessary for making mods. Those apps are locate in the Cod4 root directory / bin folder and its subfolders. The ones you really need to be aware of are the following:

cod4/bin/CoD4CompileTools/CoD4CompileTools.exe (The main app for compiling and running custom levels. It also has shortcuts for other apps)

cod4/bin/CoD4Radiant.exe (The map editor of the game. You can build levels with this.)

cod4/bin/asset_manager.exe (Assets Manager. With this you can import or create custom assets of many kinds. It is a very important app when someone wants to make a mod with many custom assets) 

Now back to what Run Converter is. The Converter can be run either from Assets Manager or the Compile Tools. It is an essential settings app that generates various additional source files that are required for working with the mod tools. You need to run this before you do any work with the mod tools in order for everything to function properly or else you will have serious drawbacks due to lack of assets.

IMPORTANT!

RUNNING CONVERTER IS BUGGY IN COD4! MAKE SURE YOU ONLY RUN IT ONE TIME AFTER YOU SETUP THE TOOLS AND BEFORE YOU USE THEM. RUNNING CONVERTER AFTER YOU ADD CUSTOM ASSETS WILL PROBABLY DELETE CUSTOM MATERIALS DUE TO AN IMPERFECTION TO THE SYSTEM! DO NOT RUN CONVERTER EVER AGAIN AFTER PORTING CUSTOM MATERIALS!

An other, less important problem that the converter has is that it deletes the stock material for mtl_weapon_m4_m16 which will cause the M4 weapon to appear invisible in newly compiled maps. That can be easily fixed by having the download of the mod tools saved somewhere and copying the mtl_weapon_m4_m16 file from raw/materials and pasting it in your actual cod4 game mod tools folder
cod4/raw/materials

and then any newly converted map will have the m4 and m16 properly appearing.

Using Assets Manager:

Before we start talking about importing assets we must first break down how the assets manager works.

When porting assets in assets manager, you basically create a data base of assets that will be converter with the assets manager with the settings you put to them. Assets manager works with files called GDT. These files have all the custom settings you yourself will put in the manager.

When having Assets Manager open, to create an empty GDT file, just click File>Save and then you have to save your GDT file in a folder that is under your COD4 directory. It is HIGHLY recommended that you save all your GDT files in cod4 root/ source_data folder where other stock gdt files are. It's a good way to keep things organized.

You have to make sure you run the app as administrator so it has full authority to write on folders and save the gdt files of yours. Many folks have problem with that issue like I used to have and its a problem that seems to insist sometimes.

Now having a blank GDT file you can start creating new assets. But first we need to break down most of the custom asset types Assets Manager allows you to create and what they require to work.

On the Top Left corner of the app, you can see a 5 buttons, and a list below them. That list has all the asset types we can create. 

The ones we will explain in this tutorial are only the following two:

Material

Material assets are basically custom textures, however there are a lot of settings to be given for each type of texture. A world texture and a model texture need different settings and usability options. UI and HUD textures need other settings as well. Later in this tutorial I will explain how to make a material for custom models.

Xmodel

These are custom models/objects. Pretty easy to handle compared to other assets. Custom XMODELs with custom textures REQUIRE their material textures to be FIRST converted before the xmodel is converted itself.

IMPORTING MODELS

Now after this long explanation about the functionality of the mod tools, it is time to finally talk about importing models. To "get" custom models from other cod or non-cod games you need some sort of exporting software or if the game has mod tools that provides you with its models raw assets, then it's likely that this will work as well. However in order ti import ANY kind of model in COD4, you have to convert it to a file format called XMODEL_EXPORT a file that would look like this body_enemy_agent.xmodle_export for example.

To convert a model to the xmodel_export format, you probably need some maya plugins since maya is the most common 3d modelling software that is used for cod. Now I can't guide on how to get a proper maya version that will work with the xmodel_export plugins you will get but I can only give you some names you can research on.

For the plugins try to search "CoDMayaTools".

Getting the models

However an easier way to get xmodel_export files are exporters. Mainly the ones for COD games. We will work based on these in this tutorial. Assuming you have a cod model exporter, let's say "Greyhound" which is the one that is most efficient and popularly used at the time this tutorial was written, then we are ready to go.By using the exporter you can easily get ready to port xmodel_export files from most COD games assuming you have the games. Make sure you edit the exporter software settings so they export the models in xmodel_export format and for cod4/codwaw formats. Also it would be good to export textures as tga files. I won't guide you on how to use the exporters it should be pretty easy. Once you get the files. You should have an xmodel folder and an _image folder where textures are. Now it's important to know what images each model requires. When you have exported just one model, that should be pretty easy, but when you export multiple models with multiple materials each, then things are messy. I don't have a good advise as for how to keep things organized in that matter, however my only suggestion is to use the "date modified" or "date created" list option in windows.

Preparing the model assets.

To keep things simple, I will give you an ONE model export-import proceedure example.

Assuming you exported one model with the exporter software you should have an _images folder and the xmodel folder of the model itself. Given our notes above, if you put the right settings the model folder will have the xmodel_export file itself (if it has LOD models it will have them too) and the images will be in tga format.

It is important to understand how model textures are imported before we import the models because as it's explained before, custom models require their custom textures to be imported first.

COD textures have around 4 types of textures for one material.
Color map, Normal map, Specular map, Cosine power map.

Most models use all of these to make them look "realistic".

Color maps are the color texture itself. The most basic and the only required one.

Normal map simulates 2D shadows on the texture surface.

Specular and Cosine power map textures are both responsible for the reflective and shine quality of the texture. They're the most tricky part. They are imported as separate texures but they are joined in one texture after they're converted to a cod image format (.iwi files) and they usually start with a ~ symbol. The expoter will give you 3 out of 4 textures of the modle. That's because specular and cosine are joined upon conversion, therefore the converter will give you the joined file that has both textures. Since we got a TGA file and if you are familiar with Photoshop and the layer system, then all we have to do is open the specular map file that came with the exported model, and go to the RGB layer tab. There you can see 4 layers. RGB and Alpha. The ALPHA layer is the cosine power map. All you have to do is to select the ALPHA layer, select all (ctrl+A), then copy (Ctrl+C) then select all the RGB layer which will select all the sub layers R G B. And paste (Ctrl+V) Then you have to save the file with SAVE AS so we won't replace the original specular map, and name it in a way you know it's the cosine power map let's say mytexture_cos.tga It is also suggested that you rename the specular file to get rid of the ugly naming to something like mytexture_spc.tga instead of what we got which should be something like ~mytexture_spc_cos_&36~24.tga or something.

PORTING THE MODEL!

Now we can FINALLY start porting the model assets. I know you may be too tiered from the long list of elaborated info but trust me these are essential information that one must know when doing this.

First off, create a folder under your cod4 root directory. All custom imported assets must be in a folder under cod4 root directory in order for assets manager to work with them. Let's say a folder named my_custom_assets. Or you can use the xmodel_export folder that comes with the mod tools. And create your own subfolder in there. Anyway the point is to put your xmodel_export files and your tga image files under cod4 folder and try to keep things sorted out with folders to keep things organized. Trust me organizing these is VERY important. Don't do the same mistakes I did.

Let's go in Assets Manager. Load our GDT file in case we haven't already. In the asset type list select the MATERIAL asset type. Click NEW_ENTRY and then you must put the name of your material. The material names of custom models must match the materials assigned to the model itself IN the actual model file. To find the material names, you must open the xmodel_export file with a text editor. Yes any text edior can open and read these files. Don't edit them though. Now having the model file opened with text editor scroll to the VERY bottom. There you can see all the listed materials!  

The material name is part of this line based on our example:

MATERIAL 0 "mtl_mytexture_wood" "Lambert" "mytexture_col.tga"

The material name is "mtl_mytexture_wood"

There may also be multiple materials so you have to port each one with its corresponding textures separately.

Now that we got the name, let's go back in assets manager and in the NEW ENTRY window that asks for a name we just paste the "mtl_mytexture_wood" and click OK.

Now we have a new custom asset generated in our GDT file which is a material asset!

The settings that we need to put for the model material to function the way it should are the following:

materialType: model phong
surfaceType: [That must be what the texture surface is supposed to be, let's say WOOD in this case]
sort: default
usage: not in editor
Locales: Don't check any.
Framebuffer operations:
Keep things as they are here. If the model requires transparency options you only need to worry about the
blendFunc where you must put blend in most cases.

Now the next part is where we link our texture image files to the material.

Color Map: Navigate to where your mytexture_col.tga texture is (as explained it must be somewhere under cod4 folder)

DetailMap: Blank.

Normal Map: Navigate to where your mytexture_nml.tga

Specular Color Map: Navigate to where your mytexture_spc.tga

Cosine Power Map: Navigate to where your mytexture_cos.tga

Env Mapping:

These are various options that regulate the shine of the model. I don't have any good directions for those just keep them as default for now. All having 1 in them.

And just like that we are ready to convert our FIRST MODEL MATERIAL!

To convert an asset in assets manager, go to the top menu bar, click PC Convert, and CURRENT ASSET ONLY!

BE VERY CAREFUL NOT TO CLICK THE BUTTON BELOW IT.

This will run the infamous converter we talked about in the beginning.

Also convert current asset and convert all have shortcut buttons of F10 and F11. Be VERY careful not to mispress the F11 button while in assets manager.

Enough with the warnings, assuming everything is correct, the material should be converted properly!

Now let's port our model itself!

In small the top left list of the asset types. scroll to the xmodel asset and select that. Click NEW ENTRY
and now the name is totally up to you given you use a valid name without special characters or spaces.
The name you will put here is the name that the model will have in radiant for example.
Let's say com_table_custom_model_test
Click OK and now we have a new xmodel asset ready to be ported. 

On the right setting list you must put some options and paths before we convert.

In the type you put rigid if it's a static model and animated if it's a character model.
Filename: Here you put the xmodel_export file of our model that we put under our cod4 directory as explained  above.

Now most models have LOD distance models the one that ends with LOD0 is the highest detail one.You put that first in the file name. If there are more you put the rest one by one in the next filename browsing fields.
So the sequence would go something like this:
LOD0, LOD1, LOD2, LOD3.

Also the lod distance options MUST be put IF there are LOD models assigned other than the first one.

Under each filename there is lod distancing, that distance is the distance in game units(inches) where the lod model will stop having effect and then the next mod model will take its place.

I'll explain what we do in steps to make it less confusing.

In the case we do have LOD models.

We put in the firts filename the LOD0 file.
Then under it in the HighLodDist we put let's say 600.

Then in Medium LOD file we put the LOD1 model file.
Then under it in the MediumLodDist we put let's say 1200. 

Then in Low LOD file we put the LOD2 model file.
Then under it in the LowLodDist we put let's say 1800. 

Then in Lowest LOD file we put the LOD3 model file.
Then under it in the LowestLodDist we put 0 because the model will be visible in all distances.

LOD distancing can differ and can be rather important in some models but I do not have a clear guide on how to tell the right distance.

Finally, the COLLISION_LOD option must be in HIGH if we want bullet impacts on it.

We are ready to convert! Go to the top Menu bar. Click PC Convert and carefully click Current asset only.

Or just carefully press F10.

Also save your GDT File often so we won't lose any options. (File>Save)

If everything is right, the model is converted and ready to be used with the mod tools!!!

I hope this long and exhausting guide was very useful.

-SPi

Latest Syndicated News

»
Codutility.com up and runn...
Nice, and there still using the logo and template for the screenshots, which...
Codutility.com up and runn...
dundy writes...Quote:Call of Duty modding and mapping is barly alive only a ...
Codutility.com up and runn...
Mystic writes...Quote:It seems to me the like the site is completely dead? ...
Codutility.com up and runn...
It seems to me the like the site is completely dead?

Partners & Friends

»