Golem Studio

From Oldunreal-Wiki
Revision as of 22:25, 11 June 2012 by GreatEmerald (talk | contribs) (→‎Interface: More expansion!)
Jump to navigation Jump to search

Golem Studio is a mesh and animation editor that came with Unreal II (specifically, version 1.01). It was created by Legend Entertainment and was used as a companion program to UnrealEd for setting up the meshes and animations of all animated objects in Unreal II, including characters, creatures, some decorations and most weapons. It can be launched by running GlmEd.exe found in the Unreal2/System directory.

Unlike UnrealEd (as of 11 June 2012), the Golem Studio works well on Linux through Wine, including the Render window.

Program logic

Workspaces

Golem Studio works with files called Golem workspaces (extension .gws). Golem workspaces are a kind of master files that contain a reference to a Root folder. The Root folder typically holds two types of data - folders and GEM files. Opening the workspace will cause Golem Studio to scan the Root folder for any subfolders and GEM files. Changing anything in the workspace changes the way files are situated on the Root folder, for instance, adding a subfolder to a workspace in the Goldem Studio will also physically add a subfolder into the Root folder. Same thing with GEM files. And vice versa - physically changing the contents of the Root folder will change it in the workspace. As such, workspace files are nothing more than one path and a few associated settings.

New workspace files contain the reference to the Root folder in the form of an absolute path. That means that if you change your disk order or use a workspace file from another person, it will most likely fail to work. In such an event, nothing is opened, and the Golem Studio continues as if nothing was attempted to be opened.

GEM files

While the Root folder contains only folders and GEM files, GEM files themselves contain objects (physically, not just references to them, except for a few types of objects). These objects can be of different categories:

Category Type Description
Bone Frames GemBoneFrames These objects contain a set of frames with bone transform information based on a particular bone hierarchy, used for skeletal animation.
Bone Hierarchy GemBoneHierarchy These objects contain a collection of bones organized in a hierarchy, used by bone points and frames objects for skeletal animation.
Bone Weighted Points GemBonePoints These objects contain a set of points and their normals, which are weighted to the bones of a bone hierarchy for smooth skinning. These weighted points are necessary in order to generate point positions from skeletal animation data.
Color/Alpha Frames GemColorFrames These objects contain a set of frames with 32-bit ARGB values capable of being animated on vertices for color & alpha effects.
Entity Blueprint GemBlueprint These objects are blueprints used to create entities at runtime. They contain a reference to a Model object describing the entity's structure, and a set of attachments used to connect other entities to this one.
Entity Script Agent GemAgent These objects contain a rule tree used to determine a set of entity script processes to use based on a small set of input values. The agent acts as an intermediary between a client application and an entity's script processes, translating only a few pieces of input data into choices within a potentially large set of usable entity scripts.
Entity Scripts GemScripts These objects contain command scripts for manipulating entities at runtime, using static animation frame sequences and/or dynamic animation effects.
Level-of-Detail Information GemLodInfo These objects contain triangle Level-of-Detail (LOD) reduction information in the form of a "progressive mesh" capable of choosing its triangle count at will. This data is constructed from the vertices and triangles used by a Model object. Once the data is present, the LOD information can be used to reorder the vertices for LOD compatibility, and then create new reduced triangle sets for lower detail levels.
Lipsync Curve GemLipsyncCurve These objects contain a function curve applied to a set of viseme frames at runtime, for lip-syncing.
Materials GemMaterials These objects contain a set of materials composed of various rendering settings, potentially using multiple texture stages. Each triangle in a model has a single material index which refers to one of the materials within these objects.
Model GemModel These objects describe the structure of a polygonal model used by Entity objects. Models are a combination of various other object types including triangle, vertex, and bone information.
Physical Ragdoll GemRagdoll These objects define a physical "ragdoll" composed of primitive solids and constrained joints. The volumes are associated with hierarchy bones, allowing physics-related abilities to operate on the hierarchy.
Point Normal Frames GemNormalFrames These objects contain a set of frames with uncompressed point normals, used for lighting information during vertex animation.
Point Position Frames GemPointFrames These objects contain a set of frames with uncompressed point positions, used for vertex animation.
Quantized Point Normal Frames GemQuantNormalFrames These objects contain a set of frames with quantized (compressed) point normals, used for lighting information during vertex animation.
Quantized Point Position Frames GemQuantPointFrames These objects contain a set of frames with quantized (compressed) point positions, used for vertex animation.
Triangle Adjacency Links GemTriLinks Marked with OBSOLETE / DELETE IF INDICATED. These objects contain triangle adjacency information for a variety of uses. The adjacency information identifies which vertices are connected to which triangles via shared edges, and so forth. This information is typically generated from the raw triangles of a Triangles object, along with the point indices used by the vertices in a Vertices object.
Triangle Rendering Primitives GemTriPrims Marked with OBSOLETE / DELETE IF INDICATED. These objects contain triangle primitives sorted into material batches for optimized rendering. This information is typically generated from the raw triangles of a Triangles object.
Triangles GemTriangles These objects contain raw triangles which refer to a given material index and three vertex indices.
Vertices GemVertices These objects contain model vertices which refer to a given point index, normal index, color index, and multiple texture UV indices.

To have a working (visible) model, it must have at least Bone Weighted Points, Entity Blueprint, Materials, Model, Triangles and Vertices defined.

A GEM file can contain multiple objects in the same category.

Object attributes

Each object has a set of attributes. Golem Studio allows you to view and add attributes to each object freely. Attributes must have a name, array index, type and value. The attribute name is what gives the Golem Studio information about which attribute you intend to modify (unfortunately, you need to enter the name manually for most object types, and there is no documentation about what names are valid for what types). The array index is an integer (its function is unknown, possibly attribute ordering). Valid attribute types are integer value, floating-point value, text string and object reference. The value is, of course, the value of the attribute, limited by the attribute type.

Most objects have pre-defined attributes, most in the form of statistics. Those attributes are read-only as they are auto-generated. Some of them, such as the attributes of the Triangles category objects, are not set as read-only, but changing them (or even deleting them) does not have any effect.

Interface

The Golem Studio window

The Golem Studio interface consists of four independent windows. The main window has a menu bar and, when maximised, contains the other three windows inside it. The Workspace window provides a list of folders, files, categories and objects referenced in the open workspace and allows to manipulate them. The Render window shows a rendered preview of a selected entity. The Entity window controls what entity is displayed in the Render window and allows you to change the parameters of the entity render.

Main window

The main window has a single element that can be interacted with - the menu bar. It has three menus - File, View and Help.

File menu

The File menu allows you to create a new workspace (if no workspace is open), to open an existing workspace (again, only if no workspace is open) and to close a workspace (if one is open). You are not allowed to open more than one workspace at a time. The File menu also has a Preferences option and an Exit button.

While opening and closing a workspace, as well as the program itself, is self-explanatory, more should be said about creating a new workspace. First the program asks you where to put the workspace file (by default in the same directory as the program itself, Unreal2/System). Then a new window, titled New Workspace, opens. Here you need to enter the title of your workspace and the location of the Root folder (the directory in which all the GEM files and folders created within the workspace are stored, by default again Unreal2/System, although Legend Entertainment themselves used Unreal2/Meshes instead). You can also define a custom Textures root folder (the directory where external textures will be kept), although by default it is set to match the workspace Root folder. Lastly, you can select Visual SourceSafe integration options (path to the VSS database, username and password), although it is of low practical use these days as Visual SourceSafe is a rather antiquated version control system, whose job is better left to modern systems, such as Git, which do not require special integration in the first place.

The Preferences window

The Preferences option brings up the Preferences window with three sections. The first section, titled General Preferences, allows you to choose whether the last used workspace should be automatically loaded at program startup (useful when working on a single workspace) and whether to update the Render window when the Golem Studio main window is not on focus (this is usually a bad idea, as the Render window doesn't have a framerate limit and therefore takes up all of the resources of the graphics card that it can spare). The second section is titled Rendering Preferences, and the single option here is the background colour of the Render window. It is set to black by default, but it is recommended to set it to grey or white in order to see untextured entities in the Render window. Note that this setting is only applied after restarting the Golem Studio. The last section is titled Crash Dump Email Preferences (Developer Build Only) and was used for sending crash reports to the developers, but it is of no use these days.

View menu

The View menu has five options: Workspace Window, Entity Window, Render Window, Log Window and Memory Usage. The first three options toggle visibility of the other three windows. It is recommended to keep the Render window disabled until it's necessary in order to keep your GPU cool and using less power. The Log Window option produces a small window with a read-only textbox in it. It appears to have been unused, as no text ever appears there. The Memory Usage option creates a dialog window that shows how much memory the program uses (although it doesn't seem to be accurate, according to the Resource Monitor).

Help menu

The Help menu unfortunately has a single option - About Golem Studio, which produces a dialog window titled About that reads nothing more than Golem Studio - Version 1.01.

Workspace window

The Workspace window is the main part of the program that you can interact with. It contains a folder tree of all folders, subfolders, GEM files, object categories and objects listed. Each of these data types can be interacted with in different ways.

Workspace

The root element of the tree is the open workspace. Right-clicking on it provides four options - New, Save All, Reload All and SourceSafe. The New option allows you to create a new folder or a new GEM file, which will be placed in the Root folder of the workspace. Save All is used to save changes to any modified GEM files that the open workspace covers. Reload All is the opposite - it allows to discard any pending changes to the GEM files. Note that these options do not cover folders or file creation/deletion - those actions take place immediately, so they don't need to be saved and cannot be reloaded. The SourceSafe option is greyed out when SourceSafe integration is off.

Folder

Right-clicking on a folder or a subfolder allows you to choose from the same four options, plus two new - Rename and Delete. Unfortunately, there is no option to move the folders, but that can be worked around by physically moving the folders (or GEM files) outside the Golem Studio in the Root folder. The workspace automatically refreshes itself on next program start in that event. Alternatively, using Rename also allows for moving the files and folders (if you have a file File.gem and a folder Folder, renaming the file to Folder/File.gem will move it inside the folder, and renaming it to ../File.gem will move it back up; these changes show up correctly only after reloading the program).

GEM file

The New Object window

If you right-click on a GEM file, you will see options similar to the ones above, but with two new additions and slight changes. The New option here allows you to create only one type of element - object. Pressing the New Object button opens a new window with all the possible objects listed. After selecting one and pressing OK, you need to enter a (unique) name for the new object. The newly added object automatically contains several preset attributes depending on the object category.

The Save All and Reload All buttons are replaced with Save and Reload buttons when working with GEM files, and they only affect the selected GEM file instead of every changed GEM file in the workspace.

There are two new additions to the context menu when working with GEM files. First is the Import... menu, which allows you to import either static untextured 3DS Max files, or ActorX PSK/PSA files.

The second new option is the Generate... menu that allows for generating a basic cube or plane entity. If generating a cube, you will have to input the name of the cube entity and its associated objects and the size of the cube (presumably in Unreal Units). If creating a plane (sheet), you will have to give not only a unique name and size, but also the number of subdivisions the plane should have and texture scaling percentage (both of which have no immediate effect as the texture applied is purely black, but they affect in-game performance and appearance with an assigned material). That will create 8 new objects per generated shape - Bone Hierarchy, Bone Weighted Points, Entity Blueprint, Materials, Model, Texture UV Frames, Triangles and Vertices.

Object category

Object categories are listed mainly for organisational purposes, so there are just two options in the context menu. The first one is View Description that shows the description of each category, as noted in the Program logic section of this page. The other options is Delete All that removes all of the objects in the selected category, and therefore the category itself as well.

Object

The context menu entries differ slightly depending on the category of the object that is selected. See below for more information on individual object settings. However, the main options are the same across all objects. The first option is View/Modify... that opens the Edit Object window for editing attributes of the object. Whether the window will have additional tabs depends on the object category. The Move option allows you to move the object from one GEM file to another. Duplicate creates a clone of the object with a new name. The Redirect option changes any existing references to the object (from other objects) to point to a new chosen object. the Rename and Delete options are self-explanatory.

If an object is changed in any way, an asterisk will appear near it and the GEM file the object belongs to will become bolded. That indicates that there are unsaved changes. You will have to choose one of the save options to save your changes, or a Reload option to discard them. Exiting the program will discard any pending changes.

Edit Object

The Edit Object window

The Edit Object attribute tab is a little more complex than the other windows. The tab itself lists all of the attributes an object has set by using four columns - Name, ArIntex, Type and Value. In order to modify the attributes, you need to right-click (or double-click, in this window both are interchangeable) on the cell you wish to edit. For instance, to edit the name of a parameter, you have to right-click the name cell of that parameter - right-clicking anywhere else will not allow you to do that.

If an attribute is set to be read-only, or if you right-click on an empty row, the only option available from the menu will be Create New Attribute. If you choose it, you will need to enter a name for the attribute. Unlike with objects, attribute names don't have to be unique - in fact, only hardcoded names are identified by Golem Studio, any other entries have no effect. If there are several attributes with the same name, the array index of the second attribute will be higher than the first. The Create New Attribute option is available not only if there are no other options, but also if those options are present.

The context menu entries when right-clicking in the Name column, beside Create New Attribute, are Rename Attribute and Delete Attribute. They are rather self-explanatory.

If you right-click or double-click on the ArIndex or Value tabs, Golem Studio will bring up a prompt where you can input the new value of either. If you enter a string where an integer is expected, the new value will be 0. If you enter a float where an integer is expected, the resulting value will be equal to the result of the floor(FloatValue) function. If you are attempting to edit the value of an attribute of type Object, you will be presented with a list of all entries in the workspace, not unlike what you get when you try to move an object.

The context menu options in the Type column allow you to choose between the four possible attribute types like detailed above.

Render window

The Render window shows the selected entity. It's rather straightforward. You can control the view by clicking and draggin your mouse, similarly to UnrealEd, but the mouse movements do something different here. Dragging the left mouse button allows you to spin around the entity, dragging the right mouse button zooms in and out, while dragging both does both actions at the same time. There is no way to adjust the pivot location outside of reimporting the mesh.

The Render window doesn't have a framerate limiter, so it might be taxing on your computer resources. It is best to keep it off whenever it's not in use.

Setting the background colour to something other than the default black will allow you to see unlit objects. That is useful whenever the lighting system gets bugged and doesn't illuminate the scene.

Entity window

The Entity window controls what is shown in the Render window. It consists of four parts. The first one, titled Entity, has two text boxes and two buttons. The text box just under the word Entity indicates the currently selected entity. The Change button gives a list of all entities available in the open workspace. Below that is another text box labelled Params. Pressing the Change button asks for a text string. Unfortunately, there is no indication about what the parameters could be. Possibly it could enable or disable some attributes of the selected Entity blueprint.

The second section is titled Satellite Node Name and has a yer another set of a text box and a Change button. Once again, it requires a text string. The function of this section is so far unknown. Possibly relates to the head tracking system.

At the bottom of the window is a big button labelled Refresh. It reloads the entity after its blueprint or its references were changed.

The section above the refresh button is the most important part of the window. It consists of two tabs - Processes and Agent.

Processes tab

The Processes tab contains a list of entity scripts currently running. To start scripts, there are two options. One is to manually set a script into a vacant slot, detailed below. The other is to have Golem Studio set it automatically by enabling Agent mode in the Agent tab.

The # column indicates the slot, with a gem icon marking slots which are occupied. The Script column shows the names of all currently running scripts, and other scripts that the currently running scripts are calling, if any. Right-clicking on any slot brings up a list of all entity scripts, where you can choose which one to play in that slot. The Time column shows a percentage value indicating how much of the animation has already played.

To the right of the checkbox below the list is the slot number and name of the currently selected process.

Below the list is a checkbox Frame-by-frame. If you select a slot, then check this checkbox, that slot will become frozen in time (while all other slots will continue playing). Note that this is persistent even if you change the entity - its scripts in the frozen slots will stay frozen as well. Below this checkbox are four buttons. The << and >> buttons move the animation by 30 frames backwards or forward in time, respectively. < and > buttons do the same, but they move the animation only by one frame.

Agent tab

The Agent tab controls preset assembled animations by utilising an Entity Script Agent. The tab contains another pane with two tabs. At the bottom is a checkbox Enable Agent Mode that turns on the Agent mode. It has to be checked for the complex animations to play.

Inputs tab