Overview

The editor is the tool that you use to build levels for your application. It has support for editing complex 3d geometry, with texture mapping, lighting and static data.

The features the editor supports include:

•	3d geometry editing

•	Texture mapping

•	Lighting

•	Per-level data management

•	Geometry motion keyframing

•	Texture management

•	Geometry library management

•	Level build management

•	User-defined entity types

The editor serves as a design tool for level designers, and as a place for interfacing level art with the actual application. The level data is designed so that artists and level designers can modify it easily, and programmers can easily and efficiently access it at application run time.

When editing levels, you spend most of your time working with two different item types:  brushes and entities.  By placing, shaping, and changing attributes of brushes and entities, you can make very complex and beautiful architecture.


Brushes

The basic piece of geometry is a brush, which in the editor is defined as a single piece of 3-dimensional geometry such as a wall, staircase, or hollow box.  Brushes are made up of faces (sides) whose attributes can be changed independently of the brush.  The editor supports three basic types of brushes: solid, hollow, and cut.

Solid brushes such as walls, floors, and staircases make up most of the geometry in a level.

Hollow brushes have the same shapes as do solid brushes, but they're just thin shells. You can configure the wall thickness (called the hull size), and as you resize the brush, the hull size remains constant.  If the wall thickness didn't remain constant as you resized the brush, it would be very difficult to create levels with constant-thickness walls.

Cut brushes are brushes that remove material from the level. You can use cut brushes to hollow out solid objects, cut doors and windows in walls, or to build intricate complex forms of arbitrary geometry.  There are two ways to make a cut brush.  You can select the Cut Brush checkbox in the brush primitive's template, or you can select an existing brush, and click the Carve toolbar button.

A brush has attributes that describe its contents, visibility, and whether or not it can be collided with.  You change these attributes in the Brush Attributes dialog.  You can also change the texture that is applied to the entire brush, or you can texture each brush face individually.


Cut Brushes and Brush Order

When you place a cut brush in the world, it carves into any other brush with which it comes into contact, provided that the other brush was created before the cut brush was created.  Sometimes, you'll want to create a solid brush and have it carved by a cut brush that was created before your new brush.  To make this possible, the Tools|Brush|Make Newest menu command (or N shortcut key) will move the selected brush to the end of the brush list--effectively making it the last-created brush.  If you use this command to make an existing cut brush "newest," then it will carve into all other brushes in the level with which it comes into contact.


Faces

A face is a side of a brush.  A solid cube, for example, has six faces:  top, bottom, left side, right side, forward side, and back side.  A hollow cube has twelve faces:  six outside and six inside.  Each face has attributes that you can change from the Face Attributes dialog box.  These attributes control the texture that is applied to the brush, whether it's a mirror or emits light, and other details about how the face will appear when it's rendered in the game.

Note that cut brushes, although invisible themselves, create new faces when they cut into visible geometry.  These faces belong to the cut brush, and as such are modified by changing the faces on the cut brush, not on the brush that was cut.


Entities

Entities are point data such as player start locations, and non-locational data such as level attributes that you define for each level.  The system defines two special entity types--light and spotlight--that you use when you're applying lighting effects to your level.  Any other entity types are user-defined.  User defined entities have arbitrary properties which are defined by the application programmer in cooperation with the level designers.  The programmer creates a C header file that describes the custom entities, and places that file in the editor's extensions directory.  The details of the C header file syntax are given in Appendix A.

An entity contains data that is packaged with the level and made available to the programmer directly at program startup time.  Each entity has a list of properties that you may edit.  These properties can be of may different types:  numbers, text strings, colors, and locations being the most commonly used.

When you create an entity, the editor assigns it a name that consists of the entity type with an appended number.  Each entity of a particular type is given a different number in order to make the entity names unique in a level.  For example, the first light in a level would be assigned the name "light1", the second "light2", etc.  Currently, you cannot rename entities.


User Interface Layout

The editor is a standard Windows application that contains four primary user interface elements: the Menu, the Toolbar, the Views and the Option Pages.  The Menu contains all of the base operations available to the designer.  The Toolbar provides shortcuts to commonly used menu items.  The Views provide access to the geometry being constructed and entities being placed.  The Option Pages provide specialized support for the different modes and tools in the editor.


The Views

There are four Views:  a Textured view that shows a 3-dimensional rendering of the level, and three orthographic views that give Top, Front, and Side views of the level.  You do all of your geometry editing in the three orthographic views.  The Textured view is used for viewing the level and also for selecting geometry and entities that you can then edit in the orthographic views.

Note that the Textured view is an approximation of the level's final appearance--not an exact representation of how the level will appear when it's rendered by the Genesis engine.  In order to save time when displaying the level in the editor, the Textured view does not display any effects of lighting, so the display in the Textured view will not be of as high quality as the final compiled version of the level.


The Option Pages

The option pages are displayed to the right of the views in the editor window. There are six option pages: Template, Textures, Groups, Console, Models, and Sky.  Each of these pages is described in more detail below.


Template

The Template Options Page allows you to select items to be placed in the level.  You can select from one of six different geometry primitives, any of the defined entity types, or any premade objects that are stored in the program’s Objects directory.

The available geometry primitives are Box, Spheroid, Cylinder, Staircase, Arch, and Cone.  To select one, put the editor into Template mode, and select one of the primitives’ buttons on the Template Options Page.  Once you’ve selected and configured the primitive, you can shape its template (which is displayed in blue in the orthographic views) and then press Enter to place it into the level.

To place an entity in the level, select the desired entity from the entities drop-down combo box and click on the entity button (the lightbulb icon next to the drop-down).  The template entity is displayed in blue in the orthographic views.  You can move the template entity in the orthographic views and press Enter to place it in the level.

You can also place an entity by clicking in the 3D view where you want the entity placed.  The entity will be placed 16 texels from the surface on which you clicked.

To place a premade object, select the object from the objects drop-down combo box and click on the premade object button next to the drop-down.  The object’s center position will show as a blue “X” in the orthographic views.  You can move it as though you were moving an entity.  When you press Enter to place the object in the level, it will be centered on the “X”.


Textures

The Textures Options page allows you to select and place a texture on a brush or face. To change the texture, select the desired brush or face, pick the texture from the listbox on the Textures page, and press the Apply button. The texture will be applied to all selected brushes or faces. The selected texture will also be the default that is applied to all new brushes that you create.


Groups

Brush groups allow you to select a bunch of geometry and/or entities and group them into a named collection which you can then hide or select. This allows you to work with greater speed in a number of ways.

First, you can group large areas of geometry together and hide it in order to unclutter the views. When a level becomes complex, there is frequently a large amount of excess geometry in the views that you are not interested in at any particular point in time. Hiding parts of the level like this allows you to more easily select and manipulate the geometry that you are most interested in.

Geometry which is grouped and hidden is not included when displaying the level in the textured view, which can dramatically improve the editor's performance when dealing with complex levels.

Geometry which is grouped and hidden is not used when compiling the level, which means that the time required to compile the level can be greatly reduced by hiding large parts of the level. This becomes very important when you're texturing and lighting a level because you'll be making many small changes and recompiling frequently. Building a level with lighting--especially radiosity lighting--takes a long time.

This is where brush groups can help. Since you're typically lighting a single room at a time, you can group and hide all but the room on which you're working. Then, when you build the level only that room will be compiled. This will take much less time than rebuilding the entire level. You will still have to do a full radiosity build with all groups visible periodically to work on portions of the level that require light blending between rooms, and for the final level, but you should be able to save a considerable amount time by working on a single room at a time.

In addition to the Groups option page, on which you can control individual groups' visibility, three toolbar buttons allow you to control which groups are displayed by the editor and used when compiling the level. If the All Groups button is selected, then all groups are displayed, regardless of their individual visibily attributes. If the Visible Groups button is selected, then only those groups that have their individual visibility flags set will be displayed. If the Current Group button is selected, then only the currently-selected group is displayed.


Console

The Console Options page is where the editor outputs messages while operating. Normally, you won't have to look at the console. But during builds the level compiler puts a lot of information into the console window, and if the editor encounters an error while loading or processing your level it will display an error message on the console.


Models

A model is a group of one or more brushes to which programmers can attach data, and level designers can animate or point to from entities. There are two primary reasons to create a model: to create a moveable piece of geometry that you can animate; or to create a piece of geometry that programmers can identify at program run-time in order to provide special effects when an operation involves that piece of geometry.

For example, you might make a level that contains several different pools. By making each pool into a model and pointing entities at those models, the programmers will be able to differentiate among the pools. If they weren't models, then they'd be treated like any other piece of geometry and be indistinguishable from each other.

To create a model, selecte the brushes that you want to make up the model, and then from the Models Options page, click on the Add Model button.  The program will prompt you for a model name.  Once you've entered the name, the program creates the model.  You can add brushes to a model by selecting those brushes, selecting the desired model in the Models page, and then clicking on the "Add Brushes" button.  Other buttons on the Models page allow you to select and deselect all of the brushes in a model, remove brushes from a model, delete a model, clone a model, and set the model's rotation origin.  The bottom half of the Models page allows you to define an animation path for the model.

You create a model's motion by defining its keyframes--points through which the model will move--and the time it should arrive at each keyframe. When animating the model, the engine interpolates between keyframes to provide smooth motion. The simplest motion is one with a single keyframe. The model will move in a straight line from its original position to that keyframe in the time that you specified when you created that keyframe. Motions with multiple keyframes work in much the same way, but the animation engine provides interpolation that moves the model smoothly from one keyframe to the next without abrubt direction changes (i.e. it "rounds the corners").

To create a motion for the model, select the desired model from the drop-down list on the Models page, and then press the Animate button. The editor will select the model's brushes and put the editor into Move mode. You can then move and rotate the model to the position you want the model to occupy at its next keyframe. When you have it at the position you want, press the Stop Animating button and enter the keyframe time.


Sky

The Sky is a hollow box that surrounds your level.  Faces to which you assign the “Sky” attribute (see Face Attributes Dialog) are displayed with sky textures and are animated to simulate a rotating sky.  The Sky Options Page lets you define the textures to be used for each of the six sky faces.

Each face has a checkbox and a drop-down combo box.  To enable a particular sky face, make sure its checkbox is checked.  Then, select the texture to be applied to that face from its drop-down combo box.

Currently, the sky rotation axis and speed are fixed such that the sky rotates about the world’s X axis at 10 degrees per second.


Brush Attributes Dialog

The Brush Attributes dialog box allows you to change the attributes of the selected brushes. To view the Brush Attributes dialog, select one or more brushes, and then click on the Face/Brush Attributes toolbar button.

This dialog allows you to set the brush's type to one of the six brush types described in the table below.

Brush Type	Description
Solid	A solid piece of geometry such as a wall, floor, ceiling, door, etc. A solid brush blocks visibility and blocks passage.
Empty	An empty space. Empty is useful for creating pools and other things that contain liquids. An empty brush is translucent but doesn't block passage.
Window	A translucent piece of geometry. Allows visibility but blocks passage.
Clip	A clip brush is an invisible piece of geometry that blocks passage, but is entirely see-through. Clip brushes are useful for preventing access to parts of a level without having to build a solid wall.
Hint	A hint brush is invisible and doesn't block passage. Hint brushes instruct the level compiler to split along a particular plane. Their sole purpose is to help the level compiler generate a more efficient level.
Cut	A Clip brush carves a hole in existing geometry.
You may also set other attributes, based upon the brush type. For example, if the brush's type is Empty, you can set any (or none) of Wavy, Transparent, or Detail. For a Solid brush, however, Translucent isn't an option. The attributes are described in the table below.

Attribute	Description
Translucent	If the brush's Translucent flag is set, then you will be able to see through the brush. The Value setting determines how see-through the brush is, with a Value of 0 representing transparent and a Value of 255 representing completely opaque.
Hollow	A hollow brush is a piece of geometry with a hole cut out of it. You aren't allowed to set this flag from the Brush Attributes dialog (only from the brush template dialogs), but you are allowed to set the Hull (wall) Thickness for hollow brushes.
Wavy	If you enable the Wavy flag for an Empty brush, the texture with which the brush is filled will "wave" or animate to simulate moving liquid.
Detail	The Detail flag helps the compiler run more efficiently by removing some pieces of geometry from visibility and lighting calculations. Window brushes, for example, are always set to Detail.
Area	The Area flag is set on model brushes (such as doors) that physically separate two parts of a level. This flag allows the rendering engine to ignore very large portions of the world if the area brush is visible, which makes rendering much faster.
When multiple brushes are selected, the values displayed in the dialog box are from the first selected brush.  If you change a value in the dialog box, that value is set in all of the selected brushes.


Face Attributes Dialog

The Face Attributes dialog allows you to change attributes of the selected face. To view this dialog, press PgDn to go into Face selection mode, and select the faces that you want to modify. Then, click on the Face/Brush Attributes toolbar button to display the Face Attributes dialog.

Because the Face Attributes Dialog is a modeless dialog box, you can edit face attributes and then select different faces to edit without closing the Face Attributes dialog.  The changes that you made to the first set of faces will be saved when you switch faces.  This allows you to edit many faces without having to repeatedly open and close the Face Attributes dialog box.

When multiple faces are selected, the values displayed in the dialog box are from the first selected face.  If you change a value in the dialog box, that value is set in all of the selected faces.

To select multiple faces, hold the Ctrl key and click on the face in the 3D view.

The attributes you can modify are:

Attribute	Description
Mirror	Set this flag if you want the face to be a mirror.
Sky	This flag instructs the rendering engine to treat the face as though it's a view of the sky. The sky will animate in this face--moving as specified in the level's sky options.
Full Bright
Light	Set this flag if you want the face to emit light. If you set this flag, then be sure to set the light's Intensity value as well.
Texture Offset	The offset into the base texture that you want to be in the upper-left corner of this face.
Draw Scale	The scale at which you want the texture drawn.
Light Map Scale	The size of the light map that you want to use for this face. A larger light map size produces a more efficient level, but with softer lighting and shadows.
Angle	The angle you want to rotate the texture on the face.
Flip Vertical	Flip the texture vertically on the face.
Flip Horizontal	Flip the texture horizontally on the face.


Basic Operation

When the editor is started, two toolbars are present. The lower toolbar has three buttons at the left which control the main modes of the editor. They are, from left to right, Camera Mode, Selection Mode and Template Mode. The next three toolbar items in the second toolbar control the minor modes. These are, from left to right, Move Mode, Scale Mode and Shear Mode.

The editor is a modal tool. It has three main modes, and a number of minor modes. You create geometry using the principles of constructive solid geometry (CSG). In this technique you modify and combine primitive objects to form more complex objects. You can also use primitive objects to carve out geometry from existing solid pieces.

The three main modes are Template, Selection and Camera. In Template Mode, you configure the basic shape of a geometry template (called a 'brush') and choose an initial texture for it. You can then place that shaped brush into the level. You modify existing brushes when in Selection Mode, and you use Camera Mode for navigating through the views of the geometry that the editor supports.

The minor modes of the editor are Move, Scale and Shear. When the editor is in Move Mode, you can move and rotate brushes, but you can't change their shape. You use Scale Mode to resize brushes, and Shear Mode to shape brushes in ways that are not easily supported by scaling.


Template Mode

Template Mode is where the level designer starts. In this mode, you can choose from a set of predefined primitive brush templates to shape. All minor modes are available when shaping brush templates. The brush primitives are selected and configured through the Template Options Page. The buttons at the top of this page select from the different brush primitives: Box, Sphere, Cylinder, Staircase, Arch, and Cone. When you select a primitive, the blue template brush in the view windows changes to match that brush. You can then shape or move the geometry in any of the three orthographic views. The template doesn't actually become geometry in the level until you hit the Enter key when in one of the orthographic views, which places the brush into the level. Once you've dropped the brush into the level, you can modify it by selecting it from Select Mode, and then selecting a minor mode.

When you place the template brush into the level, it is textured with the current texture. You can change the current texture for the template by going to the Textures Option Page, selecting a texture, and hitting the Apply button. Note that changing the current texture affects the current template brush and all subsequent template brushes.

Note that on the Template page there are a some items other than the geometry primitives. These are used for dropping entities and object library items into the level. These will be discussed later.


Select Mode

In Select Mode, you can select and modify existing brushes and entities. When you switch to Select Mode, the blue template brush disappears. You can then click in any of the four views to select brushes or entities. Once you select a brush, you can choose a minor mode to modify it. A minor mode must be in effect before you can modify a brush.

To select multiple brushes and/or entities, hold the Ctrl key down while selecting. When multiple brushes or entities are selected, the Scale and Shear minor modes become unavailable. The only operations you can perform on multiple selections are move, rotate, and delete.

To move selected items, select Move mode, and then click the left mouse button and drag in the orthographic view in which you want to move the items.

To rotate selected items, select Move mode, and then click the right mouse button and drag horizontally in the orthographic view in which you want to rotate the items. Moving to the right rotates the items clockwise. Moving to the left rotates the items counter-clockwise.

To Scale or Shear a brush, select the brush that you want to modify, select Scale or Shear mode, and then click and drag in one of the orthographic views. As you move around in the view, the mouse cursor will change to show how the Shear or Scale operation will affect the selected brush.

If you have brushes or entities selected, and no minor modes are selected, you may clone the selections by holding down the Shift key, and dragging the selections. A copy of the selections is placed in the level and will be dragged--keeping the original selections in place. This is useful for rapid creation of like geometry. For example, if you want a bunch of pillars in a hallway, you can build one, then select it and clone it many times from the Top view very rapidly.

You may also alter the textures for selected brushes. To do this, select a texture from the Textures Option Page and click the Apply button. All selected brushes will then be textured with the selected texture. You may also change a brush's attributes from the Brush Attributes dialog, available from the menu or from the toolbar.

If more detailed control is required, you can select individual brush faces to be textured. To do this, select a brush, and then hit the PgDn key to switch the editor into Face Selection mode. You can switch back to Brush Selection mode by hitting PgUp. When faces are selected, you can select other faces either by clicking on a face in the Textured view (note here that face selection is not available in the orthographic views), or by using the left/right arrow keys to step through the faces on the selected brush. When a face is selected, application of a texture applies only to that face. You can then modify a face's attributes through the Face Attributes dialog, available from the menu or from the toolbar.


Camera Mode

Camera Mode is used to navigate through the geometry of the level. This mode provides very fine control over the positioning of the camera in each of the four views.

For the three orthographic views (Top, Front and Side), the camera controls are very simple. You can pan the view (move from side to side and up/down) by holding the left mouse button and moving the mouse. To zoom in or out, hold the right mouse button and move the mouse up or down. You can also zoom by pressing the keypad '+' and '-' keys, or by using the mouse wheel if your mouse is equipped with one. Note that you don't have to be in camera mode in order for the '+', and '-' keys and mouse wheel to work.

When zooming, the fine and coarse grids may change precision to reflect the new view point. The current precision of the grid is displayed in the lower right on the status bar.

In the Textured view, the camera controls are slightly more complicated because you are navigating in 3d space. The following table describes how the mouse buttons and motions affect the camera position in the Textured view: The columns of the table refer to the mouse motions and the rows refer to the mouse buttons.

	Right/Left	Up/Down
Left Button	Rotate view right/left	Move camera in/out
Right Button	Rotate view right/left	Rotate view up/down
Both Buttons	Pan (strafe) view right/left	Pan (strafe) view up/down
The other way to activate Camera mode is to hold the Space bar down while clicking and moving the mouse. For example, to pan in an orthographic view, press and hold the Space bar while holding the left mouse button and moving in the view. When you stop the panning and let go of the space bar, you will be back in your original mode.


The Camera Entity

You can also move and rotate the camera from within the orthographic views. To do this, select the camera entity (The easiest way to do this is to select it from the Entities dialog box), and then move it to the desired position and rotate it so that it points in the right direction. Moving the camera in this way is much faster than moving in the Textured view, and is recommended for moving the camera large distances.


Brush and Face Modes

There is also a special mode toggle that you use when texturing your level.  The PgDn key toggles between face mode and brush mode.  When you're editing geometry and placing levels (that is, most of the time), the editor is in Brush mode because you're editing brushes.  In this mode, clicking on the Face/Brush attributes button displays the Brush Attributes dialog.  When texturing your level, though, you must assign textures to and change the attributes of individual faces.

When you switch the editor to Face mode, you can select a face by clicking on it in the textured view, or by using the left and right arrow keys to move to the previous and next faces in order.  You are restricted from moving entities, or manipulating brushes when the editor is in Face mode.  To exit Face mode, press the PgDn key to return to Brush mode.

The current mode (Face or Brush) is displayed on the status line at the bottom of the editor window.


Shortcut Keys

Although it's possible to use the mouse to perform common editing functions, it's much faster to use shortcut keys to change modes and reserve the mouse for modifying the geometry and moving entities.  The editor supports a wide range of shortcut keys.

Mode Control

A	Activates selection mode
C	Activates camera mode
T	Activates Template mode
L	Activates Scale mode
M	Activates Move mode
R	Activates Shear mode
Editing

Del	Delete selected brushes and entities
Ctrl+A	Selects all brushes and entities in the level
Ctrl+D	Deselect all selected brushes and entities
File Operations

Ctrl+N	Create a new file
Ctrl+O	Open an existing file
Ctrl+S	Save file
Miscellaneous Commands

F1	Help
Left arrow	Select previous face or brush
Right arrow	Select next face or brush
F6	Go to next pane
Shift+F6	Go to previous pane
Keypad +	Zoom in
Keypad -	Zoom out
X	Lock X axis
Y	Lock Y axis
Z	Lock Z axis
Enter	Add template brush/entity to level
N	Make current brush newest
PgDn	Toggle between brush mode and face mode


The Grid

In the orthographic views, the grid is displayed in order to give you some sense of scale, and also to help you align your geometry.  The status line at the bottom of the editor window displays the current fine grid size and the current grid snap size.  The size of the fine grid will change as you zoom in and out in the orthographic views.

The Grid dialog allows you to specify the grid units (metric or texel), and also the grid boundaries on which geometry should snap when it is moved or resized.


Auto rebuild
Options Auto rebuild

To speed editing, turn off Auto Rebuild so that the editor doesn’t re-render the textured view after every editing operation.  When you want to display an updated version of the level in the textured view, click on the Build button or select the Tools|Build Quick BSP menu option.


Entity Editor

The Entity Editor allows you to select an entity and change its properties.  To select an entity for editing, pick it from the Entity Editor dialog box’s drop-down combo box.  Once selected, the entity’s properties and associated values are displayed below the drop-down combo box.  To edit a property, double-click on it, or highlight it by moving the selection bar and then press Enter.

Entity properties can be of many different types:  number, string, position, color, or model.  When you double-click on a property, the program will display that property in a dialog box that is specific to that property’s type.  For example, if you double-click on a color property, the color picker dialog is displayed.


Entity Visibility Dialog

The Entity Visibility Dialog (Entities|Visibility…) allows you to select which types of entities are displayed by the editor in the orthographic and textured views.  To hide all entitys of a particular type, clear the checkbox next to the entity’s type name in the Visibility dialog box.  To enable display of the entity type, check the box next to the entity’s type name.

When disabled for an entity type, this setting prevents all entities of that type from being displayed.  When this setting is enabled for an entity type, entities of that type are displayed subect to the group visibility rules for the group to which the entities belong.


Compiling and Viewing Your Level

When you want to see how your level will look in the finished program, you have to compile the level and view it with the preview program.  The Compile Manager dialog box allows you to set level compilation options and then start the level build process.  After the level is built, you can view it with GPreview—the level previewing program.

Select Tools|Compile from the menu (or click on the Compile button) to bring up the Compile Manager dialog box.  This dialog box lets you control many aspects of the compilation process, and also lets you preview the level after it has compiled.

Level compilation consists of three steps that are performed in this order:  creating the BSP tree from the exported geometry, calculating the potential visible sets, and adding lighting effects to the level.  The Compile Manager dialog box lets you control whether or not each of these steps is performed, and some of the options.  In addition, some general settings let you control the overall compilation process.


General Compile Options

Entities Only	Perform a quick compile.  See Quick Compile for more information.
Suppress Hidden Brushes	If checked, brushes and entities that are in hidden vis groups will not be written to the .MAP file, and as a result will not be included in the compiled level.
Vis Detail Brushes	When checked, brushes marked with the Detail attribute will be taken into account during the Vis stage.  This option is normally off to speed level compilation.  You should turn it on for the final compile.
BSP	When checked, creates level geometry from data exported by the editor.
Vis	When checked, performs potential visible set calculations on compiled level.
Light	When checked, performs calculations to add lighting effects to the level.
Preview	If checked, the program will automatically prompt you to run the level previewer after a successful compilation.


BSP Settings

Verbose	When checked, outputs detailed compilation progress information to the console window.
Entity Verbose	When checked, outputs detailed entity information to the console window.


Visibility Settings

Full Vis	When checked, performs full visibility calculations.  When off, the calculated visibility is less efficient at run-time, but takes much less time to compile.
Verbose	When checked, outputs detailed compilation progress information to the console window.


Light Settings

Radiosity	When checked, performs radiosity lighting of the level after the default direct lighting has been computed.  Significantly increases compilation time.
Extra Samples	Uses more samples to give finer lighting effects.
Fast Patch
Light Scale	Light intensity multiplier for the entire level.  Normally set at 1.0.  Higher numbers make the level brighter, lower numbers make the level darker.
Reflect Scale	Face reflectivity multiplier.  Normally set at 1.0. Higher numbers make the level brighter and more colorful.
Bounce Limit	Number of times to bounce a ray during radiosity lighting.  Default is 10.  Higher numbers give more subtle lighting effects at the expense of compile time.
Patch Size	Determines the size of the grid used when performing radiosity lighting.  A larger patch size will produce less detailed and less sharp lighting effects.  The default value of 128 produces good results.  Smaller numbers increase light detail but also increase compilation time and memory required to compile the level.
Default Light Level	Illuminates all surfaces with the light color specified.  The light specified is an RGB value.


Quick Compile

Level designers often build all of the geometry for a level and texture the individual faces before going through and adding final lighting effects.  Because the editor’s textured view doesn’t display lighting effects, lighting a level requires many edit, compile, view iterations.  To lessen the amount of time required for the compile phase, the Compile Manager dialog box gives you the option of telling the level compiler that only the entities (lights) in a level were changed.  If the compiler has the information left over from its last compile (which it usually will), then it can do a much faster compile by skipping the BSP and visibility steps and going directly into lighting.  This one option can cut a 40-minute compile time down to less than 2 minutes.

To do a quick compile, bring up the Compile Manager dialog box and check the “Entities Only” check box.  When this box is checked, the BSP and Vis settings on the dialog are greyed out because the compiler will not perform those steps.


The Initialization File  GEDIT.INI

GEDIT.INI contains program option settings for the editor.  The editor looks for the initialization file in the directory that contains the executable program, GEDIT.EXE.  The [Paths] section of the initialization file contains settings that are required in order for the editor to run.  These settings are:

TxlName	The texture library where the editor will look for its textures.  The default is gedit.txl.
PreviewPath	The full path and file name of the preview program.  The default is C:\EditorDir\GPREVIEW.EXE, where EditorDir is replaced by the name of the directory that contains the preview program.
TxlSearchPath	A semicolon-separated list of paths to search for texture library files.  The editor searches for texture library files in the following directories in this order:  the directory that contains the file being edited, the program’s current working directory, the directory that contains GEDIT.EXE, the directories that are specified in TxlSearchPath.
Headers	The path to the directory that contains user-defined entity header files.
ProjectDir	The directory in which the editor looks for and stores level files.
ObjectsDir	The directory in which the editor looks for and stores premade objects.
The [GRID] section stores the grid preferences that you define in the editor.  The three settings (Background, Color, and SnapColor) define the colors for the orthographic views’ background, and Grid color and snap grid color lines.

In addition to program options, this file stores editor desktop settings (toolbar positions, etc.), and the recent files list.  The desktop settings are stored in sections whose names start with DESKTOP, and the recent files list is stored in the [Recent File List] section.


User Defined Entity Header Files

The header files that the programmer writes to declare user defined entities in the editor have some restrictions.  They must be C header files, with limitations on the structure definitions that are used for the editor entities.  Macro expansion is not supported, and nested includes are not supported.

#pragma GE_Type("Player.bmp")

typedef struct tagPlayerStart {

#pragma GE_Published

Vec3d origin;

#pragma GE_Origin(origin)

} PlayerStart;

In the example above, the first pragma tells the editor that the following type is to be read as an entity definition.  The name of the entity definition in the editor will be the final structure tag in the type definition, in this case 'PlayerStart'.  The BMP string in the GE_Type pragma is used by the editor to read a bitmap to be used in the user interface of the editor for selection of the entity template.  Entity bitmaps should be 32x32 pixels in size, 256-color Windows .BMP files.

The second pragma (GE_Published) tells the parser that fields below this point in the structure definition should be displayed in the editor's property editors.  Another pragma (GE_Private) is used to make fields in the structure private from the editor.  An example of this is shown below.

The pragma GE_Origin is used to tell the editor which field in the type, if any, is supposed to represent the geometric position of the entity in the editor.  This allows the programmer to specify which field of the structure is to be updated when the level designer selects an entity and moves it in the editor views.

The editor understands the following implicit types:

int

char *

float

geFloat

geWorld_Model *

GE_RGBA

geVec3d

geBoolean

Each of these types has a built in property editor in the editor.  When the level designer double clicks on a field of type GE_RGBA, for example, the editor will raise a color picker dialog.

Structures can refer to each other by reference.  You cannot have embedded structures in your structure definitions, except for the special cases of GE_RGBA and Vec3d.  Forward references of structures are allowed.  For example, here are the type definitions that would allow you to build a linked list:

#pragma GE_Type("PathPt.bmp")

typedef struct tagPathPoint PathPoint;

#pragma GE_Type("PathPt.bmp")

typedef struct tagPathPoint {

#pragma GE_Published

geVec3d origin;

PathPoint * Next;

#pragma GE_Origin(origin)

} PathPoint;

Here, the editor has to deal with a field in the entity which is not of an implicit or built in type.  The Next field is a pointer to a PathPoint structure. The editor will display the field name Next in its property editors, and when the designer edits this field, the editor will bring up a list of existing entities in the world which are of the type PathPoint.  The designer may select only from this list to assign a value to the field.  This ensures strong typing in the data structures that the editor builds for the programmer.

#pragma GE_Type("monster.bmp")

typedef struct Monster {

#pragma GE_Published

geVec3d origin;

int HitPoints;

geFloat Speed;

GE_RGBA Color;

#pragma GE_Origin(origin)

#pragma GE_DefaultValue(HitPoints, "100")

#pragma GE_DefaultValue(Speed, "2.0f")

#pragma GE_DefaultValue(Color, "255 0 255")

} Monster;

The above is an example of the GE_DefaultValue pragma.  This pragma allows the editor to assign default values to fields in the entities.  Default values may not be assigned to fields that are pointers to user types.  They may be defined only for fields of implicit or built in type.

Documentation fields

#pragma GE_Type("monster.bmp")

typedef struct Monster {

#pragma GE_Published

geVec3d origin;

int HitPoints;

geFloat Speed;

GE_RGBA Color;

#pragma GE_Origin(origin)

#pragma GE_DefaultValue(HitPoints, "100")

#pragma GE_DefaultValue(Speed, "2.0f")

#pragma GE_DefaultValue(Color, "255 0 255")

#pragma GE_Documentation(HitPoints, “Monster’s starting hit points”)

} Monster;

This is an example of the GE_Documentation pragma.  This pragma instructs the editor to display the specified string in a hint box if you hover the mouse over the field in the Entities Editor dialog box.

#pragma GE_Type("door.bmp")

typedef struct Door {

#pragma GE_Published

geVec3d origin;

geWorld_Model * DoorGeometry;

#pragma GE_Private

int IsOpening;

#pragma GE_Origin(origin)

} Door;

Above is an example of the GE_Private pragma.  The fields marked as GE_Published will be editable in the editor.  The fields marked as GE_Private will not be displayed in the editor's entity property editor.

When the editor writes the entities out to the level, it stores the type definitions as well.  The engine parsees the type definitions, and streams in the entities.  The engine allocates space for each entity’s data structure at level load time.  The published fields, for which the editor had data, will be filled in with whatever the designer placed in the level.  Fields that are pointers to other structures will be properly initialized to point to those structures.  This is possible because each entity is named by the editor, and the engine performs load time binding on those names to fill in the structure fields.  The private fields are all initialized to zero by the engine at load time. The programmer can then access the data structures directly without having to perform any load time binding of the structures.