DavidJCobb Posted April 2, 2016 Share Posted April 2, 2016 Honestly, if you wanted to build a bare minimum estimate of a mod's variable usage, you'd have to count ALL properties and private variables (i.e. those defined outside a function). For best results, you'd want to scan PEX files rather than PSC files, as some mods don't include source code (Skyrim ships with a PEX disassembler but not a decompiler). A maximum estimate would count every variable and any string constant stored in a variable, regardless of scope. But, like, there's no reason to omit variables based on their types. :\ Link to comment Share on other sites More sharing options...
bcsp Posted April 2, 2016 Author Share Posted April 2, 2016 True. And Champollion is capable of decompiling most pex files. But wouldn't you be depriving yourself of a huge chunk of string space? I mean, what are the chances of all scripts being instanced at the same time? I think you'd have a better chance of getting hit by a meteorite while collecting your lottery winnings.Looking at a save with 160,000 script instances and 7,000 scripts, many of the instances are duplicates. Link to comment Share on other sites More sharing options...
kamikatze13 Posted April 2, 2016 Share Posted April 2, 2016 So that leaves us with nothing but empirical testing, results of which are often inconclusive and vary wildly. And there I was, thinking about a month ago that I finally can get myself a stable load order... :rolleyes: Link to comment Share on other sites More sharing options...
DavidJCobb Posted April 2, 2016 Share Posted April 2, 2016 True. And Champollion is capable of decompiling most pex files. But wouldn't you be depriving yourself of a huge chunk of string space? I mean, what are the chances of all scripts being instanced at the same time? I think you'd have a better chance of getting hit by a meteorite while collecting your lottery winnings.Looking at a save with 160,000 script instances and 7,000 scripts, many of the instances are duplicates. Someone in the LL thread said that the mere presence of a PEX file is enough to make Skyrim allocate strings for the properties contained therein, even when the scripts are unused. If that's true, then my minimum count should be close (I don't think anyone checked into private variables). My maximum count is literally a maximum count for a worst-case scenario. It's simply a statistic. Link to comment Share on other sites More sharing options...
kamikatze13 Posted April 2, 2016 Share Posted April 2, 2016 Someone in the LL thread said that the mere presence of a PEX file is enough to make Skyrim allocate strings for the properties contained therein, even when the scripts are unused. Can confirm. I looked a few times with sysinternals procmon into what skyrim does at what point and pex files definitely get accessed even before the main menu is displayed. Link to comment Share on other sites More sharing options...
bcsp Posted April 2, 2016 Author Share Posted April 2, 2016 Hmm. I'm not seeing that. Activating the save breaker without the activating the esp does not result in the properties being added to the string table in the save file at least, whatever about what the engine is doing. Link to comment Share on other sites More sharing options...
craigsumner Posted April 3, 2016 Share Posted April 3, 2016 Someone in the LL thread said that the mere presence of a PEX file is enough to make Skyrim allocate strings for the properties contained therein, even when the scripts are unused. If I'm understanding correctly, my experience contradicts that. I've been measuring the startup strcount impact of mods by repeatedly starting new games, while varying the selections in my plugins list, without making any changes at all to the selections in my mods list (in MO). I'm getting consistent-ish results which generally match what I see reported by others. Since I'm _not_ deselecting the mods in the mod list, that means that the script files are still in place, which implies that their presence alone is not enough to impact the strcount. The plugin that refers to the scripts must be enabled. Right? Link to comment Share on other sites More sharing options...
DavidJCobb Posted April 3, 2016 Share Posted April 3, 2016 Someone in the LL thread said that the mere presence of a PEX file is enough to make Skyrim allocate strings for the properties contained therein, even when the scripts are unused. If I'm understanding correctly, my experience contradicts that. I've been measuring the startup strcount impact of mods by repeatedly starting new games, while varying the selections in my plugins list, without making any changes at all to the selections in my mods list (in MO). I'm getting consistent-ish results which generally match what I see reported by others. Since I'm _not_ deselecting the mods in the mod list, that means that the script files are still in place, which implies that their presence alone is not enough to impact the strcount. The plugin that refers to the scripts must be enabled. Right? Sounds right. Good test. I'm busy developing my own mod and shooting for an April 7th deadline, so I haven't had time to investigate this personally. I've been citing bits of the LL discussion that seem forgotten just to make sure nothing gets missed. Link to comment Share on other sites More sharing options...
cdcooley Posted April 3, 2016 Share Posted April 3, 2016 Some scripts get loaded before the main menu. Specifically scripts attached to quests marked as start game enabled and then any other scripts referenced by those get loaded into memory early. If you run a file monitoring program on the Papyrus log file on a separate monitor or window you can see warnings about missing scripts and various script failures even before the main menu loads (assuming you have missing scripts or scripts that have errors in their OnInit blocks). The scripts are loaded based on your active mods. Similarly the strings that get cached are almost certainly the global variable, property, function, and script names for all loaded scripts. That would be most scripts but not the dialogue fragment scripts which get loaded and then purged from memory every time they run. The cache also appears to have the values currently stored in string variables which means that having a global string variable and not resetting it to None when you've finished with the value takes up an unneeded entry in the string table. Link to comment Share on other sites More sharing options...
zelazko Posted April 3, 2016 Share Posted April 3, 2016 Is there any way mods or external tools clean the unused string count or something like that? Link to comment Share on other sites More sharing options...
Recommended Posts