snobel on 5/6/2011 at 16:31
(For the actual question, skip to "The question" below :))
I hope this non-mapping, but rather technical, question is allowed here in the VIP lounge...
I've made a couple of patches for T3 exe files, in order to make especially T3Main.exe more friendly to mission loaders. (I've got one brewing - yes, another one. This one is going to be very simple and will be named BennyLoader, if it is ever finished...)
Currently linking loaders like ModernLoader and tolsen64's new loader have to maintain a pair of registry values and a specially patched T3Main.exe for every installed mission, which is a pain I'd like to avoid. I tried setting the registry values to a relative path ("..", the parent folder), which almost works, although you have to use ".\.." for one of them.
"Almost works" means that some FMs have issues - the problem is the same period-in-the-gamepath bug that Xiaopang encountered in the making of ModernLoader. So this patch fixes that, but goes a bit further and hardwires those registry values to ".\..", so that there is no need for messing with the registry at all.
The 'dotbug' happens when the code tries to remove an extension from a filename that doesn't have one. It then removes everything following the last period it can find in the string, even if it is higher up the path. The fix just makes the search backwards through the string for the period quit if a '\' or '/' is encountered first.
Of course, if the same function is ever used to find a period in a string that is not a path/filename, and actually has a '.' to the left of a '\' or '/', then there is trouble... But it turns out that the strings that are scanned for periods are either filenames with or without path (which are OK), or simple resource names like "tenxbeamwood1x16" and "invarrowshaft1a1" - no path or extension.
The question is then: Are '\' or '/' allowed in (custom) resource names? Can you think of any other types of strings in T3 where those characters are allowed and where '.' has some special meaning?
If you're interested you can get the patch
here. I've played through the first two OMs and "The Keeper" with no problems at all, but it could do with some more testing of course. Especially if you have Vista or Win7 please consider giving it a whirl, because you never know...
There is an additional small patch for Ion Launcher.exe, which makes Launcher.log go into the game folder too, so that everything is contained...
Edit: Forgot to mention that the patch renames the save-games folder to "Saves", to be more like the other Thief games. So if you drop the patched exe into a mission folder installed with ML or TFMM, you will have to rename the SaveGames folder in order to use your saves.
Edit 2: Obsolete link removed, install (
http://www.ttlg.com/forums/showthread.php?t=135810) TFMM to get the patched exes.
Beleg Cúthalion on 5/6/2011 at 18:34
You're referring to actual code lines, e.g. those which become visible in a hex editor and the like, right? The more complex custom files which are added for an FM are material libraries (*.mlb), re-written conversations (*.con) and some others, but IIRC nothing which doesn't already exist structure-wise in vanilla T3Ed/TDS. Some of the ini files contain a lot of file paths but I guess that's not what you're looking for.
And as a side-note just in case my post would be entirely unhelpfull otherwise: Why do you three guys not team up for this NextGenLoader in spe? None of you should be too selfish at the community's expense and the benefits should be even bigger: No one has all the work to do, more aspects can be covered (ask Xiaopang about his to-do/wish list) and all of you get their names written all over it. :p
snobel on 5/6/2011 at 21:08
File paths should be OK, because '\' and '/' are not allowed in file/folder names.
Those resource names I see in the debugger logs are (I think) the stuff contained in the ibt files, i.e. textures and such. (I spent some time figuring out cbt optimizing/rebuilding, and some of the names look familiar.)
I like the idea of a Loader team effort, but I'm pretty sure it won't happen: Look at how different ModernLoader and TFMM are. My loader will be somewhere in between, actually much like Darkloader. And Xiaopang uses Lua for ML, tolsen64 VB2010 for TFMM, and I am going to use C++.
Long term I have some ideas about adding peer-to-peer exchange of mission files, reviews etc - to ensure that everything would be available with no single point of failure like potterr's server - maybe we could collaborate on something like that.
tolsen64 on 5/6/2011 at 21:50
Can someone tell me what the problem is with a dot in the path name? I have loaded every single T3 mission I have that includes a dot in the path name and they all work fine. Is there something I need to do in the mission to see the issue? Is it OS specific?
I'm loading with TFMM and running Win7 64-bit. My T3 is updated to v1.1
tolsen64 on 5/6/2011 at 22:06
I just read the readme file in the patch. I really like the idea of patching the executables to make T3 truly portable. Personally, I'd prefer to download a zip file with the pre-patched files rather than to attempt patching them myself. Just call me lazy.
snobel on 6/6/2011 at 05:12
All you have to do is to copy two files and click on the bat file. Judging from all the work you've done on TFMM you're not that lazy :p
Beleg Cúthalion on 6/6/2011 at 11:44
Xiaopang was about to re-write ML in a different language anyway IIRC and aren't those things compatible in
some way by 2011? His implementation of T3Ed for instance is a thing I wouldn't like to miss and otherwise (handling several languages etc.) I think he might be the farthest in development, left aside potterr maybe, with whom we had planned quite some useful things just before he disappeared.
Xiaopang can be found in (
http://retrocast.ch.vu/modernloader) his forum and I really think you guys should have at least some kind of preliminary talk, not only because the combined manpower shouldn't be wasted but also because a sort of FM loader anarchy isn't exactly something to be proud of. There is a reason why the TafferPatcher seems to be so popular.
snobel on 6/6/2011 at 15:01
I'd suggest making utilities for mission authors separate from the loader - no need to confuse ordinary players with stuff that only very few people will use. (But code could be shared between them of course.)
As for the loader, I actually think that choice is good, as long as the quality of the various loaders is adequate. Not everyone has the same idea of what the ideal mission loader is.
If you're keen on this you should start a "What would your ideal mission loader be like?" thread in the FM forum. That discussion would at least be interesting - the responses would probably vary from "minimal and bug free" to "GarretLoader 5.0 Pro Edition"...
If it's mainly author tools you're after you should write up what you need, on the T3 wiki or someplace, and post about it here. It might attract interest.
Beleg Cúthalion on 6/6/2011 at 20:49
The only thing I'd get from a larger thread in ThiefGen or the FM forum is a even greater mess of possibilities or differing opinions. I think there is a common perspective about FM loaders needing a rather slim design but that doesn't mean stripped of features. We DO have FMs with several languages which have to be served, otherwise you won't cater the non-English taffers. And you have at least two different sorts of readme files (GL-ready and DL-ready), so there has to be some amount of intelligence inside the program even if you won't see it in the end as a user.
The T3Ed thing was just a lucky coincidence since Xiaopang's hard-linking method allowed to handle T3Ed almost as a FM; it wasn't a complete author utility.
snobel on 6/6/2011 at 21:04
I'd appreciate info on language support for any of the Thief games. It's a subject I haven't looked at yet.