Trainz/Config.txt files

From Wikibooks, open books for an open world
< Trainz(Redirected from Trainz/config.txt files)
Jump to: navigation, search
logo
Introductory Trainz — page by page instruction

Fundamentals for Trainz Trainees
Trainz | Introductory Trainz  | Trainz AM&C | Creation | Appendixes  |  References  • Containers • Kinds • Tags • Index • Grps • Vers
 Glossary
 HKeys-CM
 HKeys-DVR
 HKeys-SUR
 HKeys-WIN
 Mouse use
 Notations

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;

Introduction[edit]


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. A search from the C:\ root for *.ini will find the ini file is still alive and well, even inside the Windows folder and sub-folders, for applications and so there is little mystery that Trainz which antedated Windows 2000 and Windows ME releases, 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.

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                           "dawxyz-ha-ha@noway.com"
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."

{{TR|C|thumbnails}}
{
  0
  {
    image                               "preview.jpg"
    width                               240
    height                              180
  }
}
{{TL|kuid}}                                   <kuid:32711:100430>
kuid-table
{
}

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