Background Tool of the Geeks (BTG) User Guide

"Installation:

To install the BTG, extract the contents of the zipfile into a
a directory on your hard drive, such as "c:\btg".  Be sure you
extract pathnames as well; the BTG needs to access its bitmaps and
undo directories exactly as placed in the .zip.

You can then simply run BTG.exe, and start editing backgrounds.
Check out btg.doc for information on how to use the tool itself.

Note: any backgrounds you work on must be present in the same
directory as BTG.exe, ie. "c:\btg".  Sorry - we made the mistake
of writing the BTG using MFC (Microsoft Foundation Classes), and
boy did we pay the price.  Try saving to a read-only file and
you'll get a helpful "File Not Found" error message, MFC's default
for all file-related errors.  Argh."
-------------

0	Introduction	1
0.0	Hotkeys	1
1	Making a Background	2
1.0	Getting started	2
1.1	Basic Background Creation	2
1.2	Getting Your Background Into the Game	4
2	Advanced Techniques	5

0	Introduction

The purpose of this guide is to teach you how to make a background for Homeworld and get it into the game.

The BTG is a tool that allows you to create a flat polygonal mesh, assign colours to each of the vertices, and place small bitmap stars.  In the game, this flat mesh is mapped onto a giant sphere that encircles the level.  Goraud shading between vertices is used to render the background.

0.0	Hotkeys

Here is a table of hotkeys used in the BTG:

Editing Modes	
D, G	Polygon Edit Mode	
S	Star Mode	
V, X	Vertex Mode	
L	Light mode	

Selection Controls	
Leftclick	Select vertex / polygon	
C	Clear selection	
SHIFT + Right mouse button + drag mouse	Vertex Edit Mode: Add vertices to selection
Polygon Edit Mode: Clear selection 
Star Edit Mode: Clear selection	
Right mouse button + drag mouse	Vertex Edit Mode: Clear selected vertices
Polygon Edit Mode: Add polygons to selection
Star Edit Mode: Add stars to selection	

Camera Controls	
NumPad +	Zoom in	
NumPad -	Zoom out	
1	Reset zoom to 0.5 and focus on top left hand corner of background. (Resets the frame to full screen)	
CTRL+ Left mouse button + Drag Mouse	Scrolls the work surface	
Cursor keys	Scrolls jerkily	

Placement / Editing Commands	
Leftclick	Place a vertex / star or connect vertices to form polygons	
\	Split polygon	
M	Merge vertices	
Backspace	Toggle goraud shading (polygon colouring) on/off	
=	Toggle reference image on/off	
CTRL + Z	Undo last action 	
CTRL + R	Redo last action	
P	Polygon Edit Mode: Polygon counter at bottom left	
R + leftclick	Vertex Edit Mode: updates the colour sliders with the colour of the pixel under the cursor (from reference image or polygons)	
[Alt] + leftclick	Vertex Edit Mode: updates the target vertex with the colour values of the colour sliders	
Delete	Vertex Edit Mode: Deletes selected vertices
Polygon Edit Mode: Deletes selected polygons
Star Edit Mode: Deletes selected stars	

Note: there are no cut, copy, and paste commands. 
1	Making a Background

1.0	Getting started

•	Load up the BTG
•	Select File, New
•	You’ll be given an empty frame on a black background.  This is the rectangular region that will be mapped spherically in the game.
•	All the control windows will be arranged in a row across the top of the screen. Reposition them to free up working screen space. A column down the right hand side of the screen works quite well, or you can arrange them floating over the work surface - wherever it is most convenient for you.

1.1	Basic Background Creation

Editing Modes

The BTG has 3 editing modes accessible by hotkeys:

Polygon Edit Mode (D, G)
	Lets you edit polygons	
Vertex Edit Mode (V, X)
	Lets you place vertices	
Star Edit Mode (S)
	Lets you place, move, and delete stars	
Light Edit Mode (L)
	Lets you place, move, and delete lights	

Viewing Modes

The BTG has 3 viewing modes.  These are cycled by pressing [SPACE].

Vertices	Displays vertices as white boxes.  The colour inside the box is the colour assigned to the vertex.  A selected vertex is drawn as a red box.	
Polygons and Vertices	Displays polygons as white lines, and vertices as above.	
Background only	Turns off all vertices and polygons.	

Background-only is the default viewing mode.  To do any actual background creation, however, you’ll need to use the other modes.  Lights are visible only when in Light Edit Mode.

How to Set the Background Colour

Sometimes a background may have a predominant uniform colour behind the detailed areas. For example, even the darkest blacks in Homeworld’s space were coloured slightly blue-grey. There are 3 sliders that control the RGB value of this background colour.  These are BG Red, BG Green, and BG Blue.  Leftclick on one of these sliders and drag the mouse to change the background colour, or type a number in directly.  This colour will show up anywhere where you haven’t created polygons, or through vertices that have alpha (transparency) set. In this way you can still make colourful backgrounds but by using considerably less polygons to cover the coloured area.

The BG Alpha slider exists only for the convenience of Light Edit Mode, and has no effect on the background colour itself.

How to Create Vertices

•	Press [V] to go into Vertex Edit Mode.
•	Leftclick anywhere on the screen to place a vertex there (make sure you’re in the right viewing mode so you can see the vertices you’re placing – they’ll look like little white boxes).
•	To select a vertex, leftclick on it, the white box should turn red.
•	To move a vertex, leftclick on it and hold the mouse button.  Then drag the mouse to move the vertex around on screen.
Note: if more than one vertex is selected, they will all move. Vertices will never move outside of the frame boundaries. They will just ‘bunch up’ at the edges.

How to Create Polygons

•	Once you’ve placed some vertices, press [D] or [G] to go into Polygon Edit Mode.
•	Hit [SPACE] to go into Polygon View Mode.
•	To create a polygon, leftclick on 3 vertices in any order.  The BTG will automatically make a triangular polygon between them. 
Note: if you see nothing, you either might not be in Polygon Edit Mode, (Hit [SPACE] until you can see your new poly) or you failed to actually select three vertices. (Try again).
•	This is how you create polygons in the BTG: by dropping vertices down in Vertex Edit Mode, then making them into polygons in Polygon Edit Mode.
•	To select a polygon, leftclick in the middle of it.  The edges will turn red to indicate it’s selected.
•	To move a polygon, leftclick on it and hold the mouse button.  Then drag the mouse to move the polygon.

How to Assign Vertex Colour

•	Once you’ve got some polygons in place, go into Vertex Edit Mode [V] and select a vertex to assign some colour to it.
•	Leftclick on one of the Red / Green / Blue sliders to change the RGB value of the vertex.  Or, type the RGB value directly into the box next to the slider. This will change the colour of the vertex and the BTG will show the goraud shading on the polygons.
Nifty Tips: to ‘pick up’ the colour of a vertex and assign it to another one, leftclick on the source vertex (the colour sliders will update) then hold down [Alt] and leftclick on the target vertex. It should now be the same colour as the source vertex. Note also that you can ‘pick up’ colours from anywhere on the polygonal background. To do this, select the vertex you want to edit then hold down [R] and leftclick wherever you want to ‘pick up’ colour from.  The selected vertex will now change colour accordingly.

How to Create Stars

•	Press [S] to enter Star Edit Mode.
Note: it’s a good idea to be in Background Only Viewing Mode (hit [SPACE] a few times) to work on stars. All the vertices and polys on-screen will make stars very hard to see otherwise.
•	There is a control window with a scrolling list of .tga files.  They range from small to large. Select one to choose the star to place.
•	Leftclick anywhere on the screen to place a star there.
•	Note that Stars can be assigned a colour the same way as a vertex colour.
•	To move a star, leftclick on it and hold down the mouse button.  Then drag the mouse to move the star around on screen.
Note: stars are tough on the game’s framerate, (especially the big ones) so try not to use too many even though it’s very tempting!

How to Create Lights
1	Press [L] to enter Light Edit Mode.
2	Leftclick anywhere on the screen to place a light there.  You may place a maximum of 2 lights.
3	Lights can be assigned a colour the same way as a vertex colour.
Note: a light’s intensity corresponds to the value of the Alpha slider.  That is, you can adjust the colour (red, green, blue) and intensity (“alpha”) of a light.
1	To move a light, leftclick on it and hold down the mouse button.  Then drag the mouse to move the light around the screen.
Note: lights are generally placed on major features of the background that seem like they should be emitting light, like a bright red nebula in front of the player or a hot white star above and behind the universe plane.
1	Note the status bar at the bottom of the BTG window.  When in Light Edit Mode it displays the number of lights in the scene (0, 1, or 2) and which light(s) you have selected (key, fill, or both).
2	When you have the key light selecte, adjusting the Background colour sliders adjusts the scene’s global ambient colour, eg. the light colour on the back side of a ship receiving directional light only from the front.
Note: you generally want to balance the key and fill lights such that very little global ambient is required to illuminate objects in the game.  No lighting file that shipped with Homeworld had more than 40% ambient, a value of 102 on the BTG colour scale.
1	Homeworld itself is the only way to preview a lighting arrangement.

Note: for reference, try loading up an existing btg file from those provided.

1.2	Getting Your Background Into the Game

Note: this assumes you already have a map to place your .btg file into.  If you don’t, you can create one using the MissionMan or download one of the user-created maps from www.relicnews.com or www.guidestone.com.

To view your background in the game, do the following:

•	Go to the File menu, and select Save
•	Browse to the directory where the map is. Type in the filename you want to save it as.  Make sure to add the extension “.btg” to the file.
•	Click Save

Note: you need to put the btg file in each map directory.  So if a map has a 2-player version, a 3-player version, etc. you need to save the btg file into each directory.

•	Next, load the .level file in a text editor like Notepad
•	It will have a line that reads “Background		ez01, 180,0”
•	Change “ez01” to the name of your file.  Don’t include the .btg extenstion.
•	So if you called named your file “Nebula.btg”  it would read:                                                    “Background		Nebula, 180,0”
•	Save the .level file with your changes

Note: you can also change the background attribute in MissionMan, then re-generate the .level file.

•	Lastly, load up the level in Homeworld, either in a Multiplayer Skirmish, Lan, or Internet game.
•	If you’re playing an Internet game, the btg file will be transferred automatically (unless it’s over 60K)

2	Advanced Techniques

Setting Vertex Alpha

To set the alpha (transparency) of a vertex, select it and leftclick on the Alpha slider bar, or type the alpha value in directly.  This will allow the background colour to show through.
Note: the game engine will occasionally alter the background colour when entering a cloud bank, for instance.  In this case, a background that was created using black with no transparency to blend into the blackness of space will exhibit an unsightly black fringe.  Avoid this by using alpha to blend features, and test by adjusting the background colour from within the BTG to determine the effect.

Setting Vertex Brightness

To set the brightness of a vertex, select it and leftclick on the Brightness slider bar, or type the brightness value in directly.  This is particularly useful if you want to change the overall brightness of an entire area of your background. If this is the case, you would select all the vertices in the area you want to effect and adjust the brightness values accordingly. 
Note: Take care when doing this and save your work often – it gets weird really fast as brightness values are lost into the mix of repeated adjustments.

Splitting Polygons

To split a polygon:

•	Make sure you’re in Polygon Edit Mode (D)
•	Select a polygon by leftclicking in it.  The edges will turn red to indicate it’s selected
•	Press [ or ] to cycle through the edges.  The selected edge will turn green to indicate it’s selected.
•	Press [\] to split the polygon into two.

Note: when you split a polygon that shares an edge with another polygon, a gap will be created between the two edges.  To get rid of this gap, or ‘seam’, do the following:

•	Split the polygon on the other side of the gap
•	You should now have two split polygons, with a gap in the middle of them.
•	Go into Vertex Edit Mode by pressing [V]
•	Select one of the newly-created vertices and move it on top of the other newly-created vertex
•	Clear the selection by pressing [C]
•	Hold down the right mouse button and drag a bandbox around both vertices (which should now be on top of each other)
•	Press [M] to merge the vertices

Note: the two vertices have to be on top of each other.  If they’re a bit off, the Merge command won’t work.  You may need to zoom in to position the vertices carefully if they’re not merging.

Distortion at the poles

Because the btg file is spherically mapped, there will be increasingly serious distortion towards the poles of the sphere.  This means any polygons you create near the top or bottom of the frame will be distorted.  To view what your background will look like in the game, use the 3D viewing mode.

Flat / 3D Viewing Modes

By default, the BTG views the background ‘flat’.  To see how the background will look in the game (when it’s spherically mapped), leftclick on the “3D” radio button.  To rotate the camera, leftclick and hold down the mouse button while dragging the mouse.

Using a Targa File as a Reference Image

The BTG allows you to use a targa (.tga) file as a reference image ‘backdrop’ to guide your background building efforts.  To load up a reference image:

•	Go to the BTG menu and select LoadBackground
•	Browse to the directory with your .tga file and load it
•	The image will now appear behind the polygons / vertices of  your background

Note: to toggle the reference image on/off, press [=]

A reference image will provide you with both the outlines of the desired background forms (like clouds) and the colours you wish to use.  The BTG runs a lot slower when a reference image is loaded.

To maximize the use of your reference image:

1	Load up the reference .tga as described above.
2	In Vertex Edit Mode [V], place vertices along the edges of the forms you want to trace. They should be visible ‘floating over’ the reference image backdrop.
3	Select a vertex, hold down [R] and leftclick on the reference image as close to the vertex as possible. This will change the colour of the vertex to the colour of the reference image where you clicked. In this way you can assign colours to your vertexes that replicate your reference image.
4	In Polygon Edit Mode [G], construct polygons between the vertices. It should start looking more like your reference image now.
5	Hit [Backspace] to toggle off and on your polygons. You will be able to see how accurate your background is compared to your reference image and adjust it’s colours and vertex positions accordingly.

Creating Your Own Stars

If you like, you can create your own star bitmaps in a 3rd-party program like Photoshop.  Bitmaps must be placed in the bitmaps directory which you will find where you installed the BTG program.

Bitmaps must be sized in a power of 2, ie. 2, 4, 8, 16, 32, etc.  Though width and height do not have to be identical, they must both be powers of 2.  Bitmaps must have an alpha channel specified unless you want to be mapping a square block onto your background.

Bitmaps must be saved as 32bit Targa files (.TGA).  32bit only, please.

Crash Recovery

In the unlikely event of a crash, reload the BTG and hit ‘Redo’ over and over again. You will witness your work rebuild itself before your eyes until it is back where you were before the crash. Additional Redos will revert it to an older version, so just hit ‘Undo’ and it will go backwards until you are back where you want to be again. 

Poly Counts

The average poly count for a background in Homeworld was under 900 polys. The more polys, the slower the framerate. Keep an eye on your poly count by pressing [P] in Polygon Edit Mode. The figure will appear at the bottom left hand corner of your screen.