Game Development Community

dev|Pro Game Development Curriculum

Constructor Beta2

by Matt Fairfax · 06/22/2006 (4:12 pm) · 103 comments

www.rustycode.com/matt/plan_06_20_06/ConstructorBeta2.jpg

Constructor Beta2 Changes


Below is a list of all changes that have been made to Constructor between Beta1 and Beta2. This covers SVN revisions 404 through 553.


CSX File Format


Constructor now supports a native file format with a CSX extension -- a Constructor Scene XML file. This allows for the loading and saving of all intermediate items that go into making a map/dif and is the format an artist would typically work with. The following is a comparison of what is supported between the CSX and MAP file formats under Beta2:

www.rustycode.com/matt/plan_06_20_06/ConstructorCsxComparison.jpg
Footnotes:
  • [1] - While the CSX file format supports multiple detail levels, Constructor Beta2 does not currently have a method for the user to define and move between multiple detail levels.
  • [2] - Brushes whose vertices have been edited to produce a non-planar face are not currently saved in a CSX file in Beta2. The first three vertices are used to calculate the face's new plane and it is this plane that is saved. So if you're moving around the vertices make sure they've been placed back into a planar orientation prior to saving and quitting Constructor.

How to Save the Scene as a MAP or CSX File

www.rustycode.com/matt/plan_06_20_06/ConstructorCsxSaving.jpg
Constructor's File menu has been simplified to allow the scene to be saved as either a MAP or CSX file from the same command. Choosing File->Save As... will open the file dialog prompting for a new file name. If the file is given a .csx extension -- or no extension at all -- then it will naturally be saved in the CSX file format. If a .map extension is used then the scene will automatically be saved to a MAP file.

The scene's name in the Layout Form's popup will reflect the current file type. When using File->Save the current file format will be preserved. This means that if a MAP file was initially loaded into Constructor that it will be saved as a MAP file unless File->Save As... is used to modify the file's type.


User Control Over Implied Selection


By default if nothing is directly selected in the current scene then there is an implied selection of all objects. ie: With nothing selected the Translate tool will move all objects. Beta2 allows the user to modify this behavior to no longer assume an implied selection. To change this setting check the Select Only checkbox under the Preferences Form.


Action Center


Each of the Transform tools now support the concept of an Action Center. An Action Center defines where the origin of the transform occurs. In Beta1 the Action Center was effectively always where the mouse was clicked. This has been greatly expanded.

There are four Action Centers, and the current one may be selected from the Tools Form's Modify tab's Action Center popup, the Edit->Action Center menu, or keyboard shortcuts. Below is a description of each Action Center.

Mouse or Tool [ALT-M]

Transform tools operate either where the user clicked the mouse or where the tool's Center parameter is set. This is equivalent to how Constructor always worked prior to Beta2.

Selection [ALT-S]

The selection center becomes the point at which the transform tools operate. ie: the same location as the Axis Gizmo. The tool's Center parameter displays the selection center's coordinates while the user clicks and drags in a 3D View or if the tool's Reset button is pressed. If the tool's Center parameter is manually modified by the user its location will be used as if the Mouse or Tool Action Center were active rather than the Selection Action Center.

If nothing is directly selected and the Select Only checkbox on the Preferences Form is not checked, then an implicit selection of everything in the scene is used to calculate the transform's center.

Group or Origin [ALT-G]

www.rustycode.com/matt/plan_06_20_06/ConstructorActionCenter.jpg
In this case there is no one Action Center that applies and the tool's Center parameter has no meaning. If a selected object belongs to a group then the center of all items in the same group is used as the transform point. If the object does not belong to a group then its origin is used as the transform center.

As an example: A scene has a row of Greek stone columns each of which is made up of multiple brushes -- perhaps a top, middle and bottom. Each column is in its own group to allow for easier selection and manipulation. The user decides that all of the columns need to be rotated 90 degrees about their vertical axis. Rather than select each column and do a rotate, the user may select all of the columns and activate the Group or Origin Action Center. All of the columns will rotate about their local, group centers by the appropriate amount.

As with the Selection Action Center, if nothing is directly selected in the scene then an implicit selection of everything is used.

Origin [ALT-O]

As would be expected this Action Center operates about the selected object's center. If a number of items are selected they will all transform about their own centers. As with the Group Action Center a tool's Center parameter has no meaning as multiple Action Centers are being used. And as with all Action Centers if nothing is directly selected in the scene then an implicit selection of all objects is used unless the Select Only preference is set.

Brush Face Special Considerations

Rotate Single Axis Tool and Planar Scale Tool

Face textures may not currently belong to a group so a Group Action Center behaves the same as Mouse or Tool. With an Origin Action Center the selected face textures will rotate at the point where its two texture planes and the face's plane intersect, and along a normal where the two texture planes intersect. In other words it doesn't matter what Axis is chosen for the rotation in the Rotation tool as it is entirely dependant on the brush face.

Brush Vertex Special Considerations

Rotate Single Axis Tool and Planar Scale Tool

Brush vertices may not currently belong to a group so a Group Action Center behaves the same as Mouse or Tool. And as rotating a vertex about its origin doesn't make a lot of sense, an Origin Action Center will also act the same as Mouse or Tool.


Custom Workplane Update


In addition to the previous workplane commands being moved to the new Edit->Workplane menu, a number of new workplane commands have been added.

www.rustycode.com/matt/plan_06_20_06/ConstructorWorkplane.jpg

Align to Selected Face's Texture

Created a new menu item: Edit->Workplane->Align to Selected Face's Texture. With a face selected this will orient the 3D views to place the face's texture origin at the center of the view and aligned with the texture planes. The alignment is such that the viewed texture image when displaying the texture's reference (Texture Ref check box under the Preferences Form) is oriented the same as it appears in the Texture Browser or Materials Form. This new workplane orientation could be used to help build and align geometry to texture features (such as a line of bricks) or to simply aid in texture manipulation with the various transform tools. This custom workplane may also be activated with a new button under the Tools Form's Display tab's Workplane group.

Selected Brush's Origin

Created two new menu items: Edit->Workplane->Move to Selected Brush's Origin and Edit->Workplane->Align to Selected Brush's Origin. The first will place the workplane at the selected brush's origin but keep the world-aligned rotation. The second menu item will also place the workplane at the selected brush's origin and will rotate the workplane to match that of the brush. This effectively places the workplane into the brush's local coordinate system. These custom workplanes may also be activated with new buttons under the Tools Form's Display tab's Workplane group.

Save to Scene

Created a new menu item: Edit->Workplane->Save to Scene. When activated the Save Workplane dialog will open asking the user for a name for the current workplane. The workplane will then be saved to the scene and becomes available at the bottom of the Edit->Workplane menu. When the saved workplane is chosen from the menu, it becomes the active workplane.

Manage Scene Workplane List

Created a new menu item: Edit->Workplane->Manage Scene Workplane List. When activated the Manage Workplanes dialog will open allowing the user to rename, delete and modify saved workplanes.


Tools Menu Update


The Tools menu has been modified to include the commands common between all tools but were previously only available from the Properties Form's Tool tab or the Tools Properties Form. Here's the list of commands and their keyboard shortcuts:
  • Activate [ALT-A]
  • Reset [ALT-R]
  • Make [Return]
  • Make and Continue [SHIFT + Return]

Select Menu Update


Added a new menu item: Select->Same->Brush Vertices. While in vertex selection mode with at least one vertex selected, choosing this menu item will select all vertices that belong to the same brushes as the currently selected vertices.


3D View Information Update


The 3D Views have been updated to provide more information to the user.

Selection and Tool State

The bottom right of any 3D View now looks like this:

www.rustycode.com/matt/plan_06_20_06/Constructor3DViewInfoText.jpg
The top line indicates the current mouse action. If no tool is active then this line reads Select to indicate the user may select objects in the scene. If a tool is active then its name is displayed here. ie: Rotate Single Axis for the rotate tool.

The second line indicates the number of objects that will be affected by the current or any future operation. In the image above All Brushes tells the user that all brushes (and possible other objects depending on the checkboxes under the Selection Form) will be acted upon by the next operation. To arrive at this state nothing in the scene is currently selected and the Select Only checkbox under the Preferences Form is not checked. This is due to the implied selection of everything in the scene when nothing is selected. If the Select Only checkbox were checked then this line would read 0 Brushes to indicate that nothing will be acted upon by the next operation.

When the user selects objects in the scene the number of objects and type is displayed on the second line. ie: 12 Brushes.

The third line displays the current Action Center. In the image above this is the Group or Origin Action Center.

The last line displays the current grid snap value followed by the current grid spacing for the 3D View. This second value depends on the 3D View's current zoom level and may be different for each 3D View.

Current Back Plane

With the Back Plane checkbox set under the Preferences Form all Perspective views use and display the back plane to provide a 2D reference for all actions. Sometimes it is not easy to tell which world aligned plane the back plane is on due to clutter in the scene. All Perspective 3D Views now show this overlaid on the camera rotation axis indicator at the bottom left:

www.rustycode.com/matt/plan_06_20_06/Constructor3DViewInfoBackPlane.jpg
In the above image the back plane is along the world YZ plane. Simple and to the point.

Custom Workplane

There was previously no indicator when a custom workplane was active, such as aligned with a brush's face. With Beta2 an orange grid or arrow is shown overlaid on the camera rotation axis indicator at the bottom left. What exactly is drawn depends on the 3D View's display type:

www.rustycode.com/matt/plan_06_20_06/Constructor3DViewInfoWorkplane.jpg
A custom workplane is always on the world's XY plane so any display types that show that perspective draw an orange grid. Any display type that looks along the XY plane has an orange arrow pointing towards the plane.


3D View Camera


Some new features have been added for working with the camera.

Targeting

www.rustycode.com/matt/plan_06_20_06/ConstructorLockCamera.jpg
The 3D View Form has a new button at the top right shaped like a target. When depressed the view will always remain centered on the Axis Gizmo. The view will jump to the Axis Gizmo's location (and change as different items are selected) and only Rotate and Zoom operations will be allowed. If nothing is currently selected, then the 3D view will operate normally. This Target setting will be saved with the Layout.

A check box has been added to the Preferences Form: Camera Target. When checked a small axis is drawn in the 3D View whenever the camera is moved, rotated or zoomed. It helps provide a frame of reference for the orbit camera.

Fit Selection and Go To Location

Pressing the 'F' key will now force the 3D View under the mouse to move and zoom the camera to fit the selected items in the view. If nothing is selected then all visible items will be placed within the camera's view.

Pressing 'CTRL-F' will now force the 3D View under the mouse to move and zoom the camera to fit all visible items in the view.

Pressing the 'G' key while the mouse is over a 3D view will move the view camera's target to the mouse's position. A quick way to hop around the scene.


Axis Gizmo State Drawing


www.rustycode.com/matt/plan_06_20_06/ConstructorAxisGizmo.jpg
While the Axis Gizmo is drawn, holding down the CTRL or ALT modifier keys will change the cones at the ends to circles (for rotate) or boxes (for scale) respectively. This should help give the user cues as to the operation they are about to perform. If the SHIFT key is held down at the same time as one of the other modifier keys then the Axis Gizmo will remain with the cone ends. This is because with SHIFT held down the Axis Gizmo is not active -- a SHIFT implies further selection of items so the Axis Gizmo gets out of the way.


Prefabs


www.rustycode.com/matt/plan_06_20_06/ConstructorPrefabs.jpg
The Tools Form's Prefabs tab will now display a list of defined MAP and CSX file prefabs. This version of Constructor currently has four prefabs defined in the Demo Prefabs group:
  • StackedCrates.csx - A number of crates stacked on top of each other
  • create.map - A single crate
  • WallSegment.map - A single 10 meter wide stone wall section
  • WallWithStairs.map - A single 10 meter wide stone wall section with stairs and lights
Prefabs support brushes, entities for MAP files and brushes, entities, scene shapes, static meshes and groups for CSX files.

Defining Prefabs

A collection or group of prefabs is simply a directory of MAP or CSX files. Using the System->Manage Prefabs... menu opens the Manage Prefabs window. From here the user may add new directories to search for MAP and CSX files as well as give the group a name. The order of prefab groups in this window's list will be same as under the Tools Form's Prefabs tab.

When a prefab directory is searched, Constructor will also look for a thumbnail image for the prefab. This thumbnail image should be 32x32 and given the same base name as the MAP or CSX with a 32 appended (as well as the image type's extension ie: .png). It may also be handy for the thumbnail image to contain an alpha channel for it to remain compatible with any Theme, but this is not necessary. If no thumbnail image is found for a prefab then a default image is used.

If you look in Constructor's example prefabs directory you'll notice there are a number of larger image sizes. This is for a future feature.

Using Prefabs

www.rustycode.com/matt/plan_06_20_06/ConstructorPrefabsIcons.jpg
To place a prefab in the current scene, simply click on the prefab's button under the Tools Form's Prefabs tab. This will activate the StampPrefab tool, which operates just as any other Constructor tool. With the prefab selected the user may either click in the scene to start placing it or click on the tool's Activate or Reset buttons. To drag the prefab around the scene use the yellow plus that is located at the prefab's origin.

To stamp the prefab, either use the tool's Make or Make & Cont buttons, or press the Return key. Everything from the prefab is then added to the scene.

The StampPrefab tool also as a Grouped checkbox. When active the stamped prefab will automatically be placed into its own group. If the prefab came from a CSX file that contains its own grouping it is ignored when the Grouped checkbox is active.

NOTE: The only limitation is with directory pathways to the external DTS files. If the DTS file requested by the prefab cannot be found, then the shape is not stamped. For the time being, load the CSX prefab file using File->Open File and you'll be prompted for the new location for the broken DTS file. Then just do File->Save to save the changes. The prefab will now match your system's setup.


Texture Browser


Added a new button to the Texture Browser window: Add Directory. When clicked the user will be asked to select a directory and all valid textures will attempt to be added to the currently selected album. Once the operation is complete the user is notified as to the number of textures that were successfully added.

The Texture Browser has a new button at the bottom right: Activate & Close. This performs the combined action of making the selected texture the active one and closing the Texture Browser.


New Texture Albums


The new UVCharts texture album has been created. It contains a number of textures that are helpful in aligning and debugging texture placement.


Static Meshes


www.rustycode.com/matt/plan_06_20_06/ConstructorStaticMeshes.jpg
Static meshes are .DTS detail meshes that can be baked into an interior and will cast and receive shadows along with the brush geometry. These are useful for adding much finer detail to your interior without having to build the mesh out of convex primitives. An example of this would be pipework running along a wall or light fixtures or a whiteboard or any other static geometry you might want to use to add fine details. You can see usage examples of static meshes in Unreal Tournament 2003/2004 and Half-Life 2. This can be a very powerful interior editing tool and I am glad we are finally able to use this in Torque!

To use a static mesh is very simple. Just go to File->Import Static Mesh... and browse out to your .DTS model. You can then use the standard transform tools to move and rotate it into place in the scene (scaling is not yet supported). Once you have it in place, simply relight the scene (ctrl-r or Scene->Relight All and switch over to a "Mapped" view in one of your windows to see what the generated lightmap looks like.

Now for the "bad" news. There is not currently a way for you to actually see this in action in the engine for the time being. We will be shipping an update to the engine that includes the changes needed but it isn't quite ready to go out with this beta.

NOTE: The Planar Scale tool does not currently scale static meshes.

IMPORTANT NOTE: You can only save static meshes to Constructor Scene Files (.CSX). They will not save to a .MAP and your work will be lost.


System File Browsers


For those of you who have been using Constructor much, you may notice that we switched away from using a custom TGE gui file browser to using the built-in system file browsers for Windows and Mac OS X. We are still using the TGE gui file browser as a fallback on platforms that do not have a standard for file browsing like Linux and this is still being touched up.

If you want to force Constructor to use the old TGE file browsers, open your prefs.cs and set $pref::Constructor::useNativeFileDialogs to 0.


Commandline Exporter


www.rustycode.com/matt/plan_06_20_06/ConstructorExportConfigurat.jpg
Tom Bampton has stepped up to help us with Constructor and his first addition is the Commandline Exporter. We needed a way that allows people to export their .MAP files through arbitrary commandline utilities like Torque's map2dif_plus.exe or Quake 3's q3map2.exe. Tom has built a system that allows you to execute executables with generic parameters that are either directly typed in or are retrieved from the Constructor scene (like the full path name). It also allows you to perform other useful operations like changing the working directory, copying files, copying textures, delete files, and rename files. All of these operations can be grouped together into separate Export Configurations so you can use different tools or different options quickly and easily as you need them (for example, you might have a quick lighting configuration for development work and an exhaustive lighting configuration for released interiors).

To make use of the Commandline Exporter load up a .MAP (Constructor Scene Files are not yet supported directly) and go to File->Export->Edit Export Configurations... At this point you won't have a valid configuration (there may be an empty one) so hit Defaults and hit Yes at the warning. This will load a configuration that copies the textures to the export directory and uses the map2dif_plus executable that is in the Constructor working directory. You can hit Edit and take a look at what commands it is using and edit them to your heart's content. Once you have a valid configuration in place simply hit File->Export->Torque (map2dif plus) and you should see the output from the export process pop up after you choose you export directory.


Smoothing


www.rustycode.com/matt/plan_06_20_06/ConstructorSmoothing.jpg
If you drop a cylinder primitive into Constructor with a lot of faces you may notice that the lighting on it is rendering smoothly both in Shaded and Mapped modes instead of being faceted per face. This is because we are now smoothing the normals between faces that share a texture and have less than a certain amount of bend between them. This smoothing is used in calculating the lightmaps that Constructor will output once Direct to .DIF Exporting is in place and should make your interiors looks *far* better than they have in the past! Sadly, for now this smoothing will only show up in Constructor itself. You can play with the smoothing a bit yourself by tinkering with $pref::Constructor::smoothingThreshold before you create a brush (0 = no smoothing, 1.0 = smooth everything, default = 0.9).


What's still missing for Feature Complete?


There are two major subsystems and one major feature that wasn't functional enough for this Beta:

Direct to DIF Exporting

www.rustycode.com/matt/plan_06_20_06/ConstructorDirectToDif.jpg
This will allow you to export your Constructor scene directly to a .DIF file without having to rely on map2dif_plus or any other commandline utilities. This is essentially a complete rewrite of map2dif (making use of the improvements made to map2dif_plus). It will also enable you to make use of things like Static Meshes and the enhanced lightmaps in your .DIF. It will take what you see on your screen in Constructor and translate it *exactly* to what you will see in-engine without having to worry about unexpected geometry shifts or light leaks. Right now we have simple scene being exported to .DIF's that can be used in the engine but the code is buggy and needs a little more love before it is ready for production use.

Undo/Redo

As some of you may have noticed there is no way to undo or redo your actions in Constructor and obviously this is a *big* issue. We have the groundwork for this in place but still have a ways to go on this.

Portals and Detail brushes

Map2dif can still process any portals and detail brushes that you import into Constructor but there still isn't currently a way to edit or even see those brushes in the editor. This is coming as soon as possible since it is the last major piece keeping some of you from using Constructor full time.


Welcome to the Constructor Beta (or not)


We added another 20 or so community members to the Constructor Beta and they have been giving us great help! There were a few people who I wanted to include in the Constructor Beta but they didn't have valid email addresses in their profiles. Sadly, those guys have missed out =(

It is important to keep your GarageGames profile up-to-date because you never know who might be looking at it!


More Information on Constructor


In case you have been living under a rock for the last year and still have no idea what Torque Constructor is by this point in my blog you should go check out all of the previous information that has been posted on it:

Deconstructing Constructor - Part 1
Deconstructing Constructor - Part 2
Deconstructing Constructor - Part 3
Deconstructing Constructor - Part 4
Deconstructing Constructor - Part 5

Of mice and men and Constructor
When will Constructor ship?
Constructor Functional Beta Ships!

TGE-L, Constructor and TSTPro

Torque Constructor Devshot 1
Torque Constructor Devshot 2

About the author

I am a Game Designer at PopCap who has worked on PvZ Adventures, PvZ2, Peggle Blast, and Bejeweled Skies. I am an ex-GarageGames employee who helped ship TGE, TGEA, Torque 3D, and Constructor.

#41
06/24/2006 (3:56 am)
Lukin 4wod 2 dis awsm rlse!!!!
Sorry, I suddenly reverted back to my over-excited state... S0... Hrd... 2... resist... 2... awesome...

I REALLY want constructor, this blog has made me excited!
Then I can finally stop using GTKRadiant. It is too unconventional for me.
#42
06/24/2006 (10:07 am)
well the static meshes be exported to the .dif format?
#43
06/24/2006 (5:53 pm)
Smoothing, really!? Honestly... I never got too excited about Constructor but that's changing. Your adding features that will serve/create my game better than just a nice workflow editor. Kudos!
#44
06/25/2006 (7:26 am)
I'd buy this solely for the static meshes stuff and WYSIWYG lightmap preview, even if the interface sucked! But the interface itself is also shaping up to be top notch as well.

This isn't simply a new DIF authoring tool... it's DIF 2.0! Waiting is a pain...
#45
06/25/2006 (9:14 am)
Donavan Jones:

"IMPORTANT NOTE: You can only save static meshes to Constructor Scene Files (.CSX). They will not save to a .MAP and your work will be lost."

Per the .plan above.

Since map2dif will still work with a .map file starting point, I'm guessing .dts won't be included in the .dif
#46
06/25/2006 (9:15 am)
Great work guys. I've got 3DWS as well, but it won't let you export the entire scene (static meshes and all) into Torque; so this will be very useful, as I won't have to lay everything back out again. Looking forward to this one, as is everyone else.:)

Have you had any problems with light leaking through the seams of buildings, etc.?

-Keith
#47
06/25/2006 (9:37 pm)
@Sim9

I think you deserve to be on the beta in order to get us some VTMs. I hope you get in. :)
#48
06/26/2006 (6:52 pm)
Fantastic update....
#49
06/27/2006 (12:10 pm)
I'm really wanting in on the beta more and more... I kept thinking it will ship soon over the past... 8 months almost... and I'm kinda disappointed on that side of things, but the feature set just keeps making me more and more hyped about it.
#50
06/28/2006 (2:14 pm)
Hmmm, wouldnt mind having a look at the beta!
#51
06/28/2006 (5:20 pm)
@Marcus: Thanks :)

Even if not to do video tutorials (if there's many changes to come), I'd like to do a video preview of it so far. Alternatively, it would also be cool if the authors released their own video preview. ;)
#52
06/29/2006 (3:04 pm)
I offered Sim9 a spot in the beta 2 days ago but still haven't heard anything back from him =(

Randy and Jonathon also still haven't gotten back to me...tis a shame if I am gonna have to give their spots away...
#53
06/29/2006 (6:13 pm)
Sorry about that-- It was between five e-mails regarding viagra and three from a Nigerian prince who needs my bank account information so I can receive $50 million dollars. :(

Thanks for the beta invite, this should be awesome :D (I've now replied to the e-mail)
#54
06/29/2006 (6:42 pm)
Usally uses 3dmax for all our models, but I am drooling over this and have been so for ages. I am looking so much forward to this tool.
#55
06/29/2006 (10:23 pm)
@Sim9

You owe me big time! J/K ;)

Well...back to 3DWS :(
#56
06/29/2006 (11:21 pm)
LOL
#57
06/29/2006 (11:48 pm)
*cough*

Did someone mention open spots in the beta?
#58
06/30/2006 (7:00 am)
@Marcus: lol :D
#59
06/30/2006 (8:42 am)
Hey Matt...Count me in if you still need a beta tester. I have been hanging around her for quite some time now and can't wait for the release. I have been using Quark for about 3 years now and having it working OK but really don't like it. Constructor really looks impressive. I'd love to be able to help if I can.

Thanks
#60
06/30/2006 (8:54 am)
;)