Trainz/Config.txt files

From Wikibooks, open books for an open world
Jump to navigation Jump to search
Trainz Annotated References

Fundamentals for Trainz Trainees
TOC | BeginningsFun | AM&C | Creation | InBook Refs ORP Refs:  • Index • Containers • Kinds • Tags | Appendixes  • Vers
Loupe light.svg
 Mouse use

Config.txt files[edit]

This page is a brief laypersons and beginners introduction to Config.txt files—an very important data defining element in Trainz;


This is the introduction to Trainz config.txt files, a type of ini file used to track and initialize literally every asset in the Trainz data definition and database system.

Younger readers will likely be less familiar with the INI file concept, but the technology is still in use in modern applications, though much of the setup data once ensconced in ini files is now put into Windows registry entries, and the rest is usually hidden away in a folder not normally accessed by the casual Trainz Windows user.{{efn| A search from the C:\ root for *.ini will find the ini file is still alive and well, even inside the Microsoft Windows C:\Windows (system) folder and its sub-folders. Newer Windows often places user controlled choices for applications into a \Users\User's-LogInName\...\AppData folder in .ini files — and so there is little mystery that Trainz which antedated Windows 2000 and Windows ME releases bridging the Windows NT releases,[note 1] would maintain the technology in use if it serves it well.

Trainz however, cannot take that registry route for there are over 130,000 built-in assets in a typical Trainz release, and some might double that count—before adding in free or payware content from the Download Station or 3rd-party site, and using the registry to record even just added content would quickly swell the windows registry into behaving with glacial slowness, a result contrary to the idea of historic design goals of the registry which was supposed to make Windows application launches faster and increasing reliability (from the Software support folk's point of view) by hiding various things where the average user couldn't get at them and fiddle with settings. (Yes, Nanny-state thinking!)   Overall, with the registry now over a decade old, Window process switching does go much faster and applications trust the registry so have been empowered to incorporate less safeguard testing on self-booting operations.

  Then there is a second issue, Trainz asset ini files are .txt files, and most Trainz ini files are soon missing—their very root folders are temporary in existence and as a file containing a data defines set, they're component files are often compressed into other partially processed, organized and indexed files (see chump files) which the Trainz data base uses in the run-time GUI modules and CM. This processed 'Asset status' is called being committed, meaning the temporary files in a root folder are bundled up and inserted into the Trainz Asset Data Base (TAD) ready for inclusion in a route or session, or further referencing by CM operations such as checking for dependencies or dependent assets.

Assets in brief[edit]

So we now have to address an important introductory question:

What the Heck is a Trainz Asset, anyways [note 2]???

Trainz elements, Trainz activities, and anything you want to do, short of uninstalling an Trainz Install, depends on Kuids and Assets. A session you drive, populating a route (map, virtual world) you've access to using with tasks for you to accomplish are setup by programming 'Scriplets' (referencess),, its list of possible messages (HTML or Text Assets), and of course rolling stock — basically every item that can be defined as code, or an element that is a part of the whole of some part of Trainz is an asset. We keep all that straight in Content Manager using Config.txt files uniquely identified by KUIDs, an indexing and inter-relationship identifier that can be used to unite all the diverse and disparate parts of color (textures, or visible skins), meshes (Shapes coated by skins), mesh conglomerates (parts of say a traincar, the wheels, the coupler systems, the trucks or bogeys, the cargo frame and shape [another mesh, possibly a part of a mesh-library asset], all of which are covered by colorfiles and reflection attributes for making an invisible shape seem to have a real form.

So What's a config.txt file?[edit]

Each asset (or content item) in Trainz starts in a file folder setup and with each part defined by the content creator. Some graphics packages, notably Autodesk's 3ds Max which N3V's developers use and the formerly 'bundled-with-Trainz' simpler game focused Gmax sub-set of 3ds Max liked to use certain sub-folder arrangements and these carry over into Trainz folders organization.

The config.txt file is the glue that holds together the parts of a self-defining 3D graphics model defining and giving instructions for how those files and sub-folders fit together as interpreted by the Auran JET 3.0 graphics engine behind the Trainz virtual worlds.  

Various data elements must be defined in a config file, and others are optional. Such data elements are set forth in the TrainzBaseSpec, a KIND classed data collection which may be or must be defined in each Trainz sub-asset. A sub-asset are parts, wheels, Locomotive Cabs, bogeys (trucks), couplers, track attached to an interactive factory and so forth which might be used by numbers of larger assets. The track in the factory or wheels of a freight car (wagon) being two easy to understand examples.

The Flavor of a Config[edit]

The following is a small taste of a config file from an actual locomotive asset engine component file folder. Sounds are parts assets too, and this one connects the sounds (which might be apropos to other locomotives) to the "engine spec" config.txt file which calls this by reference to its KUID "<kuid:32711:100430>" (find below). The engine-spec asset is in it's turn referenced in the locomotive's config.txt file, meaning this asset has both a parent and a grand-parent asset level; and possibly many such associations:

username                                "0-4-0T Sounds"
description                             "0-4-0T sounds"
category-class                          "ZS"
kind                                    "enginesound"
{{TR|T|trainz-build}}                            2.9
author                                  "Ben Neal original author/ updated and reskinned by Dap"
contact-email                           ""
license                                 "You may not sell this package. You may not claim it as your own.
You may repaint it if you wish, just give bdaneal credit for original mesh and textures.
All items are presented as is, no warranty is included nor implied. I doubt this would 
cause any damage to your computer, but if it does bdaneal and/or Dap may not be held liable. 
The contents of this package are copyright 2008 Ben Neal. Thank you for your cooperation."

    image                               "preview.jpg"
    width                               240
    height                              180
{{TL|kuid}}                                   <kuid:32711:100430>

Mandatory tags and containers[edit]

Note, this list has been evolving inordinately quickly the past couple of years as Trainz and the MAC computer world interacted. Tags which were optional are now showing up on the TrainzOnline Wiki as being mantatory after trainz-build 3.4, or whatever. Further, the DLS acceptance testing is ahead of Trainz software releases as a rule, so uploaded assets may be bounced back with a requirement such and such a mandatory tag list needs defining.

The assets elements contained between '{' and '}' are inside a 'container' or KINDS


Notes, Footnotes & References[edit]

Config.txt files are endemic and ever present in Trainz assets, for no asset can be defined without this type of Computer Science container. The keyword-value_of_key pairing must always be kept in mind in editing or creating Trainz content. The TrainzBaseSpec contains values and containers which are most common in asset defining config.txt files.  


  1. Windows 98 and early Windows NT drastically increased the harddisk space addressable by the Operating System—disk size had hit a ceiling, and the new schema's in Windows NT and the bridge technology in Windows 98 allowed much larger hard disks to be utilized.
  2. Deliberate 's'... native dialect of the Editor. Ask anybody from Western Pennsylvania!