Guide: Siege University - 215: Siege Max: Objects

This tutorial is an introduction to preparing weapons and objects in gmax for export into the Dungeon Siege game engine. Most weapons follow the same basic process for export. Some weapons like the Dragon Minigun are a bit more complicated and require extra steps. The process for creating world objects is similar, but not as complex as creating weapons.
This tutorial will begin with the assumption that you have already taken the time to learn the basic of modeling and texture mapping weapons and world objects. Gmax comes with a great set of tools and tutorials to get you quickly up to speed on this.
===What You Need For This Tutorial===
*Dungeon Siege v1.1 or newer
*Dungeon Siege Tool Kit (includes Siege Editor and Siege Max)
*Gmax
**For further help in gmax, first download the help files.
**In gmax, please refer to Help > User Reference
*A test map you can practice with
*For online Modeling and Texturing Help:
**Planet DS Forums
**Game-Editing.net Forums
===What This Tutorial Assumes You Have Already Learned===
*Siege U: 102 - Objects - (for your weapons and objects testing within SE)
*Siege U: 201 - Templates - (for getting your art assets into the game)
*Siege U: 211 - Naming Key
*The basics of modelling and texture mapping
=== What This Tutorial Will Teach You ===
* Setting up Siege Max
* Scaling
* Naming Key reminders
* Components of weapons and objects
* Exporting weapons and objects in Siege Max
* Opening weapons and objects in Siege Editor
* Guidelines for weapons and objects
===Siege Max Setup===
Before delving into the sweet delicacies of editing Dungeon Siege content, you must first make sure Siege Max is set up correctly according to the file structure for the art assets.
When Siege Max sets up, it sets up a scenes folder under the pathnames "...\gmax\gamepacks\SiegeMax\Scenes". The "Scenes" folder contains a folder named "ArtAssets" and another folder named "Reference_Scenes." The "ArtAssets" folder is the one we will be concerned with for this tutorial, and where you'll be saving your first Dungeon Siege weapon and object. The "Reference_Scenes" folder contains reference equipment and objects from Dungeon Siege in the gmax file format (.GMAX).
The "ArtAssets" folder contains the subfolder: animations, bitmaps, and meshes. These folders are where you will store your source files for your content. The files used by Dungeon Siege will get exported to the Dungeon Siege install directory in the appropriate directory structure. The exporter will handle this.
You will notice inside each of these subfolders a number of sample files, all with seemingly incomprehensible long filenames. Dungeon Siege looks at the structure of the filenames of each piece of art, in order to determine the file's proper place in the file structure of the game. Various components of the tools, and the game itself, rely heavily on the filenames, so it's very important that you learn the naming conventions for each type of content you're working on. If you haven't read Siege U: 211 - Naming Key yet, stop right now and read it.
===Scale===
Keeping scale consistent throughout your work will greatly help to reduce confusion. Dungeon Siege used meters as the standard, so you will want to set your scale preferences to match.
To set the Scale:
#Click Customize on the main menu, and select Preferences from the drop-down
#Under the General tab, set System Unit Scale to 1 unit = 1.0 Millimeters. Click OK.
#Click Customize on the main menu again, and select Unit Setup. In the Units Setup Dialog, select Metric and set it to Meters.
This will ensure that everyone's units and scale are consistent, as they make content for Dungeon Siege.
===Naming Conventions===
Previously listed under the Introductions for this tutorial is information about the Dungeon Siege naming convention (.NNK). It is very important to have an understanding of the naming convention used. Without your file named correctly, the game will be unable to load them properly.
==Prepping And Exporting A Weapon==
===Helpful Guidelines===
There are different ways to model a weapon; extruding splines, box modeling, using primitives, etc. It all depends on what you are most comfortable with. Pick whatever method works best for you. Texture it however you like (using on texture), keeping in mind the texture size doesn't need to be huge and poly count should stay reasonable. The following are a few helpful guidelines, but nothing is set in stone and everything is up to the artist/modder.
*Poly count. Keep an eye on it. More unique weapons have higher counts, so ave the polys for the rare / unique items (the more polys on screen, the more performance hit). Try and keep them below one hundred polygons if possibly. Many weapons in DS are above and below this figure, so it can only be taken so literally. It's up to you.
*Texture size. Can be no bigger than a 256 x 256 (512 x 512 will not work). Think about how much the space the item takes up on screen; in game view and even when zoomed in, and adjust accordingly. The majority of our weapon textures were all contained on one 256 x 256. So the mapping of the majority of weapons was done very sparingly (the more textures to load and especially the larger ones, will cause more of a performance hit). If you had an individual 256 x 256 texture per weapon in Dungeon Siege, the amount of 256 x 256 textures loading would be unreasonable. So be careful with your texture usage.
*Scale. Adding a reference model to the scene is always a good way to save time when determining the scale of your weapon model. In gmax, right-click to bring up the "RefObj Dropper" (Reference Object Dropper). Double-click on an object to drop, and then click within your scene to place it. If you prefer to use your own mode, you can merge or import your own. Using a character model for reference works well.
*File Name. The file name does not have to be named specifically as the mesh does, but it's helpful to have them sync up together. The mesh name has to have the proper file name format to work with the DSTK. You must name your mesh "m_..." to get the "Item ToolKit" to function. This shows the toolkit what kind of art asset it is working with. For example, you would want to name your sword something like "m_w_sword_Number here" (mesh_weapon_sword_#). The specifics of your mesh name are up to your naming key and file structure, but it must being with "m_..." (for mesh).
=== Getting To Know A Weapon ===
A Dungeon Siege weapon requires several components before it can be used in the game. This tutorial will cover adding these components and exporting. Once you become familiar with these processes, you can apply them to create and export other types of weapons. 
==== Components to a Weapon ====
* Template: Text in a .GAS (file type) file defines the characteristics of the object and enables the engine to load it.
* Mesh: Mesh name must follow naming convention: m_w_NAME.ASP
* Texture: Must be a power of 2 and can be no larger than 256 x 256; should be a .PSD, will also get mip-mapped automatically (for more info on mip-mapped textures, see the Siege University Siege Max Character tutorial. It must follow naming convention: b_… (bitmap_…).
* Grip: Single weapon grip.
* Dummy Root: Determines where the object will be when placed on the ground.
* Trace 01 and 02: Designates locations of traces on the weapon.
- Below is a list (Fig. 1) of the other types of weapons in Dungeon Siege and the breakdown of their attached components: 
Figure 1 - A list of all the Dungeon Siege weapons and their helpers / components. 
The example I'll be using is a sword from the game - the "Jewel Sword" (Fig 2 and 3).
* Template: sd_un_g_c_sd_1h_mag
** More about templates later in this article and also in Siege University 201.
* Mesh: m_w_swd_038
** Mesh name = meshes_weapons_sword _#.
* Texture: b_w_weapons
** Texture name = bitmaps_weapons_weapons.
* Grip: grip_m_w_swd_038
* Dummy Root: dummyroot_m_w_swd_038
* Traces: AP_trace01 and AP_trace02
** Weapon traces are usually placed at top of the blade and at bottom of the blade.
Figures 2 and 3 - Farmboy holding the world famous "Jewel Sword"! 
=== Preparing Your Weapon For Export ===
For this example, we are going to assume you have already modeled, textured, and named your weapon mesh according to the proper naming scheme. For further help on modeling and texturing in gmax™, refer to Help > Tutorials.
# Before adding any components, it's a good idea to preview your object first to make sure everything is showing up like you want. Make sure your mesh is named correctly and texture is applied. Right-click and select "Launch Previewer". Notice if your weapon shows up oriented like you wanted. If not, you will need to adjust the pivot point.- For further help see Appendix A: Troubleshooting - Part 1. Pivot Points at the end of this document. Once you are satisfied with the orientation of your weapon, move on to step 2.
# Select your weapon and right-click (Fig 4) and select "Open Item Toolkit" from the pop-up quad menu (Fig 5). Figure 4 - Opening the Item Toolkit.Figure 5 - The Helpers floater.Figure 6 - The helpers / components attached to our sword.
# Select your mesh and then on your Helpers Floater, select "Add Grip to Item". This will add the grip to the weapon wherever you have designated the pivot point (Fig 6).- For more help on pivot points, see gmax™ Help > User Reference. If you get any errors regarding a "grip" or "dummy root" already existing, see Appendix A: Troubleshooting - Part 3. Helpers.
# Next, select "Add Dummy Root to Item". Similar to the grip, the dummy root will get added wherever the mesh has its pivot point, but this will get added in the same position of the grip or pivot, but just below it at 0 on the z-plane (Fig 6). If needed, you can adjust the position of this root later.
# Next, with your mesh selected, select "trace01" from scroll down menu, and then press "Add Attach Point to Item". When this is performed you should see a pop-up message saying "Creating AP_trace01 at mesh_name_here". Now that you have added the first weapon trace, you need to move it to the tip of the sword blade. Now add another trace, and name it "AP_trace02". Move this trace to the bottom of the blade (Fig 6). Traces define the polygons used to create the "motion blur" effect when a weapon is being used in combat.
# Now we need to move the Dummy Root into correct position. The Dummy Root will determine where the weapon sits relative to the ground when dropped. We want it a little below the sword so it will actually be hovering a bit, but not enough to look strange (this will make it easier to see, and prevent it from clipping into somewhat uneven terrain). Go to your Hierarchy Panel > Pivot > Adjust Transform > Move/Rotate/Scale and turn on "Don't Affect Children". Now move the Dummy Root so that it is positioned a little below the item. Once that is in place, be sure to turn off "Don't Affect Children" (Fig 7).Figure 7 - Positioning the Dummy Root below the weapon mesh.
# Hierarchy: You need to check the linking of your weapon and helper components before exporting to make sure everything works right. It should be set-up like the images below (Fig 8 and Fig 9).- For further help see Appendix A: Troubleshooting - Part 1. Pivot Points at the end of this document.Figure 8 - Weapon helpers / components.Figure 9 - Weapon components hierarchy.
# Preparation finished! So now that everything is hooked up (Fig 10) and linked correctly, you are ready to export and test your weapon in the game.Figure 10 - The helpers / components attached to our sword.
=== Time To Export ===
# The name of your weapon mesh governs in which directory the exported mesh, or "aspect file" (.ASP), will reside. The "Naming Key" (.NNK) defines this naming convention. Please refer to the documentation regarding the "Naming Key" to familiarize yourself with the naming convention used for Dungeon Siege art assets. As was covered earlier in the "Helpful Guidelines", you basically want your file and mesh named something similar to "m_w_swd_#".
# Select and right-click on your weapon mesh, and then select "Preview" from the pop-up menu. This will bring up the weapon previewer, or "Anim Viewer". The "Anim Viewer" lets you inspect your mesh to see if everything looks copasetic.
# If everything looks good, select and right-click on your weapon mesh in gmax™, then select "Export Mesh". You will get a confirmation dialog box confirming the export location along with the mesh name.
==== More than just previewing with the Anim Viewer ====
The Anim Viewer can be used to not only preview your weapon individually, but can also be used to preview your weapon while it's held by a player character and along with an animation playing. Check out the Anim Viewer user help 'H' (for keyboard shortcuts) and load a character mesh and appropriate animation (depending on weapon type) and load your weapon mesh also. Try experimenting with this to test your weapons on the character along with different animations playing.
Here is a list of animation types along with their appropriate weapon type:
* FS0—unarmed
* FS1—1 handed melee
* FS2—1 handed melee + shield
* FS3—2 handed melee (2h axe, 2h hammer, etc)
* FS4—2h sword
* FS5—staff
* FS6—bow
* FS7—minigun, crossbow, etc.
* FS8—shield only
=== Create A Template ===
Once you have exported the mesh, you can test it out in game. There are a couple of ways to do this, export your mesh and edit a template, or just export your mesh over an existing one (make sure you back up the existing one so you can go back to it).
- I suggest looking into more template help located in Siege U: 201
# Editing a template is easy enough to test your new art. Here is the template for the existing sample sword (just search for the template name "sd_un_g_c_sd_1h_mag" located in the wpn_sword.gas file).
[t:template,n:sd_un_g_c_sd_1h_mag]
{
 doc = "Jewel Sword";
 specializes = base_sword;
 [aspect]
 {
 model = m_w_swd_038;
 }
 [attack]
 {
 f damage_max = 113.000000;
 f damage_min = 83.000000;
 }
 [common]
 {
 pcontent_special_type = unique;
 screen_name = "Jewel Sword";
 }
 [gui]
 {
 active_icon = b_gui_ig_i_ic_swd_005;
 equip_requirements = strength:31;
 inventory_height = 3;
 inventory_icon = b_gui_ig_i_w_swd_069;
 inventory_width = 1;
 }
 [pcontent]
 {
 [base]
 {
 f modifier_max = 23.000000;
 f modifier_min = 7.000000;
 }
 }
}
You can simply export your mesh and edit the "model" block of the template (model = m_w_swd_038;) with your weapon mesh name.
# Exporting a mesh over an existing one will enable you to avoid editing any templates to test your art in the game (you might want to back up any existing mesh before exporting your own). You can just name your current new mesh the same as an existing one and overwrite its mesh when you export it.
=== Testing In Dungeon Siege ===
There are two ways to test your weapon in the game:
# If you overwrote an existing mesh or edited a template, you can simply load your map or ours to see you new weapon by using whichever weapon you overwrote.
# If you created a new template, you will have to fire up Siege Editor and load your new weapon through Siege Editor. For more information see Siege U. 102: Objects.
=== Exported And Tested ===
Now that your weapon has been exported and templated, you can load it into the game and try it out.(For any further help, please refer to Appendix C: Helpful Resources at the end of this document)
== Prepping And Exporting An Object ==
==== Helpful Guidelines ====
The same basic guidelines apply to objects as weapons. Keep an eye on your poly count (keep it low as possible and save the polys for only visible detail). Keep the texture size 256 x 256 or below and make sure it is a power of 2 (e.g. 16 x 16, 32 x 32, 64 x 64, etc.). For the scale of your object, first make sure you followed the gmax™ scale setup at the beginning of this article and also remember you can roughly scale your object by adding a character using the "RefObj Dropper" tool and using it for reference. Make sure your file and mesh are named "m_i_glb_name here" (mesh_item_global_name).This is only an example of the naming of your mesh. Depending on where you want it, you would name it accordingly (glb, ice, swp, etc.).Now that we have all of that out of the way, we can move on to getting familiar with the different aspects of a Dungeon Siege object.
=== Getting To Know An Object ===
Setting up a world object for export into Dungeon Siege is relatively simple.
==== Components of an object ====
* Template. Text in a .GAS file defines the characteristics of the object and enables the engine to load the object (more about templates previously in this article and also in Siege U: 201 - Templates).
* Mesh. The mesh must follow the principles of the naming convention.
* Texture. The texture must be a power of 2, can be no larger than 256 x 256, and should be a .PSD. For Dungeon Siege we consolidated the majority of our weapon textures onto 1 bitmap; "b_w_weapons.psd".
* Dummy Root. The dummy root acts as the identifying pivot point for an object when multiple objects are contained within one gmax™ file. It also defines where the object sits relative to the ground in the game.
Figure 11 - Lookout!! It's the crate!
The example I'll be using is from the game and is the basic yet amazing global crate (Fig 11).
* Template Name: crate_glb
* Mesh: m_i_glb_crate (meshes_items_global_NAME)
* Texture: b_i_glb_crate (bitmaps_items_global_NAME)
* Dummy Root: (here's more info on this…)
** A dummy root is used to tell the object where to sit when on the ground. It acts as its pivot point (0, 0, 0) for the object. If you are creating multiple objects in one gmax™ scene (such as weapons) each individual object needs a dummy root named and linked specifically to the object so the exporter can distinguish between the different objects upon export. If you are creating an item and it has ONLY 1 item in the scene (.GMAX), a dummy root IS NOT necessary - but it can't hurt to add it =). Just make sure you specify the object's pivot point to be at the bottom of the item where you want it to snap to the ground. For example, you would want to place the dummy root of a weapon a little bit below the mesh so it hovers above the ground in the game. For a crate, however, you would want the dummy root or pivot point at the base of the crate so that it doesn't float above ground. Think of the dummy root as the object's individual pivot point.
=== Preparing Your Object For Export ===
Create any object mesh and texture it. For this example, we'll use a basic crate.
==== The Model and Texture ====
Okay, so by now you should have your model textured and ready to prep for export. You want to make sure your mesh is named according to the correct naming scheme along with the texture.For more help on the naming convention, please refer to Siege U: 211 - Naming Key.
==== Adding the Dummy Root ====
# Select your mesh and right-click and select "Open Item Toolkit" from the pop-up quad menu.
# Select your mesh and then on your Helpers Floater, select "Add Dummy Root to Item". The dummy root will get added wherever the mesh has its pivot point, but just below it at 0 on the z-plane. If needed, you can adjust the position of this root later. For more help on pivot points, see gmax™ Help > User Reference (downloaded from: http://www.discreet.com/products/gmax/).
==== Moving the Pivot Point / Dummy Root ====
Adjust the pivot (or dummy root if you added one) so that your item lines up with the terrain properly.
Adjusting the Pivot Point
# To move the pivot: With your object selected, go to your Hierarchy panel > Pivot > Adjust Pivot > Affect Pivot Only.
# Move your pivot to line up with the bottom of your object (Fig 12).
# De-select "Affect Pivot Only".
Figure 12 - The crate pivot point.
Adjusting the Dummy Root
# Now we need to move the Dummy Root into correct position. We want it lined up with the bottom of the crate so it will not clip into the terrain (Fig 13). Go to your Hierarchy Panel > Pivot > Adjust Transform > Move /Rotate /Scale and turn on "Don't Affect Children". Now move the Dummy Root to be a little below the item.
# Turn off "Don't Affect Children" and deselect your Dummy Root.Figure 13 - The crate dummy root.
=== Time To Export ===
# Select and right-click on your object mesh, then select "Preview" from the drop-down menu. This will bring up the previewer window so you can see your object, as it will appear in the game. If you need to make any changes to your object in gmax™, simply select "Preview" again. The "Previewer" will show any modifications you've made.
# To export, select and right-click on your object mesh in gmax™ and pick "Export" from the quad menu.You should be all set, with your mesh exported and set nicely where it needs be and properly named, its time to get your object into the game!
=== Create A Template ===
Templates are used throughout the game and if you read the previous help on weapons you'll recognize some of this info. The best info regarding templates is located in Siege University 201.To get your item into the game, you can use the same method mentioned above in weapons; export a new mesh and edit a template / create a new template OR you can export your new mesh and overwrite and existing one.The crate I used for an example is the most generic / global crate. Here's the template (from gas file "ctn_container.gas"):
 [t:template,n:crate_glb]
 {
 specializes = base_container_wood;
 doc = "crate_base";
 category_name = "container";
 aspect:model = m_i_glb_crate;
 }
# To Export a new mesh and edit a template /create a new template in this instance, would be as easy as exporting your new mesh (lets say it's named m_i_crate_new-crate-01) and editing the template (you would search for the template crate_glb in CDimage\ world\ contentdb\ templates\ regular\ interactive). Simply rename the mesh from "m_i_glb_crate" to "m_i_crate_new-crate-01".
# To Export your new mesh and overwrite and existing one, simply locate a mesh and overwrite it with your own mesh (you might want to back up the current mesh first, so you can always get back to the original at any time).
=== Testing In Dungeon Siege ===
To test out your object, you will have to add it in a map through Siege Editor. To create your own map, refer to these helpful resources:
* Siege Editor
* Siege Editor Manual (siege_editor_manual.htm comes bundled with the Siege Editor)Editing and creating templates can be a pretty extensive endeavor, but understanding how to do this is a powerful skill. The more template knowledge the mod maker has, the better. You can get a pretty good understanding how the art pipeline works. I highly recommend it.
== Conclusion ==
Exporting weapons and objects is a process that can easily be grasped after a bit of experimentation. The export process mainly involves adding a few key components in gmax™ and then exporting your weapons and/or objects into the game with a basic understanding of the naming conventions and template structure.
Just to recap, a weapon involves adding a weapon grip, traces, and a dummy root. The placement of the grip will determine where on the weapon your character grasps it, the weapon traces will determine where the traces originate from when they are drawn on the weapon, and the dummy root will determine where the weapon sits relative to the ground when dropped.An object export is less complex than a weapon. An object only requires the addition of a dummy root. The dummy root acts as its identifying pivot point for the object when exported from a file with multiple objects in a gmax™ scene.The example sword and crate are good starting points to get you going on editing and creating content. Reading information about the naming key (.NNK), the basics of building a test map with Siege Editor, overview of templates (Siege University 201), and Help within gmax™ will get you well on your way with your Dungeon Siege editing. Good luck and happy modding.
== Appendix A: Troubleshooting ==
# Pivot Points: You might run across a problem of your weapon or object showing up in the Anim Viewer Previewer Mode possibly turned around, flipped upside down, or a combination of the two. Yet in your gmax™ scene, everything looks fine. You have your dummy root or pivot set where you want, so why is it not coming in correctly? My best advice is to check and adjust the rotation of the pivot point of your item (or the pivot point of your dummy root). This will require a little trial and error to get it right. Within gmax™, go to Help > User Reference > and search for "adjusting pivots."
# Texture: If you Preview your item and it shows up with a "black and yellow construction tape texture", this is Dungeon Siege's way of telling you that you have a texture error. Also, if your texture is not a power of 2 or if it exceeds the size limitations (256 x 256), or has other critical errors, you will get a handy error that will pop up letting you know.
# Helpers: (unlinking). When adding helpers to your weapon or item, if you have cloned the item, you need to "unlink selection" so it is no longer linked to the original item's attachments (if they had been added). If you do not unlink your cloned mesh, you will get an error that a "grip" or other attachment is already attached. When it is actually looking at the original helper attachment. For more help on linking in gmax™, go to Help > User Reference > and search for "Linking and Unlinking Objects".
# Hierarchy: (more linking). It is important that your weapon and object are linked up to their helpers/components correctly. The images in the weapon and object sections of this tutorial will show you the correct hierarchy setup. For help with linking in gmax™, go to Help > User Reference > and search for "Linking and Unlinking Objects".
== Appendix B: Siege Max Sample Files ==
Included are a few examples of both weapon and object sample files to help get familiar with the Siege Max tools. These are located in: \gamepacks\SiegeMAX\Scenes\ArtAssets\Objects within the gmax folder.Weapons (sword)
* m_w_swd-sample-A.gmaxFile containing a single sword mesh; complete with weapon grip, dummy root, and traces attached. This is ready for export.
* m_w_swd-sample-B.gmaxFile containing a single weapon without any export preparation features. You can add the necessary export features, and then export.
* m_w_swd-sample-C.gmaxFile containing a single weapon mesh, un-textured. You can texture, prepare for export, and then export.
* m_w_swd-sample-D.gmaxFile containing all three sword meshes. This is an example of multiple weapon meshes within one gmax™ scene. You can texture, prepare for export, and then export.*You can also add more sword meshes to any of these gmax™ scenes and export. For example, you could have one "master sword gmax file" and have all your swords within this file and export them all from one gmax™ file instead of multiple gmax™ files.
Objects (crate)
* m_i_glb_crate-sample-A.gmaxFile containing a crate with added dummy root, ready for export. This is ready for export.
* m_i_glb_crate-sample-B.gmaxFile containing an un-textured crate minus the dummy root. You can texture this mesh, prep, and export.
* m_i_glb_crate-sample-C.gmaxFile containing multiple crates ready for export. This is an example of multiple objects within one gmax™ scene. You can export these meshes.*You can also add more crate meshes to any of these gmax™ scenes and export. For example, you could have one "master crate gmax file" and have all your crates within this file and export them all from one gmax™ file instead of multiple gmax™ files.
== Appendix C: Helpful Resources ==
Here are some helpful sites. I'm sure you recognize PlanetDungeonSiege and DungeonSiege.com from earlier on in this article, but also be sure to check out Game-Editing.net as an excellent resource for editing Dungeon Siege content. Also, Polycount is a great site for news and help on modeling and texturing. Be sure to check out the forums too.
* PlanetDungeonSiege
* PlanetDungeonSiege Forums
* DungeonSiege.com Siege University
* Game-Editing.net Forums
* Polycount - (general help on modeling and texturing, also visit the forums)
Category:Stubs