Creating models for Allegiance
The following is a very informative tutorial on how to make Allegiance models written by Orion.
I have often been asked what is necessary to make a model work in Allegiance, so I decided I’d write up (another) tutorial, and post it here so that it will hopefully not be lost so easily. If this tutorial proves useful, please sticky it:P
Tools: Milkshape (A simple modeling tool) Demo Available: http://www.swissquake.ch/chumbalum-soft/ AMT (Allegiance Modeling Tool, a plugin for Milkshape)
Prior knowledge: This is not a modeling tutorial, you need to know how to use Milkshape, and how to make a model and texture it. If you do not know how to do what I have just mentioned, this tutorial might be a good place to start: http://www.tutorialguide.net/modelling_a_car_tutorial.html
Let’s get started then. We’ll start with ships, then move onto bases as they are a bit trickier. All ships need four things: A Mesh (or Model), a UV Map (for the texture to wrap to), Joints (to designate positions for various effects and hardpoints to be utilized by the Allegiance engine), and bounding objects (Objects that the engine may use to detect whether a weapon particle or other object is inside or outside of a mesh).
Once you have your Mesh and your UV Mapping done, and a texture your ship should be at about this stage:
Now you will want to add in the joints you need for your model, this one needs a gun, a cockpit, an engine glow, an engine trail, a smoke trail emitter, a missile hardpoint and two
Turrets. We’ll start with the cvh_ joints, which designate positions on the model important for game mechanics (not just effects). These are the cockpit, the gun, the two turrets, and the missile hardpoint. Each cvh_ joint will consist of two parts, the _from at the origin of the point, and the _to, extended away from the model a distance (any distance, really).
As you can see, each joint has a base name such as cockpt, or turwepemt, and some even have numbers, used if there is more than one of something. We have more than one turret, so we use in turwepemt1. The game really is not picky about what numbers you use, I used turwepemt for the first turret. There are two joints which you can only have one of: the cockpt, and the missile (missemt). When you are finished putting on your cvh joints, your list of joints should look something like this:
You will also notice that there are some joints in the picture of the ship that are currently unlabelled, those are the ship’s mdl_ joints, but as you can see, it has not 1 segment, but two. The segment between the _from and the _to is still there, but there is a new one between _from and _zn. Each mdl_ joint needs _from, _to, and _zn. The picture may seem a bit confusing, realize that the three joints (for trail, smoke, and thrust (engine glow) )are simply overlapping.
You can find a list of more joints you can use, including strobes, which do not require _to, or _zn, only the name of the strobe in the place of a _from segment in the position you want your strobe to be, here: http://pk .dras.us/users/Orion/joints.txt
Now that you have successfully added all your joints to your model, you need some bounding boxes for it. Bounding boxes should be very simple, use as few polygons as possible for them or they can become very expensive for both the client and the server when they’re used in game (especially if there is more than one of them). Only use simple primitive objects for bounding boxes. You may rearrange the vertices to your liking, but remember you cannot make your own primitives. I have hidden the joints so you can see the bounding boxes better. Note: If you merge two cvh groups together, they will NO LONGER WORK, so do not merge cvh objects.
As you can see, the box fits around one part of the mesh, create as many cvh boxes as you need in order to cover your entire mesh. Overlapping cvh boxes has been known to cause some problems, so try to make sure that the boxes do not overlap. Each cvh box should have a different number, the one in the picture is cvh_01, the next should be cvh_02, etc. Now might also be a good time to rename your mesh (graphical – the texture one:P) model groups, to mdl_, as illustrated in the picture. You CAN merge these groups as you see fit, but note that you will need more than one mdl_ group if you want to use more than one texture file. Which brings us to the next topic: Textures. Textures should be named after the model you are using. If, for example, your ship is named cap603.ms3d, your texture should be named cap603.bmp, when you make a new material in ms3d, name it cap603, and when everything is exported, you should then have three files: cap603.mdl (the mesh & mdl_ joints), cap603.cvh (the bounding mesh and cvh_ joints), and cap603bmp.mdl (the texture).
You should have a fairly good understanding on how to make a ship for Allegiance now, so let’s move onto bases, and their doors (mine and AMT’s mortal enemies). Bases should be approached the exact same way as ships are, with the exception of the joints, which are somewhat different. Obviously ships do not use weapons, a cockpit, or any of the other effects (except strobes), so you need a whole new set of base joints, which can be found in the same file referenced above for ship joints. The easiest new joint is the cvh launch joint. Note: I have hidden the cvh groups to make the joints easier to see.
This, quite simply, designates where the ship will exit from. Note that you will have to tip the model onto its side in order for it to appear right side up in-game (one of the little quirks in AMT).
Next we have to designate where you enter the base, the green door. This is significantly more difficult, as it requires five joints where the launch bay only requires one. This is displayed in the picture below:
As you can see, each joint crosses over the center of the entrance to the opposite side, except A which comes straight out. For example, cvh_garage_1D starts at the bottom of the door with _from, it crosses over the center of the door up to the opposite side with _to. It is VERY important to note the bottom right corner of the picture: your _from parts of each joint MUST be inside the bounding box, and all of the _from parts of the joints should be inside the SAME bounding box. It will take a lot of trial and error to get your doors working right, but do not give up hope (unless you just cannot be arsed to fix them, then do not let anyone give you crap, and invite them to fix the doors:P). You can of course have multiple entrances and exits, just make more joints and use different numbers, I used garage1 as the designation for this door. Note that shipyards use a different kind of dock called a capgarage. All your capital ship entrances should have a designation that is something like: capgarage1 (ie cvh_capgarage1A_from).
Once you are finished with your Allegiance model, and looked over it twice for errors, export it with AMT. You will need to export it as both Allegiance MDL file(s), and Allegiance CVH file(s), which are listed under ‘Save As Type:’ in the ‘Save As’ dialog box. Under ‘Filename:’ simply enter the name of your ship or base, or other object (ie ss502).
If you have any other questions just post them up on the forums and I will try to get to them if nobody else can answer your question.