|
||
|
|
Tutorial 2: Making Art Files or Thumbnails
Introduction Pictures of the train models are used to assist in selecting locomotives and rolling stock in the Trainz Driver menu, for Trainz TRS2004 and earlier. In Trainz2006, the 512 by 512 art file picture is not used, but the art icon file is still used. The art icon file is now replaced by a thumbnail picture referenced in the config.txt file. Earlier models with the original art icon file will still function in TRS2006. In TRS2004 or earlier: 1. A large perspective view of the train model is used for the main screen and shows whenever the model in the menu is highlighted by the cursor. This picture is a 512 by 512 tga file. 2. A smaller icon picture (side view) of the model, shows near the model name, and the picture is placed in the consist when you make up a train. This picture is a 128 by 64 tga file. For TRS2006, this is specified as a thumbnail file, not an art file. If you click on the main picture, in TRS2004 a smaller rotating picture is shown, taken from the model mesh, not the art file. In TRS2006 there is only a rotating picture shown, derived from the mesh. The pictures are made by the model creator and included in special directories in the model files. The pictures should only show the model itself, with some additional scenery such as the rail track for the perspective view picture. All other parts of the picture file surrounding the model itself are made transparent by including an alpha layer in the picture file. This allows Trainz to "set" the picture into the Driver menu screen. This tutorial will show you how to use Paint Shop Pro and TGATool2 to make these files, and will show the directory structure to enable them to show in the Surveyor menu screen. For TRS2006 you only need to make the smaller icon file, as a thumbnail. Computer Software Paint Shop Pro and TGATool2 are used. There is an excellent tutorial done by Bruce Kennewell (3801) covering the making of the Art files using TGATool2 but I have found a number of people still have trouble producing successful files. The tutorial is available from: http://www.auran.com/trainz/downloadst_viewasset.php?AssetID=106 A new version beta copy of TGATool2 is available, but this tutorial uses an earlier version which most would have. TGATool2 is available from: http://www.mnwright.btinternet.co.uk/train/tgatool2.htm Installation of TGATool2 Paint Shop and TGATool2 work together, and after installing TGATool2 you need to tell it where the Paint Shop program is so it can use that as an editor. Open TGATool2 and in the top menu select "Preferences - Select Editing Program" to locate Paint Shop. The dialogue box that opens allows you to find and choose the file to run Paint Shop, usually shown as psp.exe. Open that file. TGATool2 will now send and retrieve files to and from Paint Shop, for editing and reloading into TGATool2. Getting the Pictures Even though you may not have the art file pictures set up in the correct format and in their correct directories, you can still choose the model in the Trainz Driver menu, so you can place it in a scene and take screen snapshots using the Print Screen Key. You will just not have any picture icons showing in the menu. You could copy picture files for other models and place them in the correct directories to have a picture or icon show, it will just not be the correct one for this model. Screenshots taken in Trainz Driver will be placed as scene###.tga files in the directory Program Files\Auran\Trainz\Screenshots. The "Trainz" directory may be "Trainz2004" or "Trainz 2006" for later versions. As an example I will use my model of the Marion Steam Shovel mounted on a flat car. This is placed in Driver and screenshots are taken as in the examples below. The size of the resulting picture depends on your Trainz screen resolution. For the icon picture, the second flat car will be removed from the picture, as it is a separate model. The Perspective View The Side on View: Initial Editing of the Pictures - Cropping I find it helpful to open the images in Paint Shop, resize them to the correct sizes, and remove the backgrounds before using TGATool2 to make the Alpha channels. With the background removed it is easier to fill it with black later in the process. Load the perspective view into Paint Shop. My screen shot was 1024 by 768 pixels. We need this picture to be 512 by 512 pixels. In Paint Shop choose the Crop tool and drag a box around the main part of the picture you want in the final. If possible make it 512 by 512 but we can adjust this as we go. The crop tool is shown in the ellipse on the left of the picture below. By starting in one corner and dragging the lines you can define an area to include the parts of the picture we require. In the bottom left of the Paint Shop screen you can see the box size as you drag. Release the mouse button when it is about the correct size, and then drag the lines or corners of the box until it is correct (512 by 512). Watch the bottom left of the screen for the box size. You can also click within the box, hold the mouse key down and move the whole box to frame the picture. When you have it framed correctly double click the left mouse button inside the box to crop it to size. By cropping the picture as above we do not change the size of the image, and therefore retain the original quality. What if the 512 by 512 box is too small to surround the image? Just make the crop box square to suit, say 600 by 600 and follow the same procedure, reducing it to 512 by 512 in Paint Shop. Choose the "Image menu - Resize", then enter the 512 pixel sizes in the dialogue box. The "Maintain Aspect Ratio" box should be unchecked as it can give you unexpected results if the original cropped image was not quite square. This can be an overlooked problem when scaling textures for Gmax Initial Editing of the Pictures - Removing the Background The picture is now the correct size, and we will remove all the unwanted background, this will be transparent in the final. There are a number of selection tools that you can use, the Magic Wand, the Box selection or the Freehand selection, These tools are shown in the picture below, and after selecting a portion of the picture to be removed, press the Delete key to remove it. Carefully work around the picture until you are satisfied. Experiment with the tools as each has different attributes. You may find the Freehand tool in "Point to Point" mode is best for irregular picture outlines, selecting a number of points then, to close the loop, double clicking the left mouse button. Use the Tool Options box for each tool to set the different ways to use them.
The Freehand Options box is shown below as an example of the choices for the tool. The final picture should now be surrounded by a background color, usually white or yellow. We need to be able to select all the background and fill it with black later. The image is ready for TGATool2, if the background is a different color from the edges of the model. If the background is the same color as the model near the edges, it will be hard to select it separately later. We can remove the background and make it transparent, by promoting the image to a layer (select Layers - Promote to Layer), selecting all the background color then removing it with the Delete key. If you had promoted the image to a layer before we started deleting areas, the background would show a checkered pattern, meaning it is transparent. Alternatively, while you are deleting the background using the selection tools, you could fill it with a color that is different from any part of the model. This could then be replaced later with the background black. Another way to do it is to draw outlines around the model parts to separate the model color from the background color. Making the Trainz Directories - TRS2004 or earlier Within the Custom\Trains directory for TRS 2004 or earlier, you need to make subdirectories for the config file, the model .im files and the art file we will make. You also need to create some text files. The structure of these directories and all the files required are as shown, under the World\Custom\Trains folder: The model is called "prrshovel". Make a directory called that, and then make the other directories as shown. Make sure you follow the same naming convention in all sub directories. You will need to create the .texture files using notepad or similar. Place the prrshovel_art_512.tga file in the directory as shown. The other icon file will be made later. As we will be overwriting these files as we create the alpha channel, please keep spare copies of these files, in a safe place, just in case! Making the Main Image with a Black Background Start TGATool2. We need to load the art file, so use the load menu, and load the prrshovel_art_512.tga file. The image should be in TGATool2. Even if we made the background transparent it will show as white here. On the right hand side of TGATool2 you will see the alpha menu. We need to create the alpha channel here. Click on the Create Alpha Channel button and the first dialogue box above will open. Click on ok. Now click on the Create Alpha Template, and the second dialogue box above will open. Click on ok. The program will now create the grey scale image for the picture, which will be further worked on to make a pure black and white reversed image for the alpha channel. Editing the Main Image in Paint Shop In the top left of the menu bar, select the "Image - send Main Image to Editor". Paint Shop will open with the image to be edited. Using the magic wand tool, select all the white background areas, holding down the Shift key, while you add each area to the selection. Select the Flood Fill tool; choose pure black from the color palette, and click somewhere in the selected area to fill with black. You can make sure it was pure black by holding the dropper color selection tool over the black area and verify it shows 0,0,0. When you are satisfied, click the Save File button. Reloading the Main Image in TGATool2 In TGATool2 we need to reload the edited image as the main picture layer. Open the image menu and click on the "Reload after Edit" and the image will be imported now showing the black background. Making the Alpha Channel We now send the Alpha channel to the Paint Shop editor, opening the Image menu and clicking on "Send Alpha Channel to Editor". In Paint Shop, select the magic wand tool and click on all the white areas, while holding down the Shift key. It is important to select them all. Using the flood fill tool and making sure the color is black 0,0,0, click in the selected white area to fill it with black. Note that the selected area is still showing the dotted lines surrounding the area chosen. We need to choose the other areas (the actual grey model) so we will invert the selection. Go to the top Paint Shop menu and open the "Selections - Invert" option and click on it. The dotted selections will now be inverted to enclose all the grey areas of the model. These need to be filled with white, so choose the Flood Fill Tool again, then go to the color palette on the right hand side and instead of black, choose white 255,255,255. Note that the palette is only in shades of grey. You may notice that the first color rectangle shows black and the one below shows white. The first one is placed using the left mouse button and the second using the right mouse button. If this is so, using the right mouse button click in the selected area over the model and it should all change to white. Alternatively, click on the black rectangle in the color palette and when the dialogue box opens, click on the whitest square showing, to set white on the left mouse button. Use this button to click in the selected area. You should now have a completely white model image surrounded by black. Save this by clicking on the Save menu box as before. Make sure this is so by using the dropper tool to verify the white is 255,255,255 and the black is 0,0,0 Reloading the Alpha Channel in TGATool2 In TGATool2, load the new image from "Image - Reload after Edit". Note it is the bottom selection in the dialogue box below the "Send Alpha…..". You will see the Alpha Channel box now shows the reversed black and white Alpha channel, not grey scale. Saving the Final Image with the Alpha Channel Included All we need to do now is save it as the art file, so choose the Save As option and find the Custom\Trainz\prrshovel\prrshovel_art Directory where you will save it over the original file, prrshovel_art_512.tga The file is now complete and the alpha channel is a part of the file Making the Icon File The procedure for making the icon file is the same as for the larger file. The difference is that the file size is 128 by 64, so using the crop tool, surround the side on image and crop it to size. If the original model image is larger than 128 by 64, make the crop box size to suit, say 400 by 200 (keeping the 2:1 size ratio) then after cropping, shrink the image to the correct size, (128 by 64). In most cases the image has to be reduced by a large amount, although you can make the reduction ratio smaller if the original screenshot of the model were very small. Remember that large reductions in size greatly degrade the image quality, and you may have to do touch-up operations along edges. Reducing also makes Paint Shop anti alias the edges, feathering the detail to blend the edge colors. This can produce light or white colors along the edges that should be touched up to match the model colors; otherwise a white halo can surround the finished model. One important thing, Trainz seems to use the upper half of the icon when displaying it on the consist bar. It is best to place the image towards the top of the picture so Trainz does not cut off the lower parts including the wheels. Sometimes for small rolling stock, if the image fills the 128 by 64 frame size, it will appear too large in Trainz, in comparison with other passenger car rolling stock. You may need to reduce the image to suit and redo the art file. Lastly, the icon file should be orientated correctly, so the icon faces the same direction as the actual model when in Driver. If you have it facing the wrong way, just export both the main image and the alpha channel to Paint Shop, mirror them (Image - Mirror menu option ) and reload them into TGATool2 before re-saving the file. You will also find the Undo key useful! TRS2006 Art Icon File Only the 128 by 64 art icon file is used in TRS2006. This should be a tga file (supports an alpha channel) included with the model. You do not need to use the special art file directories described above. The Config.txt file entry would look like this, but of course you would enter the data in the thumbnails container using Content Creator Plus:
The specified width and height must match the actual image width and height. Summary The procedures are reasonably simple if you follow the steps carefully. I have tried to show all the detailed steps, and with the diagrams, the tutorial may seem large and daunting. For those who are familiar with Paint Shop, many of the steps will be already familiar. Please give it a try, and I hope you can now make successful Art files or thumbnails for Trainz. Ian Manion (Vulcan) September 2005 From Prowler901 (Todd Hohlenkamp 19 August 2003) Todd has an excellent way to make it easier to delete the background: "Something that I've done to make art files easier to work with is this: 1. Create a new map texture, and make it solid black (0,0,0). Now place your new item on the track mark. Enter Driver and take your screenshots. Then follow on as Ian outlines. What this method does is make it much easier to cut out the background. In fact you may only have to recolor portions of it, since most of it will already be the black that you need it to be. Just use the dropper tool to check that the black is all 0,0,0." Thanks Todd This is a screenshot taken using the setup by Todd. While it does not have all the areas pure black, it is easy to use the Magic Wand tool to select all the black areas (holding down the Shift key while selecting), and then filling them with black 0,0,0. If you think the model picture is a bit dark, you can adjust the color and brightness. Use the "Colors - Adjust - Brightness/Contrast" option (or use Shift-B). This might make the near black areas much lighter, and be harder to select with the Magic Wand tool. Alternatively, select all the black areas, then delete them. Adjust the main image colors, then reselect the deleted areas and fill them with black. Experiment. Amendment Notes and Comments 4/09/05 Updated to for TRS2006 changes to Art file use. Still valid for UTC and TRS2004 |
|