Basemapz

From TrainzOnline
Revision as of 04:36, 17 November 2016 by Modelermj (Talk | contribs)

Jump to: navigation, search

The Basemapz program is a stand-alone application developed by ModelerMJ. It is supplied with Trainz Model Railroad 2017 and is also available from the author's website.

This page covers Version 1.0.

Contents

Introduction

This document describes Version 1.0 of Basemapz, a Windows™ application that allows you to quickly transfer a model railroad track plan image into the Trainz™ Railroad Simulator environment. Basemapz is compatible with Windows 7 through 10; and with Trainz versions TS2009, TS2010, TS12, TS12-SP1 and T:ANE.

Using an easy-to-understand process, Basemapz produces a complete Trainz Route containing the required arrangement of baseboards, plus a collection of auto-positioned basemap carrier objects that each contain the section of the track plan image that falls on one baseboard. The output of Basemapz is placed in a series of folders that can be imported into Trainz Content Manager in a single operation, where the Route is then immediately available for editing in Surveyor.

Here are the basic steps in the process:

  • Start by acquiring a track plan image. This can be done by scanning a plan out of a book or magazine that you own, or by downloading a track plan image from one of many web sites that provide them.
  • Once you have the image, it must be cropped as closely as possible around the boundaries of the benchwork so that it can be accurately scaled into the Trainz environment.
  • Then, if the image is a bit crooked (as often happens when it is scanned), it needs to be deskewed by rotating it just a tiny bit so that the edges are straight in the vertical and horizontal directions; this makes the images line up nicely with the terrain grid in Trainz.
  • Finally, save the image in a folder all by itself; this is extremely important if you don’t want to lose work.
  • Next, you need to gather some information about the track plan.
    • You need to know what scale it was designed in – HO, N, and so on.
    • You also need to know the overall dimensions of the plan, in feet and inches.
  • Once you have this information, you can load the image into Basemapz; specify the scale of the plan; specify its size in the X and Y directions; and generate a preview that shows how the plan will look when it is exported to Trainz.
    • If something doesn’t look right, you can make adjustments and generate as many previews as needed until you are satisfied with the results.
  • When the preview is satisfactory, a single button click brings up a dialog that allows you to specify information that Trainz needs to properly process the objects that are exported by Basemapz. This includes:
    • A starting Content ID number, which is used and incremented for each basemap produced.
    • Your Trainz User ID, author name, and contact information.
    • Any license terms you want included.
    • And, finally, whether you want a complete Trainz Route to be generated, or just the basemaps.
  • When you enter this information and click OK at the bottom of the dialog, Basemapz creates a complete Trainz Route of the required size, auto-generating all the binary “map-file” components (if you specified that you wanted a Route to be generated).
    • Terrain is all flat.
    • The 5M grid is always used.
  • Basemapz also generates a collection of basemap carrier objects that each contain the section of the track plan image that falls on one baseboard.
    • These carriers are auto-positioned in the route as appropriate, at a height of 0.1 meters above the terrain, and are placed on their own (locked) layer.
  • Additional layers are also created to contain typical Model Railroadz items like digholes, fascia, and supports; as well as the floor, walls and ceiling.
  • All this is exported to a series of sub-folders within a single main folder, complete with “config.txt” and thumbnail files, the collection of which can then be imported straight in-to Content Manager in a single operation.
  • The route can then be opened immediately in Surveyor, and track and other items can be placed in the usual way, using the basemap images as a guide.
    • It is highly recommended that you turn on the Process Objects Behind Camera option (in T:ANE) to ensure the basemaps stay visible as you pan around.
  • When the basemaps are no longer needed, they must be deleted to avoid violating the copyright of the track plan image owner.

If any of this sounds complicated, don’t worry – it’s actually very simple, and each of these steps will be explained in detail in later sections of this document.

Legal Considerations

Model Railroad Track Plan Images are copyrighted material, and as such there are restrictions as to what you can do with them. Based on the concept of fair use, it is generally accepted that you can use these plans as an aid in constructing your own version of a given layout, and that you are allowed to make copies and/or derivative versions of the plans for that purpose only.

In the case of Basemapz, the software accepts a track plan image that you must acquire in a legal fashion – for example, by scanning it from a book or magazine you own, or by downloading it from a web site that permits you to do so. Basemapz then creates a derivative of the plan by rescaling it and breaking it up into pieces that can be positioned over the baseboards within a Trainz route, thereby serving as a guide that enables you to construct your own version of the route. Thus, the spirit of fair use is preserved.

When you are done constructing the route, it is your obligation to delete the basemap objects produced by Basemapz, so that copyrighted track plan images are not distributed to others when you share or sell the route.

If You Have Trouble

If you are having difficulty with any aspect of Basemapz, please post your questions in the Trainz forums or send the author a PM from there. The Trainz community is full of friendly people who are always happy to help each other enjoy this wonderful hobby of ours.

Important Things to Know Before You Start

When Basemapz exports a set of basemaps and a route to Trainz, it will ask you to supply certain information that might be foreign to newcomers to Trainz. This includes something called a KUID, plus a numeric Trainz User ID and an Author Name. This is information is easy to find if you know where to look; the following sections will help you.

KUIDs and Content IDs

A KUID is an identifier uniquely allocated to each item of content created for Trainz, similar to a bar code. Typically, these identifiers are created and used internally by Trainz, so understanding the exact format is not necessary for most users.

The part of the KUID that we're interested in for Basemapz is the Content ID portion. Look at the example KUID below.

<KUID2:171456:38001:1>

The middle number, 38001 in the above example, is the Content ID. This is a number that the content creator (you) assigns to each creation to uniquely identify it. The combination of a creator's User ID and the Content ID form a unique asset identifier (the KUID), which prevents conflicts with assets created by others.

The number used as a Content ID must be a positive integer in the range between 1 and 2147483648.

This number has no special meaning beyond helping to form a unique identifier for the asset. There are "recommended ranges" for certain Content IDs, with values from 20000 to 20999 typically being used for Routes and values from 60000 to 60999 typically being used for Miscellaneous Content (which basemaps are considered to be); Basemapz adheres to these two conventions by default, but you are of course free to choose whatever numbers you wish.

Full details about KUIDs are provided here for interested parties.

Finding Your User ID and Author Name in T:ANE

To locate your User ID and Author Name in T:ANE, begin by starting the T:ANE software. In the startup screen, choose Trainz Settings.

Basemapz UserID04.png

In the Settings dialog, click the Internet tab.

Basemapz UserID05.png

Your Author Name is shown in the Username field, outlined in green in the example above.

Now click the Dev tab.

Basemapz UserID06.png

Your User ID is shown in the User ID field, outlined in blue in the example above.

NOTE: Your User ID and Author Name will be different from what is shown here -- the values displayed here are just an example to help you find the information. Always use the information that has been assigned to you or that you have chosen.

Write these values down so you can use them in Basemapz later. You'll only have to enter them once; Basemapz will remember your entries and will automatically display them again on subsequent uses.

Finding Your User ID and Author Name in TS12 and Earlier

To locate your User ID and Author Name in TS12 and earlier versions of Trainz, begin by starting the Trainz software. In the startup screen, choose Content.

Basemapz UserID01.png

Content Manager will open. On the File menu, choose Settings.

Basemapz UserID02.png

In the Settings dialog, click the Internet tab.

Basemapz UserID03.png

Your User ID is shown in the User ID field, outlined in blue in the example above. Your Author Name is shown in the Planet Auran Username field, outlined in green in the example above.

NOTE: Your User ID and Author Name will be different from what is shown here -- the values displayed here are just an example to help you find the information. Always use the information that has been assigned to you or that you have chosen.

Write these values down so you can use them in Basemapz later. You'll only have to enter them once; Basemapz will remember your entries and will automatically display them again on subsequent uses.

Recommended Additional Software

IrfanView is absolutely invaluable when it comes to translating track plan images into Trainz. This application allows you to resize, crop and de-skew images, all of which are essential operations when attempting to use a scanned image of a track plan.

You can download IrfanView for free from the official site at http://www.irfanview.net/; be sure to choose the version (32- or 64-bit) that is appropriate for your system.

Basemapz Installation, Startup, Exiting and Removal

Basemapz is distributed as a single Microsoft Installer file named BasemapzSetup.msi. To install the software, find this file (i.e. in Windows Explorer) and double-click it.

Basemapz Install01.png

Don’t worry if the file size or date are different than the ones shown above; that image is just an example to help you make sure you are locating the right file.

Installation

After you double-click the MSI file, there may be a short pause; please be patient while Windows gathers information it needs to perform the installation. The first installation screen will then be displayed, and will appear similar to the following example.

Basemapz Install02.png

When you are ready to proceed, click Next. The second installer screen will be displayed, and will appear similar to the following example.

Basemapz Install03.png

It is highly recommended that you leave the preset destination folder unchanged, but you are of course free to select a different installation location as you see fit.

When the proper destination location is shown, click Next. The third installer screen will be displayed, and will appear similar to the following example.

Basemapz Install04.png

When you are ready to proceed, click Next. The fourth installer screen will be displayed, and will appear similar to the following example.

Basemapz Install05.png

At this point, installation may pause and a User Account Control (UAC) dialog may be displayed that appears similar to the following example.

Basemapz Install06.png

The “unknown publisher” is ModelerMJ, so it’s safe to click Yes.

Installation will then proceed, with some progress bars being displayed very rapidly.

When installation completes, the final installer screen will be displayed and will appear similar to the following example.

Basemapz Install08.png

Click Close. Now look at your desktop and locate the shortcut for Basemapz; it will look similar to the following example.

Basemapz DesktopIcon.png

Startup

To start Basemapz, locate the shortcut (shown above) on your desktop and double-click it. Or, open the Windows Start Menu, select All Apps, find Basemapz in the alphabetized list, and click it once.

Basemapz StartMenuEntry.png

Either way, Basemapz will open, and will initially appear similar to the example below.

INSERT IMAGE HERE

On first startup, Basemapz will search for the largest display in your system, and will then position itself centered on that monitor. You can then move the application window around, maximize it, resize it or minimize it in the usual way. When you close Basemapz, it will remember the position and size of its main window, and will reappear at that same location and with the same size on the next startup.

As you use Basemapz, it also remembers all the data you enter and all the selections you make, and this information will automatically be re-displayed when you start Basemapz the next time.

Exiting

To close Basemapz, click the Exit button at the bottom right corner of the Basemapz window.

Removing the Program

To remove Basemapz from your system, begin by opening Windows Control Panel. In Windows 10, do this by right-clicking the Windows Start Button, then selecting Control Panel from the menu that appears.

Basemapz Removal01.png

When Windows Control Panel opens, select Programs and Features. You may want to use Small Icons view to make it easier to locate this applet.

Basemapz Removal02.png

In the Programs and Features dialog, find Basemapz in the list, then click Uninstall.

Basemapz Removal03.png

A confirmation dialog will be displayed. Click Yes.

Basemapz Removal04.png

A status message will then be displayed, similar to the following example:

Basemapz Removal05.png

At this point, the program removal process may pause and a User Account Control (UAC) dialog may be displayed that appears similar to the following example.

Basemapz Removal06.png

Again, the “unknown publisher” is ModelerMJ, so it’s safe to click Yes.

Program removal will then proceed, with some progress bars being displayed very rapidly.

After program removal is complete, the Basemapz entry will be removed from the list in the Programs and Features dialog; you can then close that dialog by clicking the X at the upper right corner.

Obtaining Track Plan Images

Track Plan Images are available from a wide variety of sources.

  • The Model Railroader 75 Year Collection DVD set is a great source of track plans (and of course a wealth of other information). Unfortunately, this product was discontinued c. 2011-2012 (verified with a phone call to Kalmbach), but it may still be available (albeit used or in alternate formats) from other sources.
  • Scan the images from a magazine or book that you own. This is a manual process, of course, and will be discussed in the next section.

Preparing Track Plan Images for Import

In this section I will describe the techniques that I use to acquire a track plan image from a magazine and prepare it for use with Basemapz. This sequence of operations is not the only way to achieve this goal, and feedback from the Trainz community is always welcome. If you have a good way of importing track plans that you'd like to share, please PM me (ModeerMJ) at the Trainz Forums so we an exchange the appropriate information.

Find and Scan a Track Plan Image

The example track plan I will use in this section is the N-Scale Fox River Grove, designed by Frank Stastny, which appeared in the February 1975 issue of Model Railroader magazine.

Basemapz MRCover Feb1975.jpg

From that magazine I scanned the entire page containing the track plan image, at 600 DPI. This gave me a JPG file that looked like this.

Basemapz MR FRG 300-15.jpg

Perform a Rough Crop

I then loaded the JPG into IrfanView, and drew a rough selection rectangle around the part of the page image that actually contained the track plan. Notice that I left quite a bit of extra room around the outside of the track plan - right now all I want to do is isolate the plan so I can straighten it. Later on, we'll crop it right to the edges of the bench work.

Basemapz RoughSelectionRectangle.png

Finally, I selected Edit -> Crop Selection (Cut out). This gave me the area of the page containing the track plan, with some extra room around the outside.

Basemapz InitialCutOut.png

Straighten the Image

Let's now take a closer look at this image - we need to determine if the scan is straight, or if it is rotated (skewed) in either the clockwise or counter-clockwise direction. As you can see, in this case the track plan is rotated just a tiny bit off-axis in the clockwise direction.

Basemapz ScanIsRotated.png

IrfanView makes it very easy to correct this. Begin by going to Image -> Custm/Fine Rotation; this will present a dialog box similar to the following example.

Basemapz FineRotationDialog.png

It will take a bit of experimenting to determine the amount of rotation needed to square up the image. In this case I ultimately determined that I needed to rotate the image 0.40 degrees in the counter-clockwise direction, so I entered -0.40 into the Angle field. Once I did that, the New Image part of the dialog changed to show a preview of what the image would look like with that amount of rotation applied. If you look closely, you'll see that the bench work area of the plan is now square with the borders of the preview area.

Basemapz FineRotationDialog2.png

Click OK, and the rotated image appears in the main IrfanView window. As you can see, the track plan part of the image is now nicely squared up.

Basemapz AfterFineRotate.png

Perform the Final Crop

Now we can crop the image to its final dimensions. Draw a selection rectangle that fits around the edges of the bench work as exactly as possible. Note that you can drag the edges of this rectangle after it is drawn, to adjust the fit.

Basemapz CloseCrop.png

Once again, select Edit -> Crop Selection (Cut out). This will give you the area of the page containing the track plan with no extra space around it.

Basemapz FinalCrop.png

Notice how the edges of the track plan bench work line right up with the edges of the IrfanView main window.

Save the Image in its Own Folder

Finally, we need to save this file where we can find it later. Start by selecting File-> Save As. This will bring up a Save Picture As... dialog. DO NOT CLOCK SAVE YTT!!!

Before we actually save the file, we need to create a folder that will contain the image. Basemapz requires that the input image be in its own folder, so it has a known place to create the Trainz files that you will import into Content Manager later on.

THIS IS EXTREMELY IMPORTANT - DO NOT SKIP THIS STEP.

Create a new folder someplace where you can find it later. In this case I'll create a folder named Fox River Grove within the Documents folder.

Basemapz NewFolderForImage.png

Finally, save the image in this new folder, with an appropriate name. I'll use FoxRiverGrove.jpg.

Basemapz SavingFile.png

Image Preparation Complete

That's it. The track plan image is now ready for import into Basemapz.

Importing and Previewing Track Plan Images

[tbd]

Exporting to Trainz

[tbd]

Tips for Building Your Route

[tbd]

Personal tools