OPT Creation

Intro and Preparation

Introduction

The OPT files are the models for the ships, stations, and other objects found in X-Wing: Alliance but unlike "normal" model files these also contain the textures (rather than these being separate files) and information on the workings of the ship such as the location and type of hardpoints, the size and type of the hitzones, the location, size and colour of engine glows, various lower detail versions of parts of the model for use at longer distances, and any turret or s-foil rotation information.

Other characteristics of the ship such as speed, shield strength, hull strength, etc. are contained in its "slot" in the XWA executable.

Whatever your reasons for wanting to create an OPT file, be it because you want a ship from outside the Hoth->Endor timeframe in which XWA was set, because you want a ship which had appeared in the Star Wars comics, novels, or even films which was not included in XWA, or if you have decided that TGs models are simply no longer good enough and want to replace them, this can be a lot of work.

Originally there was a certain novelty to simply being able to put something new into XWA so almost any custom OPT, however simple, was received with enthusiasm. Over time though as the novelty has worn off, as OPT makers have competed slightly with each other and tried to make something better than they did the last time, and to a certain extent as peoples computers have become more powerful and so able to use more complex models the standards have been raised. The box for X-Wing: Alliance recommends a PC with a 200MHz or faster CPU and 32MB RAM, the Ultimate Craft Patch (which actually contains some fairly old and low detail OPTs) has a recommended specification of 1.4GHz (1400MHz) and 256MB RAM so you can see how much more complex the OPTs various people have added are than the originals.

OPT limits

Maximum number of Meshes= approximately 51
(I found when creating a space station which had rows of docking forks that if you have too many meshes then some will not have working hitzones and will be able to be flown and fired through. Much later with the V.2 Liberty I found that with 52 meshes the 52nd was immaterial in this way but when an earlier mesh in the list was deleted so that this mesh was now the 51st it was shootable and rammable)

Maximum number of (triangle) faces per mesh= safe limit of 200, maximum worked = 967, maximum worked with LOD = 933
(This is bloody complicated.
If you have too many faces in a mesh then you will get an effect generally called triangling-to-infinity where various faces on the mesh appear to stretch themselves off and converge on some incredibly distant point. Unfortunately what XWA considers as being too many faces is rather random as one mesh can work while another with the same number of faces/vertices might not and this seems to be affected by if texture mapping has been applied and by what method.

  • Importing a DXF (which by the nature of the format is untextured) into AceDXF gave a maximum of approximately 230 before triangling.
  • Importing a 3DS (with texture mapping applied) into OPTech through 3DS2OPZ I found a mesh with 967 faces did not triangle to infinity.
  • To further complicate matters a mesh with 1183 faces that had been needing to be split in three when testing with a temporary texture and planar mapping applied across the entire mesh then decided not to triangle-to-infinity with the proper texture mapping.

There is also a complication where a mesh with too many faces causes XWA to crash when it is shot, so even if the mesh (however surprisingly) passes the triangling-to-infinity test you may have to split it.

Then there is the final complication with adding a low-detail version as this can also make XWA crash when the OPT is shot if the mesh has too many faces. The limit does not seem to be the combined total as a mesh with (say) 400 faces and no low detail version can work but a mesh with (say) 300 faces and a 40 face low-detail version would not. Since the limit for this (and other things) varies so much though it is hard to say.

The basic advice in all three cases is that if it happens then try splitting the mesh until it stops.)

Maximum safe (triangle) facecount for an OPT= 10200 (51*200), maximum (triangle) facecount thus far = 12957
(This should be regarded pretty much as being theoretical as an OPT with this many faces could almost certainly be done with fewer faces without any appreciable difference due to small details sometimes not being apparent and the strong smoothing effect applied by XWA making things look rounder. However if you have a large complex ship or a landscape surface (or if you get over enthusiastic with the modelling) then you might end up approaching this figure)

Maximum number of Guns= 118
(I was saying approximately 110 but Mateus Borges contributed the information that he has managed to add 118 to his Leviathan SSD)

Maximum Size of OPT= approximately 30km
(This is a problem more for planetary surface OPTs, where you want to be covering large areas and so have large flat faces, as due to the limit on the number of guns an OPT can support it would not be a good idea to create a ship this vast.)

Maximum number of textures= approximately 100
(This is something that I have not had problems with as when I produced an OPT where I was approaching this figure for number of textures I combined the individual textures into multi-part textures (where the texture mapping is set up to use only part of a texture and so each of these parts of the texture can be used for different purposes) so I have never broken this limit)

Maximum size/colour-depth for textures= 256 colours and 256*256 (safe) or 512*512 (less safe) size
(When making some of my early OPTs I found that I could use 512*512 size textures and this would work on my PC when using 3D Hardware ON and Software MIP Mapping. However these OPTs did not work for some people and I found that if I used either 3D Hardware OFF (software mode, which no OPTech created OPT will work in anyway) or Hardware MIP Mapping that XWA would crash. 512*512 size textures therefore can work, but 256*256 size textures will always work and therefore are safer.)
(Something I have recently discovered is that 512*512 textures don't seem to work in OPTech anyway. When an OPT was created with a 512*512 sized texture although it displayed correctly in OPTech when the OPT was created the texture was mapped incorrectly. When that texture was changed to 256*256 (no other changes were made) it worked. 512*512 textures may therefore only be useable for AceDXF created OPTs.)

Maximum number of Engine Glows = about 15
(With some ships you might want to use a large number of engine glows. This could be because they have a large number of engines, because they have a wide rectangular nozzle (like the YT class transports) which requires several engine glows to cover it, or because a good method with fighters is to use two engine glows per engine (one large transparent for a halo and one smaller denser for the exhaust). You need to be careful though as the maximum of 15 is not that high.)

Types of OPT

Heavy / Medium Starship-
In some ways this could be considered as being the simplest sort of OPT to make as this is a single OPT file which will not need any S-Foil information and generally speaking a heavy starship will not need any turret rotations set up as the ship will be large enough to not have visible turrets. Some Medium starships do have visible turrets though.
As these ships are large and will be being flown around at close range the model needs to be detailed (which is both a source of work in itself and means there will be more meshes whose hitzone types need to be defined and whose hitzones need to be grouped together into a single entry in the players targeting list) and the textures need to be very detailed and quite numerous.
For the same reason these ships suffer the most from problems with edge-wobble (where XWAs calculation of where meshes intersect changes as the relative position of the meshes and the player changes) as the player might flying almost parallel to the hull, weaving between the details, and so not only be moving in the relative direction that seems to give XWA the most problems with the calculations but also be in the best position to observe these problems. You may be tempted to use Boolean tools to avoid this but these can cause problems with the shading and smoothing in XWA and so should be used with care.
The level-of-detail settings will need to be reasonably complex so that different details vanish or are replaced with lower detailed versions (or indeed are replaced by lower detail versions which then themselves vanish at extreme range) at different times to minimise the resources used by this OPT at different ranges. The closer the player is to a starship the more detail they will need to see, and the further away starships are from the player the more likely it is that the player will be able so see more than one of them and so the better it is for these ships to at least have had their smaller details vanish.
These ships have the most weaponry, and so there will be the most weapons hardpoint to set up. They also almost always have a hangar whose three hardpoints (AIHangar, InsideHangar, and OutsideHangar) will need to be set up and which will need to be tested to ensure that fighters and other craft are launching and returning correctly.
Maximum Facecount= Depends on size of ship and rarity but anywhere between about 4 000 and 10 000 triangle faces.

Light Starship / Freighter-
These are also a single OPT file and can have a simpler model and lower number of textures than the larger ships because they are smaller. Since it is more likely there will be more than one in a mission they should be built with a lower facecount, but they still need to be quite detailed as the player will still be lying towards and around it.
These ships will have less weapons, and so fewer weapons hardpoints to be placed, and are less likely to have hangars to be defined and checked. However it is much more likely that the weapons will be mounted in turrets and so these will need to be modelled (see note below) and their rotations set up.
Maximum Facecount= Depends on size of ship and rarity but anywhere between about 2 000 and 4 000 triangle faces.

Space Station-
These can be relatively simple or rather complicated, depending on the size of the space station which can be anything from a small docking platform right up to something that is pushing the 30km limit (or even larger if you decide to make the station from more than one OPT).
Almost all space stations will have a hangar so this will need its hardpoints set up and to be tested.
Whether a space station has the weapons hardpoints placed onto hull meshes or on turrets depends on the size and design so you may or may not have to set up turret rotations.
Some space stations can have quite complicated hangar/docking facilities and since they don't normally move the player may decide to go for a fly through these areas, so they will have to be nicely detailed and modelled.
Some space stations may also be more likely to have a rather repetitive design where you have several docking arms, several landing platforms, several habitat modules, and so forth. When modelling (or designing) these you will need to keep in mind that any increase in detail to that part of the model would therefore be repeated that many times and so increase the facecount by that many times (see note below).
Maximum Facecount= Depends on size of the station but anywhere between about 2 000 triangle faces for a simple platform up to multiple OPTs of 10 000 triangle faces for a vast space complex.

Planetary Surface-
This would probably be the largest sort of OPT you would consider making as planets are rather large compared with most spaceships. As has been seen in almost every flightsim ever made trying to model a landscape with sufficiently few faces to be usable in a game and with enough detail to allow for players deciding to fly extremely low is rather difficult.
However as, barring the arrival of a Death Star, the ground generally remains stationary rather than moving around it is more easily possible to create a landscape from multiple OPTs. Buildings on the landscape should probably also be separate OPTs (at least from the landscape if not from nearby buildings) so they can be targeted and strafed into oblivion. Trees could be a problem as a tree is a complicated shape and, unless you have converted your forests into sailing ships, can come in rather large groups.
I have only really tried modelling a landscape for any purpose a few times but I did find a rather useful tool in MAX called the Displace modifier which will take a relief-map showing the elevation of different areas by their shade (which is the mapmakers concept that bump-maps are based on) and then alter the mesh the modifier is applied to accordingly. This mesh will need to have plenty of vertices though as the modifier does not create any (at least in my version of MAX) but only moves existing ones.
Maximum Facecount= Depends on terrain as if it is flat then you may reach the 30km * 30km limit before the facecount limit.

Hangar-
Darksaber has made a very nice Calamari Cruiser hangar for the XWAU and a Naboo Hangar for use with prequel-craft and General Trageton has made a equally nice Imperial Hangar, but you may decide that you want something different to reflect either that your mission set is not set with the player flying for either main faction, that your mission set is set during a different timeframe, or that they are just not flying from a Star Destroyer or Calamari Cruiser.
A hangar is made up of the main Hangar OPT plus secondary OPT files for the roof-crane, floor-crane, little blue Droid, missile-truck Droid, generator, console, and workstand. XWA then takes these secondary OPTs and puts them in various locations in the Hangar and in most cases animates them (a mesh rotates or the OPT moves around).

(XWA also puts in some hangar craft which by default are the X-Wing, Y-Wing, A-Wing, and a Shuttle that happily launches and lands even if the mothership is in the middle of a to-the-death battle. See note on Hangar Craft for additional thoughts.)

You will therefore need to make the main Hangar OPT plus any replacements for the secondary OPTs that would fit with the positioning and animation XWA applies (such as replacing the missile-truck Droid (that moves around) with a probe Droid (that can equally well be moving around). For secondary OPTs where you do not wish to replace them as either the positioning or animation will not fit in with your plans as has been demonstrated by Darksaber and General Trageton.these can be replaced by a simple cube or pyramid which is centred so that when XWA places it the actual model will be below the floor and so not be seen.
Remember that your replacement hangar should be centred so that the floor level is the same as on the TG OPT (for the positioning of secondary OPTs, hangar craft, and the players craft).
Maximum Facecount= Only one hangar so can be maximum possible.

Fighter-
These can be the most difficult sort of ships to make, which only makes the output of people like Darksaber more impressive.
Fighters normally consist of three separate OPT files, Cockpit (as name suggests used for the cockpit), Base (used for non player craft), and Exterior (used for exterior view of player craft). They can just have the Base OPT (which was what most of TGs fighters had since they were not craft flown during the storyline) and use the default "combat simulator" cockpit but this is something which these days is regarded as either being lazy of as being a temporary measure pending the release of the other two OPTs.
To make things worse although the Base OPT model can be reasonably simple as fighters move fast enough to make close examination difficult, and the model actually should be reasonably simple because there could be dozens of fighters of that type in a mission, the exact opposite applies to both the Cockpit and Exterior OPTs. Both of these will be being seen at close range and so they need to be very detailed and can be very detailed as there will always only be one OPT of their type in the mission.
Remember though when making the Base and Exterior OPTs that the order of the meshes seems to need to match up so that when the player is shot down any parts which have been set to BreakAndExplode will do so correctly. I found with the IRD that when the meshes didn't match up that I had one copy of a wing flying away and exploding while another copy remained attached and intact until the main part of the fighter detonated (see multiple models).
Fighters also have their own set of problems and restrictions. Fighters with more than one pair of warhead launchers can have problems if the player tries to change what sort of warheads are loaded. There is also a problem with having large warhead loads if the OPT is not installed in the Missile Boat slot. Another problem is that there are only a limited number of slots that can have hull icons.
Thankfully Fighters do at least have the simplest set up for levels of detail (on the Base OPT) as since they change range so swiftly you can make this a single stage change from maximum to minimum detail.
Maximum Facecount= Only one cockpit which will be viewed at close range so can be maximum possible. Only one exterior which will also be viewed at close range so this too can be the maximum possible. Can be dozens of base OPTs in a mission so below 1 500 triangle faces (preferably lower) is advisable.

Preparation

Whether you are creating a custom ship from your imagination or are trying to produce something based on an existing design your first task may be to produce lots and lots of sketches. This will help you to figure out how the various parts of the ship relate to each other and also help you to get the design of the ship fixed in your mind so that you can more easily visualise it while working.
You may also want to produce some test models in some cases either so you can check your idea for how things are arranged from different angles or if you are not sure which method would be best to produce a particular part of the ship.

This initial process can sometimes be shortcut if there is an existing model (either too high or too low detail) of the ship as this model can provide guidance for the general proportions and arrangement of your model. If this model is an older OPT then it will also be (or should be) the correct size and so can provide a guide for the size of your new model as well. Try not to plagiarise by actually reusing parts though as this is considered both rather rude and as cheating.

One thing to also bear in mind is that if you are making a ship of your own design (or extrapolating an existing low detail model) is to not be afraid to take advantage of a fortunate accident, if it looks good then consider using it, or to modify small elements the design if this will look equally good but be either easier to model or be lower in facecount. Some things are easy to sketch but hard to model and conversely some things are easy to model but hard to sketch.
An example of this sort of "cheating" would be where you are detailing something and could make the vertices between different sections of the detail and the vertices between the different sections of the thing you are detailing line up. This way you can avoid having the small faces and extra vertices that would otherwise be required to account for the small gap between the edge of the detail and the edge of the "thing-section".

Once you have the design for your ship worked out and have a good general idea of how you are going to model things you will need to decide what details will be modelled and what will be contained in the textures. This obviously depends on the type of OPT you are creating (both because on a large starship or station even "small" details can be quite large and because the rarer an OPT is likely to be in a mission the higher a total facecount it can afford to have) but it also depends on the design of the ship.
An angular design such as a Star Destroyer can have a relatively large amount of small details modelled as these details will be boxy (and so lowish facecount) and if you find you need to use Boolean tools to avoid edge-wobble or the "venetian-blind" effects (see note here), which you probably will, then the increase in facecount will be quite low as the detail will be overlapping fewer faces and thus causing fewer to need to be split.
Alternatively with a curvy design such as a Calamari Cruiser each detail will quite curved and so higher in facecount (a rounded bulge is equivalent in facecount to several boxes) and every combination using the Boolean tools will involve several faces on the detail and possibly several on the larger section the detail is being combined with and so will produce a higher increase in facecount.
Either way you will have to be careful as XWA applies such a strong smoothing effect to the model that it can create some rather unattractive shading along the edges of coplanar faces and this in some ways is worse than the problems of edge-wobble or venetian-blind that you were trying to solve. There are solutions to this problem but if you are importing as a DXF or OBJ then they will cause additional extra vertices.

There is also a pitfall where your focus narrows onto the mesh you are creating and onto making it the best it can be. This is quite a good idea but in the same way as in Art lessons at school you were told to sketch the outline rather than drawing each section at a time in more detail you need to maintain a wider perspective. Different areas of the ship should have the same sort of level of detail, if one section has a lot of details in texture but in another details of the same sort of size or significance have been modelled then the ship will look "bitty", so if you get carried away with detailing one section you will have to do the same for everything.

Another pitfall is where the ship (or station) has more than one identical or nearly identical area such as turrets, docking arms, engines, etc. Making this part of the ship nice and detailed by adding some extra faces might seem like a good idea as it could look good and would only be a small amount of extra faces compared with your planned total. Unfortunately as this mesh would not be unique this would mean that the total facecount would go up by a greater margin and if by increasing the detail of the mesh you manage to take it over the facecount at which XWA decides to triangle-to-infinity you would also be using up twice as many of your allocation of 51 meshes.

You may even find that if you have maintained a high level of detail in the model that although you are producing a very nice looking model you could actually be approaching the maximum number of faces an OPT could have (which varies because the maximum number of faces per mesh varies). Of course if you find this then you need to reconsider how much detail or how many sections per curve you are using as excellent results can be produced with far less. Small details may not show up very well in XWA and since XWA applies a strong smoothing effect to the model quite faceted ships can still look nicely rounded.
In fact too high a level of detail in the model is actually a bad thing as not only will this slow down the game with the extra calculations but the more faces you use the more chance there is that you will get stupid extra shading and the more likely it is that you will need to split meshes and so have extra vertices along the joins (since by splitting the mesh each of the resulting meshes will have a copy of the vertices rather than these being shared).

Remember one thing above all else though when doing the above or the following, "Don't worry, be Happy."
If people don't like what you have done then they can go **** themselves, especially if their idea of feedback to your several hours (minimum) of work consists of a semi-illiterate e-mail that (unless they really are in a straightjacket and typing with their nose) would have taken five minutes (maximum) to type. Nobody is infallible but if you have studied the available diagrams or pictures closely and carefully then it is far more likely that you are right than some imbecile telling you "FYI you have gots the modl wrong, teh hull isnt like tht. Just thot youd shuld knw" who can't be bothered to take the time to make what they is saying clear or to be polite about what they are saying.