DSC files?

Stop by here for help with RRT3 Editor problems and tips.
User avatar
Just Crazy Jim
Dispatcher
Posts: 413
Joined: Fri Oct 14, 2016 9:57 pm
Location: Coal Fields of WV

DSC files? Unread post

Using the Logo creation tool (a fickle beast at the best of times) I noticed that the PK4s it creates contain a DSC file. It's a straight text file, not hex.

An example:

Code: Select all

CompanyLogo
Logo_Boston_Albany
I've not noticed any other PK4 files having DSCs included. Is the DSC file necessary to make custom logos appear in the game?

I am trying to make a single PK4 containing all the custom logos for my mod, and as a pre-work experiment, I thought I would test my theory that (even when operating in an x64 environment) the game's EXE suffers the 128 character limit for directory+file name length. And if anything is a 16-bit app in a 32-bit wrapper, which I suspect the Logo tool might be, then things can really get much more limited. There were also problems in 16-bit and 32-bit programming affecting the number of files in a directory folder that could be read. The number varies by app and disk formatting architecture, but in my experience 2000 is usually where it goes south for 32-bit software. The number of readable files in a directory is also limited by length of string, so it may see files A, B, C and D, but cannot open/read B because the total string length is more than 128 characters.

These limitations are lockstepped to the 8.3 naming convention of FAT-16 disk formatting architecture, which FAT-32 and later disk formatting architectures never perfectly remedied. The change in directories in late versions of Windows was an attempt by the developers to address the issue, but software developers aren't all on board with the idea of terse directory naming.

For instance, a default install of RRT3 under Windows XP might have this problem:

C:\Program Files\PopTop Software\Railroad Tycoon 3\Data\AdditionalUserContent\

is already 78 characters in length.

and in some cases, you might see:

C:\Program Files\Take2 Games\PopTop Software\Railroad Tycoon 3\Data\AdditionalUserContent\

89 characters in length.

Adding Logo_Boston_and_Albany.pk4 to the tail of that, would increase the string to 115 characters over-all length. And Logo_Central_Maine_and_Quebec_RR.pk4 would push the string to 125 characters, very close to the 128 character limit.

Add (space)(x86) onto Program Files and you've crossed threshold at 129 characters.

C:\Program Files\Take2 Games\PopTop Software\Railroad Tycoon 3\Data\AdditionalUserContent\Logo_Central_Maine_and_Quebec_RR.pk4

If the game has a limited buffer for holding directory listings, then both string length and number of files could be causing the 100 logo limit. As well as other bugs.

So, returning to the DSC file question. If it's just useless fluff, removing it means there's one less file chewing on RAM allocated to the file buffer. If the DSC is critical to logo files, then can it carry more than one logo?
"We have no patience with other people's vanity because it is offensive to our own."
-- François de La Rochefoucauld. Réflexions ou sentences et maximes morales. 1665.
User avatar
Just Crazy Jim
Dispatcher
Posts: 413
Joined: Fri Oct 14, 2016 9:57 pm
Location: Coal Fields of WV

Re: DSC files? Unread post

Well packing all the logos into a single PK4 proved that idea is a fail. Of the 64 in the pack only 3 appeared in-game. And not the first 3 by alphabetic sorting. So I'm not sure what's going on with that. The good news is that a PK4 with more than logo sort of works. Sort of. The question now is why doesn't it list the whole contents of the multiple logo PK4.
"We have no patience with other people's vanity because it is offensive to our own."
-- François de La Rochefoucauld. Réflexions ou sentences et maximes morales. 1665.
User avatar
Gumboots
CEO
Posts: 4813
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: DSC files? Unread post

I know with locomotive skinning the .dsc file is only required if you have secondary skins. In that case you have one .dsc file for each extra skin*, and they are hex files.

My guess is that the same applies to logos: one .dsc per logo. I unpacked a custom logo I had in my CtC directory and it includes a .dsc file. It's definitely hex though. There are no numerical values, but it's still a hex file.

So if you pack all your custom logos, with their .dsc files and their .imb files and their images, it should all work even if they are all in one PK4.

*This tells the game which locomotive the extra skin is for. I suspect with logos it needs one .dsc per logo to tell it which company the logo is for, or to tie the images to their name, or something.
User avatar
Just Crazy Jim
Dispatcher
Posts: 413
Joined: Fri Oct 14, 2016 9:57 pm
Location: Coal Fields of WV

Re: DSC files? Unread post

I think I may understand what's causing the big pack of logos to not work as planned.

It's not so much long file names as it is the use of the _ (underscore) in names!

Example:

Code: Select all

Logo_Boston_Albany_A.dds
My suspicion is the game reads _A or _B in this file name and it "becomes confused" and can't find the DDS specified in the IMB. Seeing as it has no problems finding:

Code: Select all

Logo_LIRR_A.dds
Logo_SALTLAKE_A.dds
but balks at:

Code: Select all

Logo_CanadianNorthern_A.dds
Logo_CMandQ_A.dds
Logo_Oil_Creek_and_Titusville_A.dds
I believe it's safe to assume that any DDS name with an occurrence of _A, _B, or _C other than the terminal DDS grade specification is going to be a problem... in Logo files...

Edited for clarification
Last edited by Just Crazy Jim on Tue Oct 25, 2016 7:35 am, edited 1 time in total.
"We have no patience with other people's vanity because it is offensive to our own."
-- François de La Rochefoucauld. Réflexions ou sentences et maximes morales. 1665.
User avatar
Gumboots
CEO
Posts: 4813
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: DSC files? Unread post

Well I used A1_BerkshireL_A.dds as a file name when I made the old Berkshire and that was fine. That has _B in it.

The other point is that default skins often go down to G, so if your theory was right that would also rule out using _D, _E, _F and _G.
User avatar
Just Crazy Jim
Dispatcher
Posts: 413
Joined: Fri Oct 14, 2016 9:57 pm
Location: Coal Fields of WV

Re: DSC files? Unread post

Meh, I knew I should have edited the post to say what I meant. I knew I meant "in Logo files". !facepalm!

Further testing seems to demonstrate that it's the second _ underscore that triggers the problem.

So, Anytext_anytext_anytext_etc is where things go south.

But still not seeing Logo_CMandQ_A.dds logos in game. There's probably more to it.
"We have no patience with other people's vanity because it is offensive to our own."
-- François de La Rochefoucauld. Réflexions ou sentences et maximes morales. 1665.
User avatar
Just Crazy Jim
Dispatcher
Posts: 413
Joined: Fri Oct 14, 2016 9:57 pm
Location: Coal Fields of WV

Re: DSC files? Unread post

OK, I think I have this figured out.

While scanning custom logos in the UserExtraContent folder, if the EXE encounters any problem in the naming structure of DDS files associated with a logo file and it doesn't cause a Bong of Doom, it stops reading at that point in the directory list. The Logos seem to be consistently read in alphabetical order by file name, then appear in the logo selection in that same order. DDS file names that have multiple underscores before the _A, _B, _C suffices, will cause an error if any intermediate text after the second underscore begins with A, B, or C.

By eliminating "Logo_" from the DDS names and editing the IMB file to reflect this change, most custom logos that were not populating to the list were made to appear. Further, it allowed other custom logos that were otherwise perfect to appear, but had been "lost" because the EXE stopped reading.

However, it still required careful management of renaming some files that otherwise seemed perfectly fine, but that upon a little further investigation I found were using other letters in the DDS suffix list. In this case _F in Logo_OldColony_FallRiver_A.DDS So the point made by Gumboots seems to line up with the seen problem.

There are likely more layers to this than what I have found. But for my purposes, simply altering naming that places A-G after a 2nd underscore (but before the _A.dds etc) seems to resolve the issue.
"We have no patience with other people's vanity because it is offensive to our own."
-- François de La Rochefoucauld. Réflexions ou sentences et maximes morales. 1665.
User avatar
Just Crazy Jim
Dispatcher
Posts: 413
Joined: Fri Oct 14, 2016 9:57 pm
Location: Coal Fields of WV

Re: DSC files? Unread post

Well four hours of trying and my efforts to achieve a multiple logo PK4 seems to be a bust. The game reads the first IMB or DSC (not sure which) in alphabetical sequence and that's the end of the matter as far as the EXE is concerned. I tried multiple file names in the DSC and that was a fail. I didn't get the Bong of Doom, but I didn't get more than 1 logo from the multipack PK4 to display in-game either.

All the logo files work perfectly as individual logo PK4s and it follows simple logic that if the game will read from multi-pack PK4s, then a multipack PK4 file for logos should be possible... unless it's like slow date... meaning it works, sort of, but not the way you think it will.

Time for me to shift my focus onto more rewarding frustrations for a bit.
"We have no patience with other people's vanity because it is offensive to our own."
-- François de La Rochefoucauld. Réflexions ou sentences et maximes morales. 1665.
User avatar
Gumboots
CEO
Posts: 4813
Joined: Mon Aug 13, 2012 4:32 am
Location: Australia

Re: DSC files? Unread post

I probably sent you on a bit of a wild goose chase by assuming that since every other PK4 in the game has multiple stuff all over the place, multiple .dsc files shouldn't be an issue. Sorry about that.

Since the .dsc was included in the game coding specifically for custom loco skins and logos, and since the only PK4 packing and unpacking tools provided* do not permit the user to pack multiple skins or logos into each PK4, then it's likely the game engine is coded on the basis of one .dsc per PK4. Which is handy to know.

And the underscore bug is a good one to know about too. I'd never encountered that before. What I'm doing with the custom cargo car scale I'm making is to give all the PK4's a name that starts with # to keep them all grouped together in PopTopExtraContent. You could use a similar convention for logo naming. If you start them all with @ or $ they'll be easy to find in the list, and you won't need the Logo_ starting tag for any files if you want to get rid of it.

*TrainSkin, CompanyLogo and PlayerPortrait. The PK4PAck and PK4Unpack we use are not part of RT3.
User avatar
Just Crazy Jim
Dispatcher
Posts: 413
Joined: Fri Oct 14, 2016 9:57 pm
Location: Coal Fields of WV

Re: DSC files? Unread post

All is well. From what I've read on this forum, wild goose chases are the norm for RT3. Great ideas in hacking files is a bit like seeing someone you think is attractive in the dim light of a bar... it hardly ever turns out to be the way you hoped it would. :lol:
"We have no patience with other people's vanity because it is offensive to our own."
-- François de La Rochefoucauld. Réflexions ou sentences et maximes morales. 1665.
Post Reply