814 lines
39 KiB
HTML
814 lines
39 KiB
HTML
<html xmlns:o="urn:schemas-microsoft-com:office:office"
|
||
xmlns:w="urn:schemas-microsoft-com:office:word"
|
||
xmlns:st1="urn:schemas-microsoft-com:office:smarttags"
|
||
xmlns="http://www.w3.org/TR/REC-html40">
|
||
|
||
<head>
|
||
<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
|
||
<meta name=ProgId content=Word.Document>
|
||
<meta name=Generator content="Microsoft Word 11">
|
||
<meta name=Originator content="Microsoft Word 11">
|
||
<link rel=File-List href="index_files/filelist.xml">
|
||
<title>Models and Animations in the CoD2 Engine</title>
|
||
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
|
||
name="City"/>
|
||
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
|
||
name="place"/>
|
||
<!--[if gte mso 9]><xml>
|
||
<o:DocumentProperties>
|
||
<o:Author>ericp</o:Author>
|
||
<o:LastAuthor>ericp</o:LastAuthor>
|
||
<o:Revision>6</o:Revision>
|
||
<o:TotalTime>1755</o:TotalTime>
|
||
<o:Created>2006-01-26T02:57:00Z</o:Created>
|
||
<o:LastSaved>2006-01-27T22:24:00Z</o:LastSaved>
|
||
<o:Pages>1</o:Pages>
|
||
<o:Words>2592</o:Words>
|
||
<o:Characters>14775</o:Characters>
|
||
<o:Company>Infinity Ward</o:Company>
|
||
<o:Lines>123</o:Lines>
|
||
<o:Paragraphs>34</o:Paragraphs>
|
||
<o:CharactersWithSpaces>17333</o:CharactersWithSpaces>
|
||
<o:Version>11.5606</o:Version>
|
||
</o:DocumentProperties>
|
||
</xml><![endif]--><!--[if gte mso 9]><xml>
|
||
<w:WordDocument>
|
||
<w:SpellingState>Clean</w:SpellingState>
|
||
<w:GrammarState>Clean</w:GrammarState>
|
||
<w:ValidateAgainstSchemas/>
|
||
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
|
||
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
|
||
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
|
||
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
|
||
</w:WordDocument>
|
||
</xml><![endif]--><!--[if gte mso 9]><xml>
|
||
<w:LatentStyles DefLockedState="false" LatentStyleCount="156">
|
||
</w:LatentStyles>
|
||
</xml><![endif]--><!--[if !mso]><object
|
||
classid="clsid:38481807-CA0E-42D2-BF39-B33AF135CC4D" id=ieooui></object>
|
||
<style>
|
||
st1\:*{behavior:url(#ieooui) }
|
||
</style>
|
||
<![endif]-->
|
||
<style>
|
||
<!--
|
||
/* Style Definitions */
|
||
p.MsoNormal, li.MsoNormal, div.MsoNormal
|
||
{mso-style-parent:"";
|
||
margin:0in;
|
||
margin-bottom:.0001pt;
|
||
mso-pagination:widow-orphan;
|
||
font-size:12.0pt;
|
||
font-family:"Times New Roman";
|
||
mso-fareast-font-family:"Times New Roman";}
|
||
h1
|
||
{margin-top:12.0pt;
|
||
margin-right:0in;
|
||
margin-bottom:3.0pt;
|
||
margin-left:0in;
|
||
mso-pagination:widow-orphan;
|
||
page-break-after:avoid;
|
||
mso-outline-level:1;
|
||
font-size:20.0pt;
|
||
font-family:Arial;}
|
||
h2
|
||
{margin-top:12.0pt;
|
||
margin-right:0in;
|
||
margin-bottom:6.0pt;
|
||
margin-left:0in;
|
||
mso-pagination:widow-orphan;
|
||
page-break-after:avoid;
|
||
mso-outline-level:2;
|
||
font-size:14.0pt;
|
||
font-family:Arial;
|
||
font-style:italic;}
|
||
h3
|
||
{margin-top:12.0pt;
|
||
margin-right:0in;
|
||
margin-bottom:9.0pt;
|
||
margin-left:0in;
|
||
mso-pagination:widow-orphan;
|
||
page-break-after:avoid;
|
||
mso-outline-level:3;
|
||
font-size:12.0pt;
|
||
font-family:Arial;}
|
||
span.SpellE
|
||
{mso-style-name:"";
|
||
mso-spl-e:yes;}
|
||
span.GramE
|
||
{mso-style-name:"";
|
||
mso-gram-e:yes;}
|
||
@page Section1
|
||
{size:8.5in 11.0in;
|
||
margin:1.0in 1.25in 1.0in 1.25in;
|
||
mso-header-margin:.5in;
|
||
mso-footer-margin:.5in;
|
||
mso-paper-source:0;}
|
||
div.Section1
|
||
{page:Section1;}
|
||
/* List Definitions */
|
||
@list l0
|
||
{mso-list-id:1645967867;
|
||
mso-list-type:hybrid;
|
||
mso-list-template-ids:-695587974 314374732 67698691 67698693 67698689 67698691 67698693 67698689 67698691 67698693;}
|
||
@list l0:level1
|
||
{mso-level-start-at:0;
|
||
mso-level-number-format:bullet;
|
||
mso-level-text:-;
|
||
mso-level-tab-stop:.5in;
|
||
mso-level-number-position:left;
|
||
text-indent:-.25in;
|
||
font-family:"Courier New";
|
||
mso-fareast-font-family:"Times New Roman";}
|
||
@list l0:level2
|
||
{mso-level-tab-stop:1.0in;
|
||
mso-level-number-position:left;
|
||
text-indent:-.25in;}
|
||
@list l0:level3
|
||
{mso-level-tab-stop:1.5in;
|
||
mso-level-number-position:left;
|
||
text-indent:-.25in;}
|
||
@list l0:level4
|
||
{mso-level-tab-stop:2.0in;
|
||
mso-level-number-position:left;
|
||
text-indent:-.25in;}
|
||
@list l0:level5
|
||
{mso-level-tab-stop:2.5in;
|
||
mso-level-number-position:left;
|
||
text-indent:-.25in;}
|
||
@list l0:level6
|
||
{mso-level-tab-stop:3.0in;
|
||
mso-level-number-position:left;
|
||
text-indent:-.25in;}
|
||
@list l0:level7
|
||
{mso-level-tab-stop:3.5in;
|
||
mso-level-number-position:left;
|
||
text-indent:-.25in;}
|
||
@list l0:level8
|
||
{mso-level-tab-stop:4.0in;
|
||
mso-level-number-position:left;
|
||
text-indent:-.25in;}
|
||
@list l0:level9
|
||
{mso-level-tab-stop:4.5in;
|
||
mso-level-number-position:left;
|
||
text-indent:-.25in;}
|
||
ol
|
||
{margin-bottom:0in;}
|
||
ul
|
||
{margin-bottom:0in;}
|
||
-->
|
||
</style>
|
||
<!--[if gte mso 10]>
|
||
<style>
|
||
/* Style Definitions */
|
||
table.MsoNormalTable
|
||
{mso-style-name:"Table Normal";
|
||
mso-tstyle-rowband-size:0;
|
||
mso-tstyle-colband-size:0;
|
||
mso-style-noshow:yes;
|
||
mso-style-parent:"";
|
||
mso-padding-alt:0in 5.4pt 0in 5.4pt;
|
||
mso-para-margin:0in;
|
||
mso-para-margin-bottom:.0001pt;
|
||
mso-pagination:widow-orphan;
|
||
font-size:10.0pt;
|
||
font-family:"Times New Roman";
|
||
mso-ansi-language:#0400;
|
||
mso-fareast-language:#0400;
|
||
mso-bidi-language:#0400;}
|
||
</style>
|
||
<![endif]-->
|
||
</head>
|
||
|
||
<body lang=EN-US style='tab-interval:.5in'>
|
||
|
||
<div class=Section1>
|
||
|
||
<h1>Models and Animations in the CoD2 Engine</h1>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<h2>Setting up the <span class=SpellE>maya.env</span> and <span class=SpellE>usersetup.mel</span>
|
||
files on your computer</h2>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in'><span
|
||
style='font-family:"Courier New"'>-</span><span style='font-size:7.0pt'>
|
||
</span>To start off, you need to set up the <span class=SpellE>usersetup.mel</span>
|
||
and <span class=SpellE>maya.env</span> files so Maya can find our tools.
|
||
The files included have already been set up to work with our pipeline.
|
||
The <span class=SpellE>maya.env</span> file creates the environment variables
|
||
to point to the locations of <span class=SpellE>plugins</span> and scripts
|
||
located in the tree, and should be put in 'My Documents\maya\6.0'.
|
||
Example <span class=GramE>paths<span style='mso-spacerun:yes'><EFBFBD> </span>are</span>
|
||
'MAYA_SCRIPT_PATH = C:/Program Files/Activision/Call of Duty 2/bin/maya' &
|
||
'MAYA_PLUG_IN_PATH = C:/Program Files/Activision/Call of Duty
|
||
2/bin/maya'. These will tell Maya to look here for our <span
|
||
class=SpellE>plugins</span> and scripts.</p>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in'><span
|
||
style='font-family:"Courier New"'>-</span><span style='font-size:7.0pt'>
|
||
</span>The <span class=SpellE>usersetup.mel</span> file will tell Maya what to
|
||
add on startup of Maya. This invokes the startup of our 'COD Tools' menu.</p>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<h2>Setting up, skinning and exporting a character model</h2>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in'><span
|
||
style='font-family:"Courier New"'>-</span><span style='font-size:7.0pt'>
|
||
</span>The first stage of getting a character into the game is to bind the
|
||
character<EFBFBD>s body to the <span class=SpellE>DefMesh</span> skeleton. The <span
|
||
class=SpellE>DefMesh</span> skeleton is the basic rig that will be ultimately
|
||
exported into the game, and is included within the <span class=SpellE>Josh_DefMesh</span>
|
||
character.<span style='mso-spacerun:yes'><EFBFBD> </span>The Josh character is a good
|
||
example of how one should bind the model to the skeleton.</p>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<h3>Our conventions</h3>
|
||
|
||
<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in'><span
|
||
style='font-family:"Courier New"'>-</span><span style='font-size:7.0pt'>
|
||
</span>Our character models are usually rigged on the <span class=SpellE>DefMesh</span>
|
||
skeleton in 3 different parts: the body, head, and helmet. This is done
|
||
so that characters parts may be interchangeable. This usually means that
|
||
you want to rig the character or characters bodies <span class=SpellE>LOD's</span>
|
||
into one Maya file, and the heads into a separate Maya file.<span
|
||
style='mso-spacerun:yes'><EFBFBD> </span>You can also export the model as one full
|
||
mesh if you<6F>d like, but you will not be able to make unique characters out of
|
||
any part of your model that was exported as one full mesh.</p>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in'><span
|
||
style='font-family:"Courier New"'>-</span><span style='font-size:7.0pt'>
|
||
</span>We generally make 4 levels of detail for each character, at 8,000,
|
||
4,000, 1,000 and 300 triangles. We name the parts for each <span
|
||
class=SpellE>LoD</span>, _8k, _4k, _1k and _300.</p>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l0 level1 lfo2;
|
||
tab-stops:list .5in'><![if !supportLists]><span style='font-family:"Courier New";
|
||
mso-fareast-font-family:"Courier New"'><span style='mso-list:Ignore'>-<span
|
||
style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]>In
|
||
all our Maya scenes, Z is up. </p>
|
||
|
||
<p class=MsoNormal><o:p> </o:p></p>
|
||
|
||
<h3><o:p> </o:p></h3>
|
||
|
||
<h3>Rigging</h3>
|
||
|
||
<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in'><span
|
||
style='font-family:"Courier New"'><o:p> </o:p></span></p>
|
||
|
||
<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l0 level1 lfo2;
|
||
tab-stops:list .5in'><![if !supportLists]><span style='font-family:"Courier New";
|
||
mso-fareast-font-family:"Courier New"'><span style='mso-list:Ignore'>-<span
|
||
style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]>You
|
||
may decide to position the joints to fit the character<65>s mouth, eyes, and other
|
||
areas.<span style='mso-spacerun:yes'><EFBFBD> </span>If you decide to move the joints
|
||
in the face, or any other part of the body, you must animate with the provided <span
|
||
class=SpellE>Josh_DefMesh</span> characters skeleton positions.<span
|
||
style='mso-spacerun:yes'><EFBFBD> </span>The reason being is that the provided <span
|
||
class=SpellE>base_character.XMODEL</span> uses the Josh character.</p>
|
||
|
||
<p class=MsoNormal><o:p> </o:p></p>
|
||
|
||
<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l0 level1 lfo2;
|
||
tab-stops:list .5in'><![if !supportLists]><span style='font-family:"Courier New";
|
||
mso-fareast-font-family:"Courier New"'><span style='mso-list:Ignore'>-<span
|
||
style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]>After
|
||
positioning the joints into the correct places, bind all of the facial joints, <span
|
||
class=SpellE>J_Head</span>, <span class=SpellE>J_Neck</span>, and J_Spine4
|
||
joints to the facial geometry.</p>
|
||
|
||
<p class=MsoNormal><o:p> </o:p></p>
|
||
|
||
<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l0 level1 lfo2;
|
||
tab-stops:list .5in'><![if !supportLists]><span style='font-family:"Courier New";
|
||
mso-fareast-font-family:"Courier New"'><span style='mso-list:Ignore'>-<span
|
||
style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]>Skinning
|
||
the body uses pretty much the same procedures as the head, except there are no
|
||
adjustments to joint positions per character on the body. Therefore, you
|
||
are able to put multiple unique bodies and their <span class=SpellE>LOD's</span>
|
||
into the same Maya file, which can work well for editing and copying weights.</p>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in'><span
|
||
style='font-family:"Courier New"'>-</span><span style='font-size:7.0pt'>
|
||
</span>To export the model, go to 'COD Tools->Model Exporter' in the
|
||
menu. Click 'Add New Entry' to create a new list to add to for each
|
||
LOD. Here is where you can designate where the .<span class=SpellE>xmodel_export</span>
|
||
files will be exported to. You should export all of your models to
|
||
subdirectories in 'C<span class=GramE>:/</span>Program Files/Activision/Call of
|
||
Duty 2/xmodel_export/*. Force Export Selected Joints must be checked if
|
||
you are exporting <span class=SpellE>animatable</span> models (like a
|
||
character<EFBFBD>s head). You also must set the meshes and joints that will be
|
||
exported. To do this, you can either manually select the joints that are
|
||
used in the <span class=SpellE>skinClusters</span> of the head or full <span
|
||
class=SpellE>charater</span>, or you can use a script called '<span
|
||
class=SpellE>selectBound</span>' that is included. To use the script,
|
||
first select all of the pieces of the highest LOD, and type <span class=SpellE>selectBound</span>
|
||
in the command line. This will remove any unused influences from the <span
|
||
class=SpellE>skinClusters</span>, and will then return and select all of the
|
||
joints that are used within the selected objects. The script will also
|
||
add extra joints like TAG_ joints where needed. After you have the
|
||
highest <span class=SpellE>LOD's</span> bones selected, Shift select the
|
||
highest <span class=SpellE>LOD's</span> top group and then set exports.
|
||
After that, you can deselect the 8k group, and <span class=GramE>shift select</span>
|
||
the 4k group and set exports. Do this for the rest of the <span
|
||
class=SpellE>LOD's</span>. In our engine, even if the lowest LOD is only
|
||
using 4 joints (which we do when skinning to save in calculation), you must
|
||
still include all of the joints of the highest LOD in the
|
||
Exports. </p>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<h3>Materials</h3>
|
||
|
||
<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in'><span
|
||
style='font-family:"Courier New"'>-</span><span style='font-size:7.0pt'>
|
||
</span>By default, the game engine uses the material name you use in
|
||
Maya. It does not use the actual image file you use in Maya, just the
|
||
name of the material. Give your material a good name - we use the prefix
|
||
<EFBFBD><span class=SpellE>mtl</span>_<EFBFBD>, followed by the model name for almost all
|
||
materials on our models, which makes our lives much easier. Once you<6F>ve
|
||
exported your model, you<6F>ll need to create a material with that name in Asset
|
||
Manager (covered later).</p>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<h2>Creating a Rig</h2>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in'><span
|
||
style='font-family:"Courier New"'>-</span><span style='font-size:7.0pt'>
|
||
</span>To start off, our main character that we do all animation exports from
|
||
is the <span class=SpellE>Josh_DefMesh_Rig</span>. The reason we must use
|
||
<span class=SpellE>Josh_DefMesh_Rig</span> to export all animations is because
|
||
the '<span class=SpellE>base_character</span>' that we assign for almost all
|
||
animations is using his character as a reference. Often though, we create
|
||
other <span class=SpellE>animatable</span> _Rig characters that can be used to
|
||
animate with until export time.</p>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in'><span
|
||
style='font-family:"Courier New"'>-</span><span style='font-size:7.0pt'>
|
||
</span>To create a new Rig character for animating with, start by creating a
|
||
new Maya file.<span style='mso-spacerun:yes'><EFBFBD> </span>Next, create a reference
|
||
using namespaces and set the type to <20>this <span class=GramE>string:<3A>.</span> <span
|
||
style='mso-spacerun:yes'><EFBFBD></span>Make a new prefix name (i.e. <20>rig<69>) and
|
||
reference in the <span class=SpellE>Josh_DefMesh</span> character.<span
|
||
style='mso-spacerun:yes'><EFBFBD> </span>From here you can build animation controls
|
||
onto the character to <span class=GramE>animated</span> with.<span
|
||
style='mso-spacerun:yes'><EFBFBD> </span>You may also decide to just build the
|
||
animation controls onto the <span class=SpellE>Josh_DefMesh.mb</span> file, but
|
||
you still MUST create a new reference file before you are to export any
|
||
animations.</p>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<h2>Working with and exporting animations</h2>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in'><span
|
||
style='font-family:"Courier New"'>-</span><span style='font-size:7.0pt'>
|
||
</span>Depending on the animation, you may need to add a '<span class=SpellE>Notetrack</span>'
|
||
to specify when certain actions occur that have to be noted for scripting
|
||
purposes. <span class=SpellE>Notetracks</span> associate a word or phrase
|
||
with a frame of the animation, and can be detected by the game script at run
|
||
time. An example of this would be to specify when the sound file for
|
||
dialog should be played. To do this, you can create a <span class=SpellE>notetrack</span>
|
||
using the tool located under 'COD Tools-><span class=SpellE>Notetrack</span>
|
||
Window'. You would then 'Create Note Track node' on the frame at the
|
||
beginning of the dialog.</p>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in'><span
|
||
style='font-family:"Courier New"'>-</span><span style='font-size:7.0pt'>
|
||
</span>Once all of your animation is complete and you are ready to export your
|
||
animation, go to 'COD Tools->Animation Exporter' in the menu. Here is
|
||
where you can designate where the .<span class=SpellE>xanim_export</span> file
|
||
will be exported to. You should export all of your animations to
|
||
subdirectories of 'C<span class=GramE>:/</span>Program Files/Activision/Call of
|
||
Duty 2/xanim_export/*', or where the game has been installed.</p>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in'><span
|
||
style='font-family:"Courier New"'>-</span><span style='font-size:7.0pt'>
|
||
</span>You need to set the start and end frames of the animation, and the
|
||
joints that are used in the animation. If you click on the 'Export Nodes'
|
||
button, you will notice it will bring up a window that will ask you which
|
||
character (designated by its prefix) you would like to set for exports.
|
||
This button will then set the full set of joints for exporting for the
|
||
particular character. Sometimes you may want to only select the head
|
||
joints or the upper torso joints for export. In this case, you must
|
||
select them manually and set those for export.</p>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in'><span
|
||
style='font-family:"Courier New"'>-</span><span style='font-size:7.0pt'>
|
||
</span>If your animation uses a note track, you<6F>ll need to tell the
|
||
exporter. Click on the <20><span class=SpellE>notetrack</span><EFBFBD> button in
|
||
the animation exporter window, and a dialog will pop up asking you which <span
|
||
class=SpellE>notetrack</span> the animation uses.</p>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<h2>Asset Manager</h2>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in'><span
|
||
style='font-family:"Courier New"'>-</span><span style='font-size:7.0pt'>
|
||
</span>Asset Manager (<span class=SpellE>AssMan</span> for short) is a little
|
||
program that helps us edit all our game data files (.<span class=SpellE><span
|
||
class=GramE>gdt<EFBFBD>s</span></span>). <span class=SpellE>GDT<EFBFBD>s</span> control
|
||
how Maya models become game models, how materials and animations associate with
|
||
models and how normal maps are associated with color maps. They also
|
||
control a whole host of other, less-art-specific things, like how weapons
|
||
behave and what guns each AI uses.</p>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<h3>Models</h3>
|
||
|
||
<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l0 level1 lfo2;
|
||
tab-stops:list .5in'><![if !supportLists]><span style='font-family:"Courier New";
|
||
mso-fareast-font-family:"Courier New"'><span style='mso-list:Ignore'>-<span
|
||
style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]>Click
|
||
on <20><span class=SpellE>xmodel</span><EFBFBD> <span class=GramE>and<span
|
||
style='mso-spacerun:yes'><EFBFBD> </span>click</span> on the <20>New Entry<72> button and
|
||
specify a unique name for your model that is less than 40 characters.<span
|
||
style='mso-spacerun:yes'><EFBFBD> </span>You<EFBFBD>ll now see a list that appears on the
|
||
right hand side.<span style='mso-spacerun:yes'><EFBFBD> </span>For static models, you
|
||
set the type to <20>rigid<69>.<span style='mso-spacerun:yes'><EFBFBD> </span>For animated
|
||
models, you use <20>animated<65>.<span style='mso-spacerun:yes'><EFBFBD> </span>In the
|
||
filename box below is where you specify the <span class=SpellE>xmodel_export</span>
|
||
filename for the highest LOD of your model.<span style='mso-spacerun:yes'><EFBFBD>
|
||
</span>In the <span class=SpellE>highLodDist</span> selection box, specify the
|
||
distance that the game should use for the highest LOD.<span
|
||
style='mso-spacerun:yes'><EFBFBD> </span>From here, specify the <span class=SpellE>mediumLod</span>,
|
||
<span class=SpellE>lowLod</span>, and <span class=SpellE>lowestLod</span> <span
|
||
class=SpellE>xmodel_exports</span> and their corresponding LOD distances.<span
|
||
style='mso-spacerun:yes'><EFBFBD> </span></p>
|
||
|
||
<p class=MsoNormal style='margin-left:.25in'><o:p> </o:p></p>
|
||
|
||
<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l0 level1 lfo2;
|
||
tab-stops:list .5in'><![if !supportLists]><span style='font-family:"Courier New";
|
||
mso-fareast-font-family:"Courier New"'><span style='mso-list:Ignore'>-<span
|
||
style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]>On
|
||
character models, you<6F>ll want to specify the <span class=SpellE>hitBoxModel</span>,
|
||
which is included in the bin/<span class=SpellE>maya</span> directory.</p>
|
||
|
||
<p class=MsoNormal><o:p> </o:p></p>
|
||
|
||
<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l0 level1 lfo2;
|
||
tab-stops:list .5in'><![if !supportLists]><span style='font-family:"Courier New";
|
||
mso-fareast-font-family:"Courier New"'><span style='mso-list:Ignore'>-<span
|
||
style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]>In
|
||
<span class=SpellE>AssMan</span>, you have the ability to make a group of models
|
||
to be randomly selected within the game by giving that group a name of <span
|
||
class=GramE>it<EFBFBD>s</span> own.<span style='mso-spacerun:yes'><EFBFBD> </span>Groups of
|
||
model types to be interchanged between characters.<span
|
||
style='mso-spacerun:yes'><EFBFBD> </span>For instance, you could create an <span
|
||
class=SpellE>xmodelalias</span> for a handful of head models.<span
|
||
style='mso-spacerun:yes'><EFBFBD> </span>To do this, you would create a unique name
|
||
for the <span class=SpellE>xmodelalias</span>, and then assign head models you
|
||
made as <span class=SpellE>xmodels</span> and put their names in these fields.</p>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<h3>Materials</h3>
|
||
|
||
<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in;mso-list:l0 level1 lfo2;
|
||
tab-stops:list .5in'><![if !supportLists]><span style='font-family:"Courier New";
|
||
mso-fareast-font-family:"Courier New"'><span style='mso-list:Ignore'>-<span
|
||
style='font:7.0pt "Times New Roman"'> </span></span></span><![endif]>Click
|
||
on <20>material<61> and click on the <20>New Entry<72> button and specify a unique name for
|
||
your model that is less than 40 characters.<span style='mso-spacerun:yes'><EFBFBD>
|
||
</span>You can see they are all the materials associated with the models in the
|
||
GDT. The main ones to edit here are first the <span class=SpellE>materialType</span>
|
||
and <span class=SpellE>surfaceType</span>, where you set these to the
|
||
corresponding types.<span style='mso-spacerun:yes'><EFBFBD> </span>The other ones to
|
||
be concerned with is the Color Map, <st1:City w:st="on"><st1:place w:st="on">Normal</st1:place></st1:City></p>
|
||
|
||
<p class=MsoNormal style='margin-left:.5in'>Map, <span class=SpellE>Specular</span>
|
||
color map, and Cosine power map fields.<span style='mso-spacerun:yes'><EFBFBD>
|
||
</span>Here you put the path of where these files are located, which should be
|
||
'C<span class=GramE>:\</span>Program Files\Activision\Call of Duty 2\xmodel_export\*<2A>
|
||
for materials associated with a model, and in <20>C:\Program Files\Activision\Call
|
||
of Duty 2\texture_source\*<2A> for world textures.<span style='mso-spacerun:yes'><EFBFBD>
|
||
</span>The rest of the entries can usually be left as default, but can aid in
|
||
the look of how the materials are displayed.</p>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<h3>Animations</h3>
|
||
|
||
<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in'><span
|
||
style='font-family:"Courier New"'>-</span><span style='font-size:7.0pt'>
|
||
</span>Click on <20><span class=SpellE>xanim</span><EFBFBD> and click on the <20>New Entry<72>
|
||
button and specify a unique name for your model that is less than 40
|
||
characters.<span style='mso-spacerun:yes'><EFBFBD> </span>Animation <span
|
||
class=SpellE>GDT<EFBFBD>s</span> should be <span class=GramE>saved<span
|
||
style='mso-spacerun:yes'><EFBFBD> </span>in</span> 'C:\Program Files\Activision\Call
|
||
of Duty 2\xanim_export\*<2A>.</p>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in'><span
|
||
style='font-family:"Courier New"'>-</span><span style='font-size:7.0pt'>
|
||
</span>The first option in the right is <20>filename<6D>, which is the <span
|
||
class=SpellE>xanim_export</span> file for the animation. </p>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in'><span
|
||
style='font-family:"Courier New"'>-</span><span style='font-size:7.0pt'>
|
||
</span>The second option is <20>model<65>, which can be confusing at first. We
|
||
associate every animation with a model, which establishes the base pose and
|
||
proportions that the animation is diverging from. We also get all
|
||
hierarchy information from the model. Also, any joints that are in the
|
||
animation but not in the model will be stripped from the animation. We
|
||
made a special model file called <20><span class=SpellE>Base_character</span><EFBFBD> for
|
||
our full-body character animations. It<49>s basically just a copy of our
|
||
Josh model, but we called it <span class=SpellE>base_character</span> to make
|
||
it easy to find.</p>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in'><span
|
||
style='font-family:"Courier New"'>-</span><span style='font-size:7.0pt'>
|
||
</span>The third option is <20>looping<6E> <20> whether or not the animation is
|
||
looping. When you set this, the last frame of the animation is assumed to
|
||
be the same as the first, and is deleted by converter.</p>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in'><span
|
||
style='font-family:"Courier New"'>-</span><span style='font-size:7.0pt'>
|
||
</span><EFBFBD>Type<EFBFBD> is generally set to <20>delta<74> for full-body character
|
||
animations. Delta uses the root joint of the model to determine how far
|
||
the model moves each frame. In <20>delta<74> animations, it<69>s essential that
|
||
the root bone always remain upright (the Z axis of the bone faces along Maya<79>s
|
||
Z axis, or the Z axis of the <20>node<64> if a node is specified in the next
|
||
point). Type <20>relative<76> treats the root joint of the model (or the joint
|
||
in the animation that is highest in the model<65>s hierarchy) as the origin, and
|
||
animates the other joints relative to that. Type <20>absolute<74> treats the
|
||
origin of your Maya scene as the origin and moves all the joints relative to
|
||
that. The <20>mp_<70> types are used only for MP animations.</p>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in'><span
|
||
style='font-family:"Courier New"'>-</span><span style='font-size:7.0pt'>
|
||
</span><EFBFBD>Node<EFBFBD> is only used with <20>type<70>=<3D>delta<74> animations. The node is a
|
||
very powerful feature that enables us to line up scripted animations
|
||
perfectly. Export a joint or object with your animation from Maya, and
|
||
enter its name here. When the designer plays your animation in script, he
|
||
or she can specify a node for the animation to be based off, and the engine
|
||
will move the animation so that the node in your Maya file lines up with the
|
||
node in the game. Thus you could create a complex animation of several
|
||
people interacting, based around some point on the floor, and you don<6F>t have to
|
||
worry about compounding errors making your characters drift apart or through
|
||
each other.</p>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in'><span
|
||
style='font-family:"Courier New"'>-</span><span style='font-size:7.0pt'>
|
||
</span><EFBFBD><span class=SpellE>angleError</span><EFBFBD> and <20><span class=SpellE>translationError</span><EFBFBD>
|
||
are the maximum errors allowed when compressing the animation. Larger
|
||
numbers make smaller files, smaller numbers make perfect animation. The
|
||
defaults (0.05 and 0.025) result in no noticeable compression artifacts that
|
||
we<EFBFBD>ve noticed.</p>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in'><span
|
||
style='font-family:"Courier New"'>-</span><span style='font-size:7.0pt'>
|
||
</span><EFBFBD><span class=SpellE>boneStabilizers</span><EFBFBD> is old, and something to do
|
||
with multiplayer. I doubt you<6F>ll need it. </p>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<h2>Converting models and animations</h2>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in'><span
|
||
style='font-family:"Courier New"'>-</span><span style='font-size:7.0pt'>
|
||
</span>After exporting your models or animations and adding them to <span
|
||
class=SpellE>AssMan</span>, you need to convert the text files into files the
|
||
game engine reads. To do this, execute converter, located at <20>C:\Program Files\Activision\Call
|
||
of Duty 2\bin\converter.exe<78>. This will convert all files that have been
|
||
changed. Converter endeavors to find every possible error in your models,
|
||
materials and animations so that we don<6F>t have any surprises in the game, so
|
||
you may have to go back and fix problems in Maya or <span class=SpellE>AssMan</span>
|
||
in order to get converter to finish with no errors.</p>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<h2>In-game <20> the console and <span class=SpellE>DevGUI</span></h2>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in'><span
|
||
style='font-family:"Courier New"'>-</span><span style='font-size:7.0pt'>
|
||
</span>To enable cheat codes, the console and the <span class=SpellE>DevGUI</span>,
|
||
you need to run the game in developer mode. The most common way to do
|
||
this is to run the game from a shortcut, and add switches to the shortcut as
|
||
follows: C:\Program Files\Activision\Call of Duty 2\CoD2SP.exe +set developer 2
|
||
+set <span class=SpellE>logfile</span> 2 +seta <span class=SpellE>thereisacow</span>
|
||
1337.</p>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in'><span
|
||
style='font-family:"Courier New"'>-</span><span style='font-size:7.0pt'>
|
||
</span>+set developer 2 enables the <span class=SpellE>DevGUI</span> and
|
||
several other development options.</p>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in'><span
|
||
style='font-family:"Courier New"'>-</span><span style='font-size:7.0pt'>
|
||
</span>+set <span class=SpellE>logfile</span> 2 makes the game print the
|
||
contents of the console to <span class=SpellE>console.log</span>, which can be
|
||
useful for tracking down missing assets or other errors.</p>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in'><span
|
||
style='font-family:"Courier New"'>-</span><span style='font-size:7.0pt'>
|
||
</span>+seta <span class=SpellE>thereisacow</span> 1337 enables cheat
|
||
codes. Seta archives the variable, so that if you run the game from a
|
||
different shortcut <span class=GramE>later,</span> cheat codes should still be
|
||
enabled.</p>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<h3>The Console</h3>
|
||
|
||
<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in'><span
|
||
style='font-family:"Courier New"'>-</span><span style='font-size:7.0pt'> </span>By
|
||
default, you can bring up the console by holding down Backspace and hitting
|
||
Home. <span class=GramE>By setting the variable <20><span class=SpellE>monkeytoy</span>
|
||
0<EFBFBD>, the console defaults to the more familiar tilde (~) key.</span> </p>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in'><span
|
||
style='font-family:"Courier New"'>-</span><span style='font-size:7.0pt'>
|
||
</span>The CoD2 console shows only one line by default. By hitting
|
||
shift-~, you can see a larger console. In many cases you don<6F>t need it
|
||
because of the auto-complete features of the CoD2 console.</p>
|
||
|
||
<p class=MsoNormal><span style='color:red'> </span></p>
|
||
|
||
<h3>The <span class=SpellE>DevGUI</span></h3>
|
||
|
||
<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in'><span
|
||
style='font-family:"Courier New"'>-</span><span style='font-size:7.0pt'>
|
||
</span>The <span class=SpellE>DevGUI</span> is an in-game tool that we are
|
||
developing to replace the console for systems without keyboards, and for people
|
||
who don<6F>t want to learn all the console commands. </p>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in'><span
|
||
style='font-family:"Courier New"'>-</span><span style='font-size:7.0pt'>
|
||
</span>Generally, we show the <span class=SpellE>DevGUI</span> in the PC game
|
||
by hitting the F1 key.</p>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in'><span
|
||
style='font-family:"Courier New"'>-</span><span style='font-size:7.0pt'>
|
||
</span>Try hitting F1. If the console doesn<73>t appear, it<69>s probably
|
||
because F1 isn<73>t bound to the <span class=SpellE>devgui</span> command.
|
||
Bring up the full console (hold down shift and hit ~, assuming that you<6F>ve set
|
||
the <span class=SpellE>monkeytoy</span> variable to 0) and type <20>bind f1<66>.
|
||
The console will probably tell you <20><>f1<66> is not bound<6E>. (If it
|
||
tells you <20><>f1<66> = <20><span class=SpellE>devgui</span><EFBFBD><EFBFBD> then you have different
|
||
problems, probably in your shortcut. You need to activate cheats and
|
||
developer commands.) <span class=GramE>Next, type <20>bind f1 <span
|
||
class=SpellE>devgui</span><EFBFBD>.</span> Now type <20>bind f1<66> again, and the console
|
||
should tell you <20><>f1<66> = <20><span class=SpellE>devgui</span><EFBFBD><EFBFBD>. Get rid of
|
||
the console (hit ~) and hit F1 again. This time the <span class=SpellE>DevGUI</span>
|
||
should appear at the top of the screen.</p>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in'><span
|
||
style='font-family:"Courier New"'>-</span><span style='font-size:7.0pt'>
|
||
</span>The <span class=SpellE>DevGUI</span> options vary depending on whether
|
||
you<EFBFBD>re in a map or not. In theory, you can use the <span class=SpellE>DevGUI</span>
|
||
for anything you might want to do, although in practice binding keys to common
|
||
commands is much faster. Navigate through the <span class=SpellE>DevGUI</span>
|
||
using the arrow keys, Enter and Esc. Some options bring up sliders, which
|
||
you alter using the arrow keys or by holding down the mouse and dragging left
|
||
and right.</p>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<h3>Testing models and animation in the game environment</h3>
|
||
|
||
<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in'><span
|
||
style='font-family:"Courier New"'>-</span><span style='font-size:7.0pt'>
|
||
</span>Load a map and hit the F1 key to open the <span class=SpellE>DevGUI</span>,
|
||
and navigate to Model <span class=SpellE>Previewer</span> using the arrow keys
|
||
and the Enter key.</p>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in'><span
|
||
style='font-family:"Courier New"'>-</span><span style='font-size:7.0pt'>
|
||
</span>The first option you<6F>ll need to use is <20>Load Model<65>. Select this
|
||
menu option and hit enter. A scroll bar appears at the bottom of the
|
||
screen. Scroll through entries using the arrow keys, or by holding down
|
||
the mouse button and dragging left and right. Once you have selected the
|
||
model you want to load, hit enter.</p>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in'><span
|
||
style='font-family:"Courier New"'>-</span><span style='font-size:7.0pt'>
|
||
</span>The controls to maneuver around are similar to Maya<79>s navigational
|
||
tools. Use W and E to switch to move or rotate mode. Hold down Alt
|
||
and use different mouse buttons to move the camera. Note that in rotate
|
||
mode, holding down the right mouse button will rotate the model on its vertical
|
||
axis.</p>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in'><span
|
||
style='font-family:"Courier New"'>-</span><span style='font-size:7.0pt'>
|
||
</span>A very useful feature of the <span class=SpellE>DevGUI</span> (for
|
||
artists) is the ability to turn various textures on and off. If you go to
|
||
<span class=SpellE>Renderer</span> -> Texture Override, you can mess with
|
||
the light map, normal map, color map and spec map. If you<6F>re technical,
|
||
you can also glean some information from the debug <span class=SpellE>shaders</span>,
|
||
<span class=GramE>which</span> might help debug lighting anomalies due to
|
||
messed up <span class=SpellE>normals</span>.</p>
|
||
|
||
<p class=MsoNormal> </p>
|
||
|
||
<p class=MsoNormal style='margin-left:.5in;text-indent:-.25in'><span
|
||
style='font-family:"Courier New"'>-</span><span style='font-size:7.0pt'>
|
||
</span>You can also apply animations to the model, using the animation <span
|
||
class=SpellE>previewer</span>. To be frank though, the animation <span
|
||
class=SpellE>previewer</span> isn<73>t done, and it<69>s not easy to use. It
|
||
can be useful if an animation doesn<73>t work, and you want to debug it, but for
|
||
general testing you<6F>re much better off scripting the animation to play in a
|
||
level.</p>
|
||
|
||
</div>
|
||
|
||
</body>
|
||
|
||
</html>
|