Started by Gayowulf, April 21, 2014, 03:50:39 PM
0 Members and 1 Guest are viewing this topic.
Quote from: lostwizard on August 29, 2013, 09:25:57 PMIt turns out you are, in fact, mistaken when it comes to there being a "predetermined" order the game uses. The game itself doesn't sort anything at all when it is loading the files in the plugins folder. Datpacker might sort the files before making its dat files, but I'm not using it because I have no need of it and it just adds more complexity when messing with plugins. (Besides, it's recommended not to use it with the NAM.)It turns out that the file name ordering behaviour being exploited in this case is a feature of the NTFS file system on Windows rather than the SC4D exe itself. Because I'm using Wine on a Linux machine instead of Windows, the underlying file system is not NTFS and, thus, does not have the file name ordering behaviour. Note that I'm referring to the low level operating system stuff here, not the explorer window or what have you. If you look at the low level system calls that are used to read a directory, the order you receive the file names may be any random order, and may not even be related to the order you created the files in a particular directory.I have been able to conclusively demonstrate that the exe itself does not sort the files. The cul-de-sac textures were missing when I just left the files alone on the file system, just as they stored when they were installed. Then, when I installed a shim file system that sorts directories before returning the list of files to the application, the textures started appearing correctly. That means with absolute certainty that the exe file itself is not sorting the file names. Thus, SC4D itself has no predetermined order in which it loads the files. Instead, the fact that the file naming convention for controlling such loading works at all is an accident of the way Windows implements NTFS. (Obviously, if you've datpacked the files, the order they appear in the dat file would matter instead. Odds are datpacker itself relies on the same feature of NTFS and Windows rather than doing any sorting on its own but since I haven't studied its implementation, I don't know.)The upshot of all this is that if one is going to use Wine to run SC4D with the NAM or any other order-sensitive addon, one needs to use a file system that sorts the file names in a directory before passing the list to the application.
Quote from: Alafel on April 22, 2014, 07:15:36 AMThat is really weird, because (a) I've never had this problem before, it began very suddenly; and (b) My SC4 files are on an NTFS drive. I guess Linux ignores file names when loading from NTFS as well?I'm going to go around touching all my files on the off chance that modification date has anything to do with it (note: in case anyone reading this doesn't speak Linux, I promise that's not creepy).
Quote from: lostwizard on May 03, 2014, 10:40:39 AMIt could be an update to Wine or the NTFS driver that started it going.
Quote from: Frolius666 on November 12, 2014, 04:32:52 PMTo keep everyone informed, to warn about a potential pitfall, and most of all to shake the tree and see if an occasional apple would fall... here are my findings till now on the "NAM on Linux" issue posted above.Should such apple happen to fall, this story might be better of in a Linux thread, as this is not really something caused by the NAM.FYI: I'm running SC4 DE on the current Linux Mint with the current Wine. My plugins folder sits (or sat) on a Ext4 formatted HDD.I went through the thread Memo gave me, it describes a similar situation with a link to a Linux script at the bottom.This script however doesn't work on ext4 drives, which is normal because ext4 doesn't keep an alphabetical file list.I checked with "ls -f" command (which does indeed list files in loading order)A few hours on the internet thought me that, if something similar to this script exists for ext4; it is very very hard to find.Alafel told me the script worked on his NTFS drive... sooooSometimes you have to make those decisions... Backup... reformat to NTFS... configure...Put back my plugins... ls -f... still random.Ran the script and bingo... almost...Plugins are in alphabetical order, but starting from H to Z, then A to G. Very strange...Did several tests on that, could get it to start at M too, don't know why...Then I got the idea of testing with a "maiden" folder structure, born on NTFS.Made folders A to Z and tried the same as before.Always perfectly alphabetical A-Z...So I started renaming those new folders and dragged my plugins in. (I kept the subfolders).This went OK until I got to M, which all of a sudden wanted to be on top again, script or no script (why not B...)I accidentally dropped an original "J" in which I corrected but could have triggered it. At this point I started testing with the very usefull Red-Blue test files from Jondor found here: http://sc4devotion.com/forums/index.php?topic=10542.msg414566#msg414566This to confirm ls -f really did list in loading order and I wasn't chasing ghosts... confirmed... unfortunately... the red "M" loaded before the blue "A" resulting in a blue square.The best explanation for this strange sorting behaviour I could think of is that there might be some residual ext4 data in the folders which is recognized by Linux that causes this.Finally I started back from the maiden A-Z folder structure but kept this and dragged my plugins in the subsequent folder.This time the folder structure stayed as it was, game loads and runs as it should, roundabouts and all...Requires a bit more maintenance when using installers, but it's manageable.Until above mentioned apple appears this is the best working solution I could come up with. Current conclusion:I you run the game on Linux, keep your plugins on a NTFS disk and preferably start out this way.Big thanks to everyone who helped me find the pieces of this puzzle... I hope the above is useful for somebody...
Page created in 0.070 seconds with 31 queries.