Train-Sim.Com
MSTS Route Design

Extracting texture names/locations from .t file

Notice to all visitors and members of the Train-Sim.Com message forums:
If you plan on using a signature banner in your posts, we would like to remind you that there is a maximum size for banners. That maximum is 450 pixels wide by 120 pixels high, and not to exceed 25k. Your compliance is appreciated. FORUM RULES Problems? There are two common reasons for problems with logging in and posting messages. The first is that you are running a firewall that prevents your messages from being sent to the server. The other is that you have cookies disabled; the DCForum software requires cookies to work properly.

Previous Topic | Next Topic

Printer-friendly copy Email this topic to a friend

Reading Topic #12000

Member since May-25-04 · 9 posts

I've checked out the glimmer of hope thread, but have been unable to find any more information on how textures are mapped to the ground data. It appears that it is from the .t file, but have been unable to decode it. Does anyone have any information, or can point me in the right direction?thanks,
pagefault.

Alert | IP

Printer-friendly page | Edit | Reply | Reply With Quote | Top

RE: Extracting texture names/locations from .t file, wacampbell, May-30-04, 07:55 PM, (1) RE: Extracting texture names/locations from .t file, pagefault, Jun-01-04, 08:59 PM, (3) RE: Extracting texture names/locations from .t file, MikeSimpson, Jun-01-04, 11:16 PM, (4) RE: Extracting texture names/locations from .t file, wacampbell, Jun-02-04, 07:57 AM, (5) RE: Extracting texture names/locations from .t file, pagefault, Jun-06-04, 08:53 PM, (6) RE: Extracting texture names/locations from .t file, pagefault, Jun-06-04, 09:11 PM, (7) RE: Extracting texture names/locations from .t file, wacampbell, Jun-06-04, 10:31 PM, (8) RE: Extracting texture names/locations from .t file, pagefault, Jun-06-04, 11:10 PM, (9) RE: Extracting texture names/locations from .t file, pagefault, Jun-07-04, 00:48 AM, (10) RE: Extracting texture names/locations from .t file, wacampbell, Jun-07-04, 07:53 AM, (11) RE: Extracting texture names/locations from .t file, MikeSimpson, May-31-04, 06:39 PM, (2)

Conferences | Topics | Previous Topic | Next Topic

Member since Jun-30-02 · 265 posts

RE: Extracting texture names/locations from .t file

Use the 'decomp' utility ( from the library ) to convert the .t file to text. You can then more easily see the various sections. There's a record in the file for each patch. The patch record contains an index into the list of tertex's as well as additional values that relate to rotation, mirroring and flipping of the tertex.

Alert | IP

Printer-friendly page | Edit | Reply | Reply With Quote | Top

Member since May-25-04 · 9 posts

RE: Extracting texture names/locations from .t file

>Use the 'decomp' utility ( from the library ) to convert the
>.t file to text. You can then more easily see the various
>sections. There's a record in the file for each patch.
>The patch record contains an index into the list of tertex's
>as well as additional values that relate to rotation,
>mirroring and flipping of the tertex. That decomp utility has a bit of a bug..When converting the texture section to text, it makes the assumption that all the values are floats, when in fact one of the values is an 32 bit unsigned long (a texture index).For example:terrain_patchset_patch ( 00000000 64 1 -320 99.48125 0 64 1.40130e-045 0.00195312 0.00195312 0.06225586 0 0 0.06225586 1 )the 1.40130e-045 value (8th value in), should actually have been read as the unsigned long, and therefore would be equal to 1.the next such value in the .t file is 2.80260e-045, which is equal to 2.Not sure if route riter has this same error or not.

Alert | IP

Printer-friendly page | Edit | Reply | Reply With Quote | Top

Charter Member · 864 posts

RE: Extracting texture names/locations from .t file

Route-Riter uses the same code as Decomp, as it incorporates Martyn Griffin's code for all the compress/uncompress routines. Within RR this code is only used to uncompress the .T files so that the .ace files named therein are readable.Therefore whether a number is a floating point number or a 32 bit unsigned number is immaterial. As far as I know, when the file is recompressed, it still works correctly. HOwever there would be very few users who have ever tried this, so I may be wrong.Mike

Alert | IP

Printer-friendly page | Edit | Reply | Reply With Quote | Top

Member since Jun-30-02 · 265 posts

RE: Extracting texture names/locations from .t file

I noticed this also, but it is pretty easy to work around it and convert the float value's bit pattern to the equivalent int where necessary. What are you working on? Was our feedback helpful?Wayne

Alert | IP

Printer-friendly page | Edit | Reply | Reply With Quote | Top

Member since May-25-04 · 9 posts

RE: Extracting texture names/locations from .t file

>I noticed this also, but it is pretty easy to work around it
>and convert the float value's bit pattern to the equivalent
>int where necessary.
>
>What are you working on? Was our feedback helpful?
>
>Wayne
Yes thanks Wayne, It helped a lot in figuring out how to read the format in binary form myself What am i working on? Let's just say that I like Trainz Railroad Simulator, and would like to see my route that i created for MSTS, running in TRS

Alert | IP

Printer-friendly page | Edit | Reply | Reply With Quote | Top

Member since May-25-04 · 9 posts

RE: Extracting texture names/locations from .t file

One more thing, i'm having some difficulty reading the tdb file.Some routes (like Tutorial route), read mostly fine, and i can connect the track up, just some pieces near junctions are missing.Other routes, I find have large pieces missing, so i guess i have misunderstood the way in which MSTS generates track.Can you point me in a direction where someone has documented the TDB file format?I have had a hard time finding any information on this, and had to resort to my own methods to deduce what each value meant.Any help would be great pagefault

Alert | IP

Printer-friendly page | Edit | Reply | Reply With Quote | Top

Member since Jun-30-02 · 265 posts

RE: Extracting texture names/locations from .t file

Unfortunately I don't know of any reference for the TDB file. I have worked out much of the format for some conversion software that I have written. You meantion that you have gaps in your track. Could it be places where there is dynamic track? The dynamic track is handled a little differently. They key to it is a special TSECTION.DAT file in you route's folder.

Alert | IP

Printer-friendly page | Edit | Reply | Reply With Quote | Top

Member since May-25-04 · 9 posts

RE: Extracting texture names/locations from .t file

Quite possibly it is.I will have to have a look into this, and see if I can't 'fill' the gaps Thanks for your help Wayne.

Alert | IP

Printer-friendly page | Edit | Reply | Reply With Quote | Top

Member since May-25-04 · 9 posts

RE: Extracting texture names/locations from .t file

Well i've checked out the tsection.dat, and while it might contain the information for the dynamic track, i don't really need it. If i load the map up into my utility, then the sections of track with the dynamic track in them load up fine, so that is not the problem.I guess the problem remains with the format of the tdb file.The following is what I have been able to work out:I've been able to figure out where the co-ordinates are stored in the string of numbers in the UiD, as well in the TrVectorSections.I'm still a little hazy on the TrPins tag however.For example: TrPins ( 1 1
TrPin ( 3 0 )
TrPin ( 24 1 )
)
I originally thought that the 1 1 in the TrPins tag was to denote 1 connection from, 1 connection to, therefore 2 connections in the list.TrPin (3 0) with 3 being the index of the node its connecting from, and 0 meaning 'from' (1 meaning to)TrPin (24 1) with 24 being the index of the node its connecting to, and 1 meaning 'to'Hence this meant that my assumption of the 1 1 in TrPins being a count of ins and outs.BUT, This does not seem to be the case, as other nodes i have found TrPins ( 1 1
TrPin ( 3 0 )
TrPin ( 25 0 )
)
Where if you look at the TrPin tags, you see that both are zero (which in my analysis mean they are both 'from', yet the 'count' that I thought (denoted by 1 1) tells otherwise..Do you have any clues as to what this might be, and if I am on the right track?

Alert | IP

Printer-friendly page | Edit | Reply | Reply With Quote | Top

Member since Jun-30-02 · 265 posts

RE: Extracting texture names/locations from .t file

I think your understanding is basically correct about the TrPins parameters. However for TrPin, I think the second parameter is more of a direction indicator. '0' means the train traverses the TrackNode's TrVectorSections in the forward direction and '1' means it traverses them in the reverse direction.Wayne

Alert | IP

Printer-friendly page | Edit | Reply | Reply With Quote | Top

Charter Member · 864 posts

RE: Extracting texture names/locations from .t file

Route-Riter will also uncompress the .T files for you (It will also allow you to edit and re-compress them if you are feeling brave).Mike

Alert | IP


[ Home | MSTS Forum | MSTS FAQ | File Library ] Copyright © 2004 by Nels Anderson. All Rights Reserved.

Restored from the Train-Sim.Com archive, captured June 16, 2004. About this archive.