All of the models in
Models should be created using polygons.á There are limits on the number of polygons of
a particular model depending on the function and necessary detail level of that
model.áá In
Textures can be created using any digital painting tool and
should have dimensions that are a power of 2 pixels in length (à64,128,256,
512à).á Model textures are generally kept
square, but rectangular shaped textures are ok as long as the dimensions fill
this requirement.á A Photoshop plugin is included to allow creation of LithtechÆs
DTX texture format.á In addition, plugins for Maya and Max are included to allow the use of
DTX textures (Maya: IMFLithDTX.dll, MAX: MaxDTXLoader40.bmi).á A model can theoretically have up to 16
textures, but each part of the model using a different texture needs to be
separated into a unique piece.á A model
can be made up of as many as 64 separate pieces, but keeping as few as possible
is desirable to avoid slowing model rendering down.á Most
After creating the
model and textures, the model geometry is bound to a skeleton.á In Maya, this consists of a hierarchy of one
or more joints.á All Maya models should
be attached to skeletons using æsmooth bindÆ in the Skin menu.á By default, the exporter will only export
joints that are bound to geometry, or the parents of such joints.á In some cases it is necessary have other joints
in the hierarchy exported.á This is done
by creating a Boolean attribute called æForcedNodeÆ
on the joint and setting its value to 1.á
Every exported model must have at least one joint.á Inanimate models, such as lamps, chairs, etc.
will need only one joint.á Most
ááááááááááá
To use the exporter plugin in
Maya, place the file æMayaModelExport40.mllÆ in the Maya bin\plugins\ folder and the file æLithTechModelExportOptions.melÆ
in the Maya scripts\others\ folder.á Make
sure the plugin is loaded in MayaÆs Plugin Manager window.á
The exporter plugin exports a text
version of the Lithtech file format, æ.ltaÆ.á It will also
export a compressed version, æ.ltcÆ, to save disk space.á The format should be specified in the
filename supplied to the plugin.áá The exporter uses the command line format:
lithtechModelExport ûall [-usePlaybackRange <bool> -append <bool> -ignoreBindPose <bool> -exportWorldNode <bool>
-scale <float>]
<animation name> <file name>
The optional flags are defined as follows:
ááááááááááá á
╖ file name û this should contain the entire path to the desired file.á The format should be either æ.ltaÆ, or æ.ltcö.á
The exporter will use these options to decide which
skeleton(s) should be exported, and will include all visible geometry bound to
it.
The concept of æchild modelsÆ was used for most characters
in
A Maya script that eases the export/model setup workflow
described here is included.á It creates
an interface to save many of the settings described here and in the next
section in a Maya scene.á It was used for
nearly all the models that were exported throughout production and is presented
here as isà it worked for me - I hope it works for others.á If nothing else it provides a starting point
for others to understand how the .lta format can be
used.á It is described mode fully in
another section.
After exporting a character model, a few things need to be
done to get it to appear in the game.á
These things are done in ModelEdit.á This tool has been around for a few years and
hasnÆt changed a lot, in spite of our workflow changing a lot.á What that means is that there are a lot of
options that probably havenÆt been used in a while and may be obsolete.áá
The new Lithtech file format
exists in two forms.á The exporter
creates a user-friendly data file (.lta or ltc), but this needs to be compiled as an ltb file for use in the engine.á An .lta file is a
text file containing all the model and animation data.á An ltc file is a
compressed version of this, and is what was used for most
There are several things that need to be set up in ModelEdit to get models working.á As an example, a fully setup character,
Game\Chars\Models\Character_Sample..lta, has been
provided that is the exported version of the Maya scene Character_Sample.mb.á
The
most basic thing that needs to be set on models is the User Dims.á This is basically a bounding box for each
model.á To see this box in ModelEdit, select æOptions > Show User DimensionsÆ.á By default the dims are a long box.á This needs to be changed to more closely
match the size of the model.á This can be
done either by adjusting the æ+Æ and æ-æ buttons in the æAnimation EditÆ
section of ModelEdit or by selecting æAnimation >
DimensionsàÆ and entering appropriate values.á
One thing to know about user dims is that the X value must always equal
the Z value.á If not the engine will pick
one and apply it to both, producing strange results.á Another thing to notice is that user dims can
be set per animation.á To avoid possible
timing issues with changing dims, they are usually set the same for all
animations on a character.á The only
exception in
In order to render in the engine, character models need to
have several æweight setsÆ created.á
Weight Sets are used by the programmers to tell a character to play more
than one animation at a time, such as the recoil animations or the upper/lower
body blending in multiplayer.á Select
æModel > Edit Weighted Animation BlendingÆ in ModelEdit.á Weight Sets are created one at a time by
clicking the æAdd SetÆ button and entering the name.á The following sets need to be added to every
character model:á Null, Upper, Lower,
blink, twitch.á To set the Weight Sets,
select one or more nodes in the æNodesÆ window and set the appropriate value in
the æCurrent Node WeightÆ window.á (When
setting this number, donÆt press enter, as it will exit the dialogue and
frustrate you).á
Note that other than the Upper and Lower sets in multiplayer
characters, all of these can be left at zero and the models will work
fine.á The sets just need to exist for
the engine to be able to set up each character.á
Non-character models do not need weight sets.
Sockets
are created to define locations where other models or FX can be attached to
characters.á The most noticeable place
where sockets are used is in the gun hands of character models.á This is the only socket I can think of that
is necessary for a character to function properly.á This socket must be named æRightHandÆ, but can be attached to any node in the model
(for example, the laser shooting super soldier has a RightHand
socket attached to his Head node.)á To
create this socket in ModelEdit, select the desired
node (usually the right hand) in the Nodes window.á Then select æSockets > Add SocketàÆ,á and enter the name æRightHandÆ.á The socket will be created at the location
and orientation of itÆs parent node.á
Usually this will need to be edited.á
This is most easily done by showing attachment models in ModelEdit.á
(Unfortunately, new sockets donÆt show attachments until the model is
saved and re-opened.)á Select æOptions
> Show SocketsÆ and æOptions > Show AttachmentsÆ.á Now double click the socket name (RightHand) in the æSocketsÆ window.á In the æAttachmentÆ field of this properties
window, enter or browse to the location of an attachment model .lta file (gun, flashlightà).á Also in this window are entry boxes for
orientation, translation, and scale values.á
These are very helpful when you know exactly what they need to be, but
can be a little counterintuitive when starting from scratch since they are
based on the orientation of the parent node.á
ItÆs easier to use the æTransform EditÆ controls.á The Red, Green, and Blue boxes correspond to
the colored axes of the socket in the ModelEdit viewport.á
Translation and Rotation are usually all that is needed to position the
attachment into place.á Scale is usually
only used if an attachment that is shared among several characters needs to be
adjusted to fit onto larger (or smaller) body part.á All the sockets that you create are listed in
the æSocketsÆ window in ModelEdit.á Other important sockets that every character
should have are LeftFoot and RightFoot.á These are needed to create footprints and
accurately located footstep sounds.á
Other than this the main uses for sockets are hats, glasses, holstered
weapons.á To see how these and other
sockets are set up, examine the sample character.á Most characters have about a dozen sockets
even though many of them arenÆt used by all the characters.á This is for consistency, so no one needs to
remember which character gets which sockets.á
A socket name will not be valid unless it is appears on a list
determined by game code.á The full
available list can be seen by opening DEdit,
selecting an AI and opening the attachments property.á One other thingà the exporter plug-in allows
sockets to be created and exported from Maya.á
To do this create an object (usually a locator) and add a Boolean
attribute called æsocketsÆ and set it to æ1Æ.á
This object can be used to orient objects within Maya and may be easier
to work with than ModelEditÆs controls.
Sockets and Weight Sets are two things that are commonly imported
from similar existing models.á This can
be done by selecting æFile > ImportàÆ.á
To import only Sockets and Weight Sets, check the boxes next to those
options, and uncheck Animations.á Then
browse to a previously set up model with a matching skeleton and click
æOpenÆ.á This can save a lot of tedious
work, but some sockets may still need to be adjusted depending on the
situation.á Among the other options,
Animations can also be imported from one model to another (instead of using a
child model).á When importing Animations,
you should always import User Dims and Translations simu.ltaneously
to avoid needing to reset this information.á
The æUV CoordsÆ is no longer used.áá
Child models are added in ModelEdit
by selecting æChild Model > Add ChildModelàÆ and
browsing to the desired .lta or ltc
file.á The only requirement for a model
to be a valid child model is that the hierarchy must match exactly that of the
parent model.á A model can have as many
as 32 child models, some of which can be added in game code as needed.á Generally, only 1-3 child models are needed,
depending on the character, and they will be listed in the æChild modelsÆ
window in ModelEdit.á
If a child model has drastically different proportions than a character,
you may notice the character distorting to match those proportions.á This can be corrected by checking the box
next to the distorted nodes in ModelEditÆs Nodes
window.á This tells the engine to ignore
the translation information from the child model for this node and use only the
rotation.á In most
Setting up textures and render styles in ModelEdit
is done in the Piece Info window.á This
is accessed by highlighting a model piece in the æPiecesÆ window and selecing æPiece > Piece InfoàÆ.á This can be the most confusing part of setting
up a model.á The main things to
understand here are the Texture Indices and Render Style Index.á All of the textures and render styles
associated with a model are listed in an attribute file.á Characters are in modelbutes.txt and props
are in proptypes.txt.á Here is an example
of a Super SoldierÆs texture list:
Skin0áááááááá = "chars\skins\SSLtBody.dtx"
Skin1áááááááá = "chars\skins\SSLtHead.dtx"
Skin2áááááááá = "chars\skins\SSLtPack.dtx"
Skin3áááááááá = "chars\skins\shinyspot.dtx"
RenderStyle0á =
"RS\default.ltb"
RenderStyle1á =
"RS\envmap.ltb"
RenderStyle2á =
"RS\glass.ltb"
RenderStyle3á =
"RS\Glow.ltb"
The Texture Index refers to the Skin number in this
list.á The Render Style Index refers to
the Render Style number in this list.á For
example the æbodyÆ piece of the model will use Skin0 and RenderStyle0, so the
indices will stay at the default values of zero.á Some render styles use multiple
textures.á The only commonly used render
style like this is envmap.ltb.á An example of its use would be the Super
SoldierÆs backpack.á This uses
RenderStyle1, Skin2 as the main texture map, and Skin3 as the environment
map.á To set this up, the æNumber of
TexturesÆ option needs to be set to æ2Æ.á
Then Texture Index 0 should be set to æ2Æ (for Skin2) and Texture Index
1 should be set to æ3Æ (for Skin3Æ).á The
Render Style Index should be set to æ1Æ (for RenderStyle1).á There is also an option for æRender
PriorityÆ.á This is used to insure proper
sorting of transparent models.á All
non-transparent models should have this set to æ0Æ.á Most models using alpha transparency render
styles should have this set to æ1Æ to insure that that piece will always be
rendered properly when it is in front of an opaque piece.á Complex model setups, like ArmstrongÆs beard,
can have a wide range of render priorities to sort the pieces properly.
The last thing that needs to happen in ModelEdit
is to save and compile the model.á To
Save and Compile, select æFile > Save and CompileàÆ.á There are several options here, but only a
couple that are ever actually used.á One
is the compression type.á The default
compression type is (RLE 16) which in the case of some animations, is too much
compression.á I generally compress
unanimated models at æ(RLE 16)Æ and compress any thing with subtle animations
using æ(RLE16)PlayerViewÆ.á This difference is that with (RLE16)PlayerView, everything is compressed to 16bit except
translation which stays at 32bits.á This
basically results in smoother animations.á
The other commonly used option is æExclude Model GeometryÆ.á This can be used for any model that is
exclusively a child model and allows for really good data compression since the
geometry is simply thrown out.á The good
news about the compile window is that all the settings are saved per model, so
the only need to be set when first exported, if at all.
ááá
Here are the other most commonly used ModelEdit
functions.
ModelEdit has a number of functions to allow simple editing of animation data.á An animation cannot be edited if it is being shared from a child model.á In the æAnimationsÆ window, the animations are listed with a check mark in the box next to the name if they can be edited.á Right clicking on the name of an animation will bring up a menu with options to rename, duplicate, or delete the animation.á The animation time slider displays the keyframes of an animation as red (or green) ticks.á For editing purposes, ModelEdit allows you to ætagÆ a group of keyframes.á Keyframes can be tagged individually by double clicking the red ticks in the time slider.á This actually toggles the tagged state, so double clicking again will untag the keyframe.á Tagged keyframes will appear as blue ticks.á Groups of keyframes can be tagged by holding down the æShiftÆ key and click-dragging the mouse across the group of red ticks.á The tagged state of keyframes is not saved with the file.á Right clicking the time slider opens a menu.á Here are the useful options in this menu:
More useful functions can be found in the æAnimationÆ menu:
It is also possible to add commands to animations so that
they are executed at a desired keyframe.á This is done in ModelEdit
by setting the animation to the desired keyframe and
entering the command in the æFrame StringÆ text field (at the bottom of the ModelEdit interface).á
A keyframe that has a Frame String will appear
as a green tick in the animation timeslider, as
opposed to the default red tick.á
Multiple commands can be added to the same keyframe
by separating the commands with a semicolon.á
There are many possible commands that can be used here û pretty much any
command that can be sent to a character through triggers in the game will also
work here.á The most common ones are:
Model LODs are another confusing
part of model setup.á Since they are not
necessary, they may not be worth the trouble when experimenting.á Nevertheless, here is how they can be
imported using ModelEdit.á LOD models should first be exported as a
separate .lta file, and the pieces should be named
exactly as the pieces in the main file.á LODs are imported on a piece-by-piece basis from this
file.á In ModelEdit,
highlight the desired piece in the æPiecesÆ window and select æFile > Import
Custom LODsàÆ.á
Browse to the file containing the LOD pieces and click æOpenÆ.á A window will open containing a list of all
the pieces in that file.á Select the
appropriate piece and click æOKÆ.á Now
open the æ+Æ sign next to the piece name in the Pieces window.á It should open to two æ0.00Æ children.á HereÆs the tricky part that will be
frustrating.á One of these is the
original and the other is the LOD, but it can be difficult to guess which
one.áá Usually the top 0.00 piece is the
LOD, so highlight it and select æPiece > Piece InfoàÆ.á The Texture and Render Style information
should match the original Piece.á In the
LOD Properties section, set the Distance to a value other than 0.á This will be the distance where the original model
piece will swap with the new LOD.á This
process will need to be repeated for each piece of each LOD.á Most of the characters in
The modelÆs Command String is used to store various commands and settings used by the engine when setting up a model.á In previous versions of Lithtech, there were many commonly used commands that were placed here, but many of those are now obsolete.á The only thing the Command String is currently being used for is enabling shadows on a model.á To access the Command String in ModelEdit, select æModel > Command StringàÆ.á To turn in shadow casting simply enter ôShadowEnableö in the text field.á
ááááááááááá
A piece-merging feature was added to help optimize the
number of geometry pieces in a model.á It
will merge all pieces that share a render style and texture.á To use it highlight the desired pieces in the
æPiecesÆ window and select æPiece > Merge SelectedÆ.á This allows modelers to keep models in
separate pieces in the modeling software if desired and wait to combine them in
the exported model for optimization.á
It
is possible to have model pieces disappear when models are a certain distance
from the player.á This is done in ModelEdit by highlighting the desired piece in the æPiecesÆ
window and selecting æPiece > Create Null LODàÆ,á then enter the desired distance.á This was used as an optimization in ArmstrongÆs
beard, which mostly disappears at about 600 units.á
á
All models in the game need to be defined in an attribute
file.á Characters are defined in
æmodelbutes.txtÆ, props are defined in æproptypes.txtÆ, and attachments are
defined in æattachments.txtÆ.á There is a
not a lot that needs to be understood about these files in order to add to
them, but not following the format exactly can cause disastrous results.á For this reason, they should be modified at
your own risk, and never without first backup them up.á Most new models are created by simply cutting
and pasting new model listings from existing, similar models and changing the
number, Name, the model filename, the Skin and RenderStyle
lines.á It is very important that each
model has a unique number and name, and that each attribute file contains no
gaps in numbers (example: a file that contains [Model56] and [Model58], but not
[Model57] will crash the game.á Also, a
file that contains two [Model56] listings will crash the game).á This is pretty important, but itÆs really all
that needs to be understood to add most new models.á Characters can be a little more complex for
two reasons.á One is the Skeleton
section, which is used to define hit detection per skeleton and can be
enormously painful to deal with.á A lot
can be done with it without any changes.á
The other extra piece of information for characters is the æDeathmatchModelsÆ section.á
To add new multiplayer models, in addition to the model listing already
described, the model must be added to this list using the æNameÆ of the model
listing (example æName36 = ôNewModelNameöÆ).á This covers all the needed basics for model
setup in
As mentioned in the
exporter section, as MEL script was created to help streamline our workflow and
give the ability to store a lot of settings in the Maya scene that would
otherwise need to be set in ModelEdit every time a
model is re-exported.á It is intended to
be an interface to the exporter plugin.á This is 100% artist created tool and most of
it was created as a means to learn MEL scripting.á Because of this, it is unsupported and may
not be the best way to do everythingà but it works for us, and nearly all
á
The æEdit OptionsÆ section contains functions that attempt
to mimic ModelEdit functionality:
Here are the other available setting options:
In addition to these options, the script will export LODs for models by looking for a very specific naming
convention in the Maya scene.á I canÆt think
of a better way to describe this setup than to point to the sample Maya
character setup scene (Character_Sample.mb).á It contains LOD pieces that have been hidden
to prevent them from exporting.á Unhiding them and exporting this scene using the ltExport Script will result in fully set up LODs.
There are lots of issues that were never addressed due to
lack of time.á Here are a couple that
youÆll probably notice: