Explaining MSTS' Route Folder Structure
by Jim "sniper297" Ward

Route Folder Structure

or .... How it's all put together.

\Activities

The info for each activity, contained in the .act files. Contains paths, services, traffic, and the location of each loose consist. Also has all the dope on action events and schedules.

\Envfiles

*.env files, the animation of skies and water, and in \Envfiles\Textures the sky & water textures. "Train World Initilization Failed" means one of these files is missing or corrupt.

\Lo_tiles

Low-resolution terrain textures for distant viewing, rarely used.

\Paths

The actual path each train takes over the route. These .pat files are what gets outdated by alterations to the track in the route editor, causing "broken path" errors since the path no longer matches the track configuration.

\Services

Trains with engines that move on the route. This includes the player train and any AI traffic trains. Each .srv file contains the info on the consist and the path file for that service.

\Shapes

Contains the .s and .sd files for the 3D objects. The object.s file has the shape data and the name of the .ace file it gets textured with. The matching object.sd file is the extended shape data, which contains info on alternative texture for night, snow covered, or seasonal.

\Sound

Do I really need to explain that one?

\TD

The actual "quad tree", geographical location and tile boundaries for the route. "Invisible" ground means a problem in here.

\Terrtex

The terrain texture files. This is the "painting" on the ground, when you apply a tile texture to the little black bordered square on the ground it comes from here. The subfolder \snow needs to have the corresponding ace file for each texture actually used on the route, otherwise there will be missing file errors when driving in winter.

\Textures

The skins for all the 3D objects in the \Shapes folder. Contains subfolders \Autumn, \AUTUMNSNOW, \Night, \Snow, \Spring, \SPRINGSNOW, \Winter, and \WINTERSNOW. Vegetation frequently has 8 different textures, showing up in the base \textures folder, plus all the other folders except night. Some objects have only the base texture, others have snow textures, and if it lights up at night it will also have a night texture. This folder contains all the ace files except environment (\Envfiles, sky and water) and ground textures (\Terrtex).

\Tiles

Either the .t, or y.raw, or both, contain the terrain elevation information, hills and valleys and so forth, plus the information on which \terrtex\ ground texture is applied to each tile. The f.raw files are generated when siding and platform markers are placed. The e.raw and n.raw are "lighting and geometry", and are automatically generated by the sim if they are missing, which is why it takes longer to load a newly installed route, as these are usually deleted to save space in the zip file.

\Traffic

Just what it sounds like, the .trf files contain the services and starting times for AI traffic trains.

\Tutor

Generated in add-on routes from the template folder, the only route that actually has anything in here is the tutorial route. I usually forget to delete this folder.

\world

All the info on location and viewing angles for all the placed objects are in the .w files, and the .ws files have all the placed sound sources. If a .w file is missing, the terrain texture and elevations are still visible, but all objects including the track textures are gone. The train can still be driven on the invisible track, the invisible signals still work, and the invisible switches can still be thrown. The track database is generated from the location references in the .w files, along with the tsection.dat file in the root of the routewhich addresses dynamic track.

 

The Route's Root Files

deer.haz, spotter.haz

The "hazards", critters that jump in front of moving trains.

Details.ace, load.ace,routename.ace.

Pictures that load in various screens for the route.

The .dat files

give access to interactive and other special non-static objects, adding entries for these to the ref file disables most of them. Copying the shapes and textures for Japanese signals into your route won't work unless the proper sigscr.dat and sigcfg.dat files are in the root.

carspawn.dat

All the different cars that will appear moving out of a carspawn. Adding entries for different cars to this file cures the "nothing but red cars moving" syndrome, but the matching shape and texture files must also be in the route.

forests.dat

All the forest regions available in the route. Again, the matching shapes and textures for each tree type must be in the route.

sigcfg.dat, sigscr.dat

Data for the signal types.

Speedpost.dat

Speedposts, obviously.

ssource.dat

Access to the static sound regions in the \sound folder.

telepole.dat

For telephone poles, which I've had some problems with. Theoretically you place a telephone pole at one end, another at the other end, and the ones between are filled in along with the connecting wires. Makes it hard to delete them once placed.

tsection.dat

Contains the info for all the dynamic track in the route. The tsection.dat file in the \global folder has all the "snap track" sections in it.

ttype.dat

All the track sounds.

routename.mkr, routename.ref

Used only for the route editor, the ref file accesses static objects, the mkr is the markers.

routename.rdb

Similar to the track database, this is the road database.

routename.rit

Carspawners and level crossings.

routename.tdb

The track database. This tells the sim where the trains can drive.

routename.tit

Like the rit, except for track instead of roads. Platform and siding markers, signals, speedposts, hazards, track sound regions, level crossing trips.

routename.trk

All the filename info that makes that route unique from other routes. Contains the references to the environment (skies) and the properties like speed limits, electrified/wire height, etc. This is the file that has to be hacked to "clone" a route, since the activity editor, for example, doesn't pay any attention to the route folder name, and saves the activity into the first folder it finds with the .trk file matching the activity.

\Shapes\ .thm

THM files are generated in the \Shapes folder if you have thumbnails enabled in the Route Editor object menu. These don't do anything useful so they should be deleted before zipping, since they're generated the first time you look at the object class in the object menu, they'll have a date after May 2001.

 

Packaging A Route For Distribution

Editor's Note: included here for historical purposes to demonstrate how far ahead of the pack Jim was in 2002 when he wrote this. Of course, Route_Riter will do all this, and more, for you nowadays.

If no custom objects are used, the only things necessary to include are:

  • All the root files
  • \Activities folder
  • \Paths folder
  • \Services folder
  • \TD folder
  • \Tiles folder
  • \Traffic folder
  • \World folder.

For user friendly installation, a batch file to copy all the files and folders the end user already has.

We have new discussions going on with this, and some people are still confused, so I'm gonna see if I can try to clarify the mud a little.

If you're looking for absolute perfection, look no further than the Timesaver route.

Ron (StationMaster) only had a 1 tile route there, but by writing a batch file that copied all the root files that were not unique to that route, he got the zip size down to 60 kilobytes, a new record for add on routes. He also put a lot of time and effort into copying individual files, and the final install size of the route is only 22 megabytes, also a new record for a fully scenicked route. (Mike's Cliffhanger had a bigger zip, but we didn't know about the e.raw and n.raw back then, and Cliffhanger has no scenery, so the final install size was smaller.)

Personally, I'd go nutzoid trying to do like Ron did on a bigger route, but there are a lot of things you can eliminate to reduce the size of the zip, and by doing individual or single region copying on \Sound and \Terrtex files, you can save the end user 150 megs or so of unnecessary installation space on each route, with very little effort.

I'm a lazy SOB, so rather than trying to sort them out, I still include all the files in the root of the route folder. That isn't a big deal, it's usually only 1 meg or so, and zips down a lot smaller. Even the O&WV with it's monster 3 megabyte track database, with an overall root file size of nearly 5 megabytes, that 5 megs zips down to 550 kilobytes, since all the root files except the ace files compress very well.

So the quick and easy way to package a route is to leave all the root files in place, do a tools, find in explorer for *.bk *e.raw *n.raw *.thm , select all delete all. Then delete \Envfiles \Shapes \Sound \Terrtex and \Textures folders. Zip up what's left and test the extraction and installation before uploading.

 

Additional Notes

Editor's Note: included here for historical purposes to demonstrate how far ahead of the pack Jim was in 2002 when he wrote this. Of course, Route_Riter will do all this, and more, for you nowadays.

If no custom objects are used, the only things necessary to include are:

  • All the root files
  • \Activities folder
  • \Paths folder
  • \Services folder
  • \TD folder
  • \Tiles folder
  • \Traffic folder
  • \World folder.

For user friendly installation, a batch file to copy all the files and folders the end user already has.

We have new discussions going on with this, and some people are still confused, so I'm gonna see if I can try to clarify the mud a little.

If you're looking for absolute perfection, look no further than the Timesaver route.

Ron (StationMaster) only had a 1 tile route there, but by writing a batch file that copied all the root files that were not unique to that route, he got the zip size down to 60 kilobytes, a new record for add on routes. He also put a lot of time and effort into copying individual files, and the final install size of the route is only 22 megabytes, also a new record for a fully scenicked route. (Mike's Cliffhanger had a bigger zip, but we didn't know about the e.raw and n.raw back then, and Cliffhanger has no scenery, so the final install size was smaller.)

Personally, I'd go nutzoid trying to do like Ron did on a bigger route, but there are a lot of things you can eliminate to reduce the size of the zip, and by doing individual or single region copying on \Sound and \Terrtex files, you can save the end user 150 megs or so of unnecessary installation space on each route, with very little effort.

I'm a lazy SOB, so rather than trying to sort them out, I still include all the files in the root of the route folder. That isn't a big deal, it's usually only 1 meg or so, and zips down a lot smaller. Even the O&WV with it's monster 3 megabyte track database, with an overall root file size of nearly 5 megabytes, that 5 megs zips down to 550 kilobytes, since all the root files except the ace files compress very well.

So the quick and easy way to package a route is to leave all the root files in place, do a tools, find in explorer for *.bk *e.raw *n.raw *.thm , select all delete all. Then delete \Envfiles \Shapes \Sound \Terrtex and \Textures folders. Zip up what's left and test the extraction and installation before uploading.

But as has been said, just use Route_Riter to compact and package your route.