Creating new models: How to export .XSI meshes for meshviewer
Posted: Fri Nov 12, 2021 9:18 am
Hello. I'm sure most of you by now are aware that this game is capable of supporting custom made models. What I'm sure most of you are not aware of is how exactly you get them ingame? This guide hopes to help in that regard. I'll go through the meshviewer manual, as well as what I've learned from experience when it comes to modeling for Army Men RTS.
Tools
====================
You're going to need the following tools in order to proceed.
Creating a Model
====================
First thing first, you need a model to work with. You can create it directly through 3DS Max itself, or you can simply create it using a software of your choice, then import it into 3DS Max from there.
Exporting to a .XSI File
====================
After you are sure your model is ready to be exported, you can take the following steps.
====================
Once you have an .XSI mesh file ready, you can now use it to create a .GOD file to be used ingame.
_________________
If you've made it to the end, then hopefully your model is now ingame running around! I hope this guide helped. But something I have to disclose right now, is that this guide was written largely from past personal experience. I understand my own knowledge on this is not complete, things such as creating animations in modeling software, creating an SP-1 layer, or even CP control points for weapon nodes, were largely left out. I leave this open in the hopes that anyone could contribute and over time we can compile a complete guide on create a fully realized model. Other than that, this as it is now should be sufficient for basic modeling needs.
Additional Reading
====================
Meshviewer Reference Manual
Dark Reign 2 Technical Reference Manual
Tools
====================
You're going to need the following tools in order to proceed.
3DS Max
You will of course need 3DS Max. Any of the following versions of it will work:
- 3DS Max 6
- 3DS Max 8
- 3DS Max 9
- 3DS Max 2009
- 3DS Max 2010
XSI exporter
Once you have a one of the listed versions installed, you will also want to download the .XSI exporter plugin. You can find this at this page here. Be sure to download the correct plugin that corresponds to your 3DS Max version! They should each come with a readme on how to install them, but if you need help, feel free to ask.
DR2 meshviewer
Finally, you'll need the DR2 meshviewer in order to compile your .XSI files into a .GOD file that will be used ingame. You can find this tool here on the forum as well, courtesy of @j3rry.
Dark Reign 2 meshviewer
Note: The meshviewer runs on a build of the Dark Reign 2 engine. This means that if you need to perform a hack in order to run Army Men RTS, (i.e. dgVoodoo2) then you will also have to perform that in order to run the meshviewer.
Dark Reign 2 meshviewer
Note: The meshviewer runs on a build of the Dark Reign 2 engine. This means that if you need to perform a hack in order to run Army Men RTS, (i.e. dgVoodoo2) then you will also have to perform that in order to run the meshviewer.
====================
First thing first, you need a model to work with. You can create it directly through 3DS Max itself, or you can simply create it using a software of your choice, then import it into 3DS Max from there.
Applying Textures
First thing's first, you will want your model to be textured, right? So how do you do that?
- First, select the object you wish to texture, then click on the 'Material Editor' button on the top bar.
- Now, in the window that appears, select one of the currently unused materials from the list (they look like grey balls) and then click on the 'Diffuse' option.
- Next, in the third window that appears, choose the "Bitmap" option, then in the filebrower that appears, select the image file on your computer you wish to use as a texture. Note: While 3DS Max can read most image types, Army Men RTS will ONLY be able to read from .TGA files!
- Now that you have chosen which texture will be used, first press the "Assign Material to Selection" button followed by the "Show Map in Viewport" button. You should now see your texture applied to your mesh.
UV Mapping Textures
When you apply your texture to your mesh, you may not be satisfied with how it is mapped. In order to fix this, you will need to unwrap the default UVs and create your own. Note: When importing an object from another modeling software, the UV maps should already be correct to how you mapped them previously. If not, then you will need to redo them now.
UV Unwrapping in 3ds Max - YouTube
- First, select the object you wish to modify. Then, on the right-hand side, click on the "Modify" tab. Now, pull down the Modifier List and select the option for "Unwrap UVW".
- Now, under the "Parameters" tab that appears, click on the "Edit..." button.
- A new window will appear. Pull down the list at the top right of it, and select "Map #0".
- Now, by pressing the "Face Sub-object Mode", you can select a specific pair of face triangles to edit the UV of. You can drag and resize the red box around the image, until only the desired texture remains on that face. You can properly map your entire model this way.
UV Unwrapping in 3ds Max - YouTube
Setting Team Color
There is a specific way the game engine will interpret an .XSI file in order to determine wether a triangle will be team colored or not. Here's the simpliest way you can do this.
- Either when initially creating a primitive, or anytime after by selecting it, you can change it's color on the righthand menu. Both the "Create" and "Modify" tabs will have a small colored square that, when clicked on, give you a dialogue window.
- The window that appears has a lot of standard colors listed. However the meshviewer only cares about two distinctions:
- If the object color matches in all three RGB values, then it will be purewhite ingame. (i.e. (255, 255, 255))
- If the object color does not match all three values, then it will be team colored ingame. (i.e. (255, 0, 0))
Creating Hardpoints
There exists a way to create specific points on your model that do not render ingame, but still can be called on by the game's logic to perform various tasks, most notably to spawn particles, or to guide facility waypoints. These are called Hardpoints, and are very simple to add to your mesh.
Note 2: The exception to the above is HP-RESOURCE and HP-RESOURCE-MOVE. These must be named as such, and when iterated, must have their number placed where the asterisk is. '*' See above image for example.
- Create a new primitive to use as a hardpoint. (Pyramids are recommended, but not necessary.)
- Keep it at a very small scale, you want it to be small enough that you can click and drag it around fluently, while also being small enough as to have the primitive's origin very close to it's vertices. (To prevent "disjointed" particle spawning.)
- Name your primitive as "HP-_____" where '_____' is the purpose of the Hardpoint. (See list below.)
Common Hardpoint names
- HP-FIRE = The point the unit aims its sights down, as well as the point from which attacks/projectiles originate.
- HP-EFFECT = The point the unit emits constant particles. (DumDum's fuse, Scorch's flames, etc.)
- HP-SMOKE = The point the unit emits smoke particles from. (Bulldozers, Barracks, etc.)
- HP-DAMAGE = The point a building emits black smoke from at low health.
- HP-RESOURCE* = The point on a resource object a dumptruck will aim his beam towards.
- HP-RESOURCE*-MOVE = The point in space a dumptruck will stand before taking aim at the resource object.
Note 2: The exception to the above is HP-RESOURCE and HP-RESOURCE-MOVE. These must be named as such, and when iterated, must have their number placed where the asterisk is. '*' See above image for example.
Creating a Footprint
If your object is a static prop or building, you will want to define an SP-0 layer. This defines the bounds the object takes up, and is required for an object to have a footprint. Here's how to add one.
- First, select the "Plane" choie from the primitives list. Then, click and drag on your Prespective viewport until you have a square about the size of your object.
- Next, rename your primitive to "SP-0", set your length and width to a multiple of 8 (this will align it with the ingame cell grid), and set both segs to 1 (this will help keep your vert count low).
- Finally, click on the "Select and Move" tool at the top of the window, and move the SP-0 layer to the origin point. (0, 0, 0).
Model Heirarchy
If you export your model as it is now, each individual object will be anchored to the origin. This is no good, so we'll have to set up a heirachy of objects.
Note 2: If you are unsure how to create a heirachy, how to animate a mesh, or are simply making a static prop, then it is easiest to simply model your mesh in its intended position, create a dummy root point at (0, 0, 0), name it as a HP- hardpoint (so it doesn't render), and then make every other object a child of that root.
- To begin, click on the "Schematic View" button at the top of the window.
- You will now be presented with a new window, which will let you create your heirachy. To start, click on the "Connect" button.
- You will have to decide which object to be your "anchor". This will be located at the origin of the model, and each object will then be anchored from there. To connect a child to a parent, simply click on a desired child, then while still holding left mouse, drag over to the desired parent, and release left click. A parent can have as many children as it needs to, and children can be parents to their own children. It should look something like this when you are finished.
Note 2: If you are unsure how to create a heirachy, how to animate a mesh, or are simply making a static prop, then it is easiest to simply model your mesh in its intended position, create a dummy root point at (0, 0, 0), name it as a HP- hardpoint (so it doesn't render), and then make every other object a child of that root.
====================
After you are sure your model is ready to be exported, you can take the following steps.
- Click on "File", then click on "Export..."
- You will be presented with a new window. First, browse to the directory where you wish to save your mesh to. Then, enter a filename for your mesh in the given field. Finally, pull down the "Save as type:" droplist and select "XSI 3D Model File (*.XSI)" and click on "Save".
- Finally, you will be given this dialogue window. If your model has animation, make sure the first box is checked. The second box should always be checked. Once you have set this, click on "OK" to export your model.
====================
Once you have an .XSI mesh file ready, you can now use it to create a .GOD file to be used ingame.
Creating a Static Object
- First thing, load up the meshviewer. It should look like this.
- The list on the left is all the .XSI files inside of the meshviewers ..\assets\ folder. Double click on your .XSI mesh to view it.
- With your model selected, click on the "God" tab at the bottom of the window.
- In this final window, you can decide if you wish to add a shadow to your prop at the top. The three types of shadow (Live, SemiLive, Generic) are all unecessary, so don't bother with them for now. Once you are satisfied with that, enter a name for your .GOD file below, and click save to create it!
Creating an Object with Animations
If you want to have a single .GOD file with multiple different animations, here is how you will do it. Note: For this part, I will be using the meshviewer provided .XSI files of the Guardian unit. I don't actually know how to export an .XSI file with an animation yet!
Below is a list of animation names used by the game engine itself: you should include these names if you want these animations to play. Any additional custom animations (such as Sarge waving his arms around during cutscenes) can be manually triggered via objective or cineractive code.
![Blushing :">](./images/smilies/icon_redface.gif)
- Before you can actually begin, you will first need to make sure your files have a specific naming structure. In this case, the "default" animation (what your unit will play when it is not doing any action) should be named as the inteded filename.
JDA_GUARDIAN.XSI - Next, each subsequent animation must be exported from 3DS Max using the exact same model from before and named the same as the previous file, except with the intended animation name appended to the end with a hyphen. For example:
JDA_GUARDIAN-MOVE.XSI
JDA_GUARDIAN-FIRE.XSI - Once you have all of your .XSI files ready with each desired animation, you may begin creating the .GOD file. One again, open the meshviewer and find your list of .XSI files.
Then, select the "AllCycle" option, and click on the "default" animation filename (the one with no hyphen appended).
- Now, clicking on the "God" button again at the bottom of the screen, you will see the list at the right side now contains each animation with the names you have given them. Now, by clicking on them, you can adjust their properties individually.
- To select an animation you want to tweak, click on it once from the list. Then, adjust it using the parameters listed below.
- Loop/2Way/1Way/Control = Tells the game how to play the animation. Unless stated otherwise, leave it set to '1Way'.
- Blend = Does this model interpolate its animations? (i.e. when one animation stops, will the model "reposition" itself for the next animation?)
- Anim: = How fast does this animation play?
- Move: = For use with a movement animation. Adjust this until the unit no longer "skates". (Its feet don't slide along the ground when walking.)
- AnimRate: = How quickly does a texture switch between frames? This feature is completely removed from Army Men engine.
- Chunkify = Does this unit have "chunks"? This will CRASH in Army Men RTS! ALWAYS make sure this is turned off before creating your .GOD file!
- QuickLight = Will this model have lighting applied to it? (i.e. is it fullbright or not.)
Below is a list of animation names used by the game engine itself: you should include these names if you want these animations to play. Any additional custom animations (such as Sarge waving his arms around during cutscenes) can be manually triggered via objective or cineractive code.
Engine animation names
- MOVE = Plays when the unit is moving. Should be set to Loop.
- IDLE = Plays when the unit has been idle for a bit.
- IDLE2 = Plays when the unit has been idle for a bit. If more than one of these exist (i.e. IDLE3, IDLE4, etc.), picks one at random.
- PREFIRE = Plays when the unit raises its weapon. If this animation does not exist, then unit will begin firing instantly.
- FIRE = Plays when the unit fires its weapon. Note that the animation must be fully completed before the unit can fire again, no matter the time specified by its FireDelay. For rapid fire weapons, make sure this animation is very short or very fast. If this animation does not exist, then this restriction does not apply.
- POSTFIRE = Plays when the unit lowers its weapon.
- PREPROCESS = Plays when the unit gets ready to perform a special action, such as constructing buildings, or healing.
- PROCESS = Plays when the unit is performing a special action, such as constructing or healing.
- POSTPROCESS = Plays when the unit has finished performing a special action, such as constructing or healing.
- CONSUME = Plays when a constructor gets consumed by its building during the process.
- DEATH = Plays when the unit dies.
- WOUNDED = Plays when a hero unit dies.
If you've made it to the end, then hopefully your model is now ingame running around! I hope this guide helped. But something I have to disclose right now, is that this guide was written largely from past personal experience. I understand my own knowledge on this is not complete, things such as creating animations in modeling software, creating an SP-1 layer, or even CP control points for weapon nodes, were largely left out. I leave this open in the hopes that anyone could contribute and over time we can compile a complete guide on create a fully realized model. Other than that, this as it is now should be sufficient for basic modeling needs.
Additional Reading
====================
Meshviewer Reference Manual
Dark Reign 2 Technical Reference Manual