Creating models for Allegiance: Difference between revisions

From FreeAllegiance Wiki
Jump to navigationJump to search
mNo edit summary
 
(17 intermediate revisions by 5 users not shown)
Line 1: Line 1:
The following is a very informative tutorial on how to make Allegiance models written by [[Individuals#Orion|Orion]].
New or improved models are always welcomed by the community.  This article aims to outline the process required to contribute new models to Allegiance community.  There are several steps in the ''modeling chain'' needed to take a concept for a new model and get it inside the game:
# '''Artwork''' - creating the 3D mesh and texture.
# '''Adding "Meta data"''' - Information used to indicate cockpit position, weapons position, garages, etc.
# '''Optimization''' - Modifying the model for best performance in the game engine (poly count optimization, scaling, [[LOD]], etc).
# '''Compiling''' - Converting the optimized model and meta-data into the final format used by Allegiance.


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.
There is no need for one person to do every stage.  Individuals are encouraged to contribute in any of the above areas without feeling compelled to master them all.


Tools: Milkshape (A simple modeling tool)
==Artwork==
Demo Available: http://www.swissquake.ch/chumbalum-soft/
Creating the mesh and texture for the model is largely left to the discretion of the artist. The only ''real'' constraint is that whatever 3D modeling package the artist uses should be able to export to the [[Input model formats|appropriate format (.x)]]. Otherwise, it is good to be aware of [[recommended polygon counts]].
AMT ([http://www.freeallegiance.org/downloads/Editing%20Tools/Allegiance%20Modelling%20Tool.zip 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
==Meta-data==
In addition to the mesh, which defines the visible shape, each model also requires meta-data to indicate cockpit position, weapons position, garages, engines, and other hardpoints used for interacting with the model in-game.  ''See [[Defining model meta-data]].''
* [[Creating collision models]] - Using MS tools to create the hit box of a model.


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).
==Optimization==
Due to technical limitations of the game engine and computer hardware there are further refinements that should be done to ensure that an artist's model will perform well.  ''See [[Model Optimization]]''.


Once you have your Mesh and your UV Mapping done, and a texture your ship should be at about this stage:
==Compiling==
The last step is converting the optimized model and meta-data into .mdl format so it can be used in game.  When Microsoft released the Allegiance source code, they also released their model tool-chain.  ''See [[Compiling a model with Microsoft Tools]].''


==See Also==
*[[Creating models with Milkshape]] - Pre-source-release tutorial based on KGJV's [[AMT]] plugin for the 3D modelling program, Milkshape.  This method is technically obsolete now that we have better (and free) tools available, but some people still use it while instructions for the preferred method are fleshed out.
*[[Microsoft Art Tools]]


[[Image:ModelGuide1.jpg]]
[[Category:Art Development]]
 
[[Category:Development]]
 
[[Category:Current development]]
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).
 
 
 
[[Image:ModelGuide2.jpg]]
 
 
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:
 
 
[[Image:ModelGuide3.jpg]]
 
 
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.
 
 
[[Image:ModelGuide4.jpg]]
 
 
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. 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. This is due to the fact the Allegiance physics system requires that collision objects be convex.
 
 
[[Image:ModelGuide5.jpg]]
 
 
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).
 
 
[[Image:ModelGuide6.jpg]]
 
 
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.
 
 
[[Image:ModelGuide7.jpg]]
 
 
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:
 
 
[[Image:ModelGuide8.jpg]]
 
 
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). It is also important to note that doors should be axis-aligned, meaning they are not tilted up or down, either straight up-down (think Bios Expansion complex) or aligned to the XZ plane. 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.
 
[[Category:Help - Development]]

Latest revision as of 06:06, 10 March 2012

New or improved models are always welcomed by the community. This article aims to outline the process required to contribute new models to Allegiance community. There are several steps in the modeling chain needed to take a concept for a new model and get it inside the game:

  1. Artwork - creating the 3D mesh and texture.
  2. Adding "Meta data" - Information used to indicate cockpit position, weapons position, garages, etc.
  3. Optimization - Modifying the model for best performance in the game engine (poly count optimization, scaling, LOD, etc).
  4. Compiling - Converting the optimized model and meta-data into the final format used by Allegiance.

There is no need for one person to do every stage. Individuals are encouraged to contribute in any of the above areas without feeling compelled to master them all.

Artwork

Creating the mesh and texture for the model is largely left to the discretion of the artist. The only real constraint is that whatever 3D modeling package the artist uses should be able to export to the appropriate format (.x). Otherwise, it is good to be aware of recommended polygon counts.

Meta-data

In addition to the mesh, which defines the visible shape, each model also requires meta-data to indicate cockpit position, weapons position, garages, engines, and other hardpoints used for interacting with the model in-game. See Defining model meta-data.

Optimization

Due to technical limitations of the game engine and computer hardware there are further refinements that should be done to ensure that an artist's model will perform well. See Model Optimization.

Compiling

The last step is converting the optimized model and meta-data into .mdl format so it can be used in game. When Microsoft released the Allegiance source code, they also released their model tool-chain. See Compiling a model with Microsoft Tools.

See Also

  • Creating models with Milkshape - Pre-source-release tutorial based on KGJV's AMT plugin for the 3D modelling program, Milkshape. This method is technically obsolete now that we have better (and free) tools available, but some people still use it while instructions for the preferred method are fleshed out.
  • Microsoft Art Tools