Constructor/Export

From TDN

Contents

Exporting to TGE and TGEA

Exporting with Static Meshes

Export as DIF

The Export As DIF... Command found under the File Menu is the primary means of creating Constructor DIF files for TGE. This exports directly from your scene to DIF format, including any Static Meshes and lighting data. Constructor DIFs created with this export process require the use of TGE 1.5.1 or higher.

Export as TGEA DIF

Coming Soon.

Exporting to Older TGE and TGEA Versions

Export as Legacy DIF

The Export As Legacy DIF... Command found under the File Menu allows you to export directly to DIF format for versions of TGE prior to 1.5.1. This format does not support baked-in Static Meshes, but otherwise exports your complete scene.

Export as Legacy TGEA DIF

The Export As Legacy TGEA DIF... Command found under the File Menu allows you to export directly to DIF format for versions of TGEA prior to 1.02. This format does not support baked-in Static Meshes, but otherwise exports your complete scene. Does not generate a "materials.cs" file for you though.

Export with Map2DIF

The old Map2Dif exporters have been set up as examples of how to run your own custom command line exporters from Constructor. They are available under the File->Export Menu.

Using Your Files in TGE and TGEA

Constructor DIFs can be used in TGE and TGEA just like normal DIFs. Don't forget to copy your textures into your project along with the DIF files, or you will get errors when attempting to load them!

NOTE: Shape files used in your .difs do not have to be imported into your scene. They are completely baked in to the Constructor DIF, textures and all!

NOTE: To use .difs that are buildings and interiors. You MUST save the file as a .map before exporting it to .dif. Then just copy the textures, Constructor DIF, and Linker Address Map for your object to your project.

Adding LOD to your scene

LOD (Level of detail) is pretty simple in Constructor. Much like with map2dif, you have to name all of your files with the same name and a trailing _# (for example: myscene_0.csx, myscene_1.csx, myscene_2.csx). If you want to export a scene with LOD then you will need to load all of the different LODs into Constructor at the same time. Then when you go to export it will automatically detect that the file names are the same and will present you with a dialog to select your LODs.
Quoted from Matt Fairfax's forum post

For a general LOD reference, see DIF/LOD - TDN

Note: If you are having trouble controlling the LOD properties you may need to go to scene>Manage Entities... From the window that pops up, you can control the file detail number and also the minimum pixel value.

Export Preferences

If you're using Constructor 1.0.2 or higher and go to System->Preferences...->Export you'll see that the Export prefs have been expanded a little to look like this:

Save Info File

You may (or may not) have noticed when this pref was added with 1.0.1. When you export to a DIF you'll see that a text file (Plain Text or XML) is getting saved out along-side the new DIF with some extra info saved into it (like the textures the DIF uses). The idea here is to help make it easier on you to pull together all of the info and data you need to for sending the finished artwork off or for moving it from directory to directory.

Copy Brush Textures

Also added with 1.0.1. This option allows Constructor to automatically copy the textures used on the brushes to the export directory. This will save you from having to do this step manually.

Copy Mesh Textures

Same thing as the option above except that it copies the textures used on any of the static meshes in your scene.

Hidden Surface Removal

New with 1.0.2. This is a biggy. If you uncheck this, Constructor will no longer do a hidden surface removal pass on your geometry before exporting it. This has a couple of side effects (potentially bad if not handled correctly).

First, the most obvious side effect is that your geometry will no longer get "chopped" up. However, before everyone goes and disables this, you need to consider the other two side effects.

You will be rendering surfaces that will never be visibile (such as the bottom of a column). This could potentially hurt your framerate a great deal on some maps. On others though, it may reduce your surface count and actually help your framerate a little. You can combat this some by using the NULL texture on surfaces (NULL surfaces do not get rendered in the engine). The other potentially negative side effect is that brushes with overlapping, coplanar faces will now exhibit "z-fighting" rendering artifacts in the engine since both sets of polys will be rendered.

One last thing to keep in mind with this option. If you do disable it, but are using zones, it will still perform a HSR operation on the polys that are found to be in more than one zone. There simply isn't a way to support zones and no HSR without this concession.

Unchecking this pref will disable the Alternate HSR discussed below.

Detail Brush HSR

Added in 1.0.2. With map2dif, map2dif_plus, and Constructor 1.0.1 the detail brushes do not get "chopped up" by normal brushes but they do perform a hidden surface removal pass with the other detail brushes in the scene which sometimes cause undesirable behavior (and is why changing *all* of your brushes to detail never really helped things).

One of the things a lot of people liked about Constructor 1.0 was that it did not perform an HSR pass on the detail brushes which led to a greater amount of control by the artist over the "chopping". So, for Constructor 1.0.2, doing HSR on detail brushes is disabled by default. Keep in mind that having HSR off for detail brushes can cause the exact same issues that disabling them for all brushes causes: overdraw and z-fighting.

Alternate HSR

Added in 1.0.2. This is an interesting pref to play with. Constructor 1.0 and Constructor 1.0.1 had radically different hidden surface removal algorithms because the introduction of zones forced a lot of changes to how HSR was being performed in 1.0. A lot of artists really liked how the HSR in Constructor 1.0 worked so the decision was made to reintroduce it with a slight modification.

This version of HSR is less likely to drop/split faces but it isn't always the most efficient at removing hidden surfaces so you may get a little more overdraw (rendering faces that will never be visible). It does handle overlapping, coplanar faces so you won't have to worry about z-fighting. The slight modification I mentioned above is that it uses the newer HSR for surfaces that span multiple zones since there is no way to properly handle zones with the alternate HSR scheme. In general, this is only going to be a handful of surfaces and it appears to perform quite well.

Alternate HSR and Normal HSR will both be disabled if the Hidden Surface Removal checkbox is unchecked above.

Split Epsilon

Introduced with 1.0.1. This is the "magic number" that is used when creating the collision bsp tree and when pushing the polys into that tree in order to sort them into zones. Floating point innaccuracy means that we can never exactly compare two values so we have to use an "epsilon" to decide if they are close enough together to be "equal". This pref controls how far away from a plane a point has to be in order for the brush or polygon to be considered split by that plane.

All math/programming jargon aside, the lower this value is the more likely a brush will get split up by another brush's surfaces and the more likely you will lose surfaces during the hidden surface removal pass. However, if you push this pref too high then you can lose all of the benefits of the hidden surface removal (less overdraw and no z-fighting). Changing this value can go a long way to combatting bad exports but it also can be highly dependent on the size and complexity of the map so I left it controllable by the artists so that they can find their own sweet spots.

Tiny Split Epsilon

Introduced with 1.0.1. This is tightly related to the pref above. The Split Epsilon is used to control whether or not a brush or polygon is considered "split" while the Tiny Split Epsilon is used to control whehter or not that split is too small to be considered. Some things in the bsp create process and the hidden surface removal operation only use the Split Epsilon while other portions use both so I felt it was important to expose this one as well.

Practically, this number always needs to be higher than the Split Epsilon...generally only slightly higher. Again, this is a "magic" number that each artist can play with to get the best results for each scene.

Render During Export

Introduced with 1.0.1. Some of you may have noticed that if you full screen a single view while you export a big scene (like the cathedral) it would export a lot faster than if you had all four of the default views open. This is because we are doing rendering calls during the export (so that we can update the progress bar). We are doing a lot less than normal but it was slowing things down.

By unchecking this pref, you can get a dramatic increase in exporting speed but it can look a little odd when everything disappears out fo your scene for a short bit.

smoothingThreshold

Exposed in 1.0.2. You have always been able to access $pref::Constructor::smoothingThreshold but most people did not know it existed. This is the pref that controls what surfaces get smoothed together on brush creation and on export (during export all the brush surfaces are smoothed together while during creation only the surfaces that belong to the individual brushes are smoothed together since the brush can/will be moved and full scene smoothing is an expensive operation).

A value of 1.0 will completely disable smoothing while a value of 0.0 will force it to try to smooth all surfaces together. Any floating point value between 0 and 1 is valid.

References

New Export Preferences in Constructor 1.0.2