[!IMPORTANT] BSAs and You

Post » Thu May 24, 2012 8:10 am

Very informative. Thanks for the digging, Lojack!
User avatar
Jason White
 
Posts: 3531
Joined: Fri Jul 27, 2007 12:54 pm

Post » Thu May 24, 2012 9:08 am

Thanks for tracking down and organizing all this info. :goodjob:
User avatar
FLYBOYLEAK
 
Posts: 3440
Joined: Tue Oct 30, 2007 6:41 am

Post » Wed May 23, 2012 8:12 pm

Thank you Lojack for writing this up.
Just to confirm your suspicion: The character-limit for sResourceArchiveList and sResourceArchiveList2 is indeed 256 bytes in skyrim.
User avatar
rheanna bruining
 
Posts: 3415
Joined: Fri Dec 22, 2006 11:00 am

Post » Thu May 24, 2012 9:52 am

Unless you do my trick with 1 letter file-names. :tongue: (Just make sure you keep a list of what's what. :wink:)

Yes but then using SW is out of the question since changing the BSA name would lead Steam to redownload them the next time you launch the game !
User avatar
Loane
 
Posts: 3411
Joined: Wed Apr 04, 2007 6:35 am

Post » Thu May 24, 2012 11:14 am

Thank you Lojack for writing this up.
Just to confirm your suspicion: The character-limit for sResourceArchiveList and sResourceArchiveList2 is indeed 256 bytes in skyrim.
Awesome! Not the fact, the information ;). Thanks for confirming that, I'll update the OP.
User avatar
Devin Sluis
 
Posts: 3389
Joined: Wed Oct 24, 2007 4:22 am

Post » Wed May 23, 2012 11:27 pm

I'm still a little confused about the 255 character limite regarding the BSA loading... so for example... this is my bsa load order
[Archive]sResourceArchiveList=Skyrim - Misc.bsa, Skyrim - Shaders.bsa, Skyrim - Textures.bsa, HighResTexturePack01.bsa, HighResTexturePack02.bsa, Skyrim - Interface.bsa, Skyrim - Animations.bsa, Skyrim - Meshes.bsa, Skyrim - Sounds.bsasResourceArchiveList2=Skyrim - Voices.bsa, Skyrim - Voicesixtra.bsa
How do I actually count the characters? Only characters in their file names are added?
Is this BSA Load Order still good?

Nope for counting every character counts -- ie. spaces punctuation periods use up the count as well

So as DW mentioned you are closing in on the limit in the first line already with about 50 characters left !
User avatar
Daddy Cool!
 
Posts: 3381
Joined: Tue Aug 21, 2007 5:34 pm

Post » Thu May 24, 2012 10:22 am

Yes but then using SW is out of the question since changing the BSA name would lead Steam to redownload them the next time you launch the game !
Isn't SW inherently incompatible with this method of BSA activation since it uses the esp as a bsa activator?
User avatar
jessica sonny
 
Posts: 3531
Joined: Thu Nov 02, 2006 6:27 pm

Post » Wed May 23, 2012 8:21 pm

Lojack- more like Kojack

You cracked the code. now all my trials make sense. combined with the fact that only bsa made with the CK will work. I've had nothing but failures trying to get bsa made with OBMM/FOMM - maybe want to note that.

I like your approach that this is a bethesda problem, but maybe doing this was a way to avoid the crashes that used to come when two bsa had the same file in it?

What is the best way to ask bethesda to fix this issue?

thanks
User avatar
Jerry Cox
 
Posts: 3409
Joined: Wed Oct 10, 2007 1:21 pm

Post » Thu May 24, 2012 3:21 am

I like your approach that this is a bethesda problem, but maybe doing this was a way to avoid the crashes that used to come when two bsa had the same file in it?

What is the best way to ask bethesda to fix this issue?

thanks
That issue was important to fix, but they dropped the ball in fixing it IMHO.

Best way of contacting Bethesda is through Gstaff - Lojack said he did this, but I don't know if he ammended his PM with my suggestion for loose files to always override or not though.

Poor Gstaff must be getting so many PMs, he still hasn't read mine. :P
User avatar
Jonathan Montero
 
Posts: 3487
Joined: Tue Aug 14, 2007 3:22 am

Post » Thu May 24, 2012 6:30 am

You cracked the code. now all my trials make sense. combined with the fact that only bsa made with the CK will work. I've had nothing but failures trying to get bsa made with OBMM/FOMM - maybe want to note that.
As far as I remember, BSAs contained a version number. So if OBMM/FOMM create BSAs with Oblivion / Fallout 3 version numbers, it does make sense that Skyrim would refuse to load them.
User avatar
Cat Haines
 
Posts: 3385
Joined: Fri Oct 27, 2006 9:27 am

Post » Thu May 24, 2012 2:32 am

Thank you so much for taking the time to put this information together for us. It's greatly appreciated! :thanks:
User avatar
suzan
 
Posts: 3329
Joined: Mon Jul 17, 2006 5:32 pm

Post » Thu May 24, 2012 12:44 am

Other than FOMM, is there another tool available for unpacking BSA's?
User avatar
Karen anwyn Green
 
Posts: 3448
Joined: Thu Jun 15, 2006 4:26 pm

Post » Thu May 24, 2012 7:36 am

You cracked the code. now all my trials make sense. combined with the fact that only bsa made with the CK will work. I've had nothing but failures trying to get bsa made with OBMM/FOMM - maybe want to note that.

I like your approach that this is a bethesda problem, but maybe doing this was a way to avoid the crashes that used to come when two bsa had the same file in it?
OBMM/FOMM don't make good BSAs for Skyrim. Use BSAopt (or one of the other similar branches of the tool) instead.

As for specifics:

What definitely needs fixing: providing a way to control WHICH Plugin BSA wins when conflicts occur. Right now, it's simply the alpha-numeric sorting of the BSAs. So technically you can control their order, however not in a good way. Renaming BSAs would require renaming their ESPs, which leads to issues I already mentions.

The other thing that I've requested to be changed is the role of Loose Files in the mix. Right now, Registered BSAs have lowest priority, followed by Loose Files, followed by Plugin BSAs. That means Loose Files can't override files in a Plugin's BSA. I request that instead Loose Files always override, so the order would be Registered BSAs->Plugin BSAs->Loose Files.

That issue was important to fix, but they dropped the ball in fixing it IMHO.

Best way of contacting Bethesda is through Gstaff - Lojack said he did this, but I don't know if he ammended his PM with my suggestion for loose files to always override or not though.

Poor Gstaff must be getting so many PMs, he still hasn't read mine. :P
I just sent him a link, plus a small bit of extra information. I probably should recommend the specific solution as well, I suppose.

I bet with SW and the CK just coming out, he's got to sort through a mass of PM's to pick out stuff that's actually high enough priority to respond to.
User avatar
gemma
 
Posts: 3441
Joined: Tue Jul 25, 2006 7:10 am

Post » Thu May 24, 2012 12:30 am

Other than FOMM, is there another tool available for unpacking BSA's?
BSAOpt. Don't have a link sorry, but it's on Nexus and the OBGE Wiki.

EDIT: Dammit, Lojack, that's the second time you've ninja'd me this week! Getting rusty...
User avatar
BRIANNA
 
Posts: 3438
Joined: Thu Jan 11, 2007 7:51 pm

Post » Wed May 23, 2012 10:34 pm

Other than FOMM, is there another tool available for unpacking BSA's?

Not real familiar with Fallout so not sure if it is the same as FOMM but I used http://fallout3.nexusmods.com/downloads/file.php?id=34
User avatar
WTW
 
Posts: 3313
Joined: Wed May 30, 2007 7:48 pm

Post » Thu May 24, 2012 12:03 pm

The other thing that I've requested to be changed is the role of Loose Files in the mix. Right now, Registered BSAs have lowest priority, followed by Loose Files, followed by Plugin BSAs. That means Loose Files can't override files in a Plugin's BSA. I request that instead Loose Files always override, so the order would be Registered BSAs->Plugin BSAs->Loose Files.

I just sent him a link, plus a small bit of extra information. I probably should recommend the specific solution as well, I suppose.
Well I don't want to harass the staff at Bethesda, but I'd think more than one PM would help. ... and this is all compounded by Steamworks resetting the timestamps on esp. A fix may be a while.

Maybe if we could recruit the CK beta testers to send in their support!

This hierarchy would at least solve the BSA redirection problem. I'm also wondering if the now missing "load loose files on the Skyrim Launcher was part of this problem.

If we could suggest how to solve the multiple BSA problem and they could implement it - I'd think having the dummy esp load order determine which wins would be the most modder friendly.

http://skyrim.nexusmods.com/downloads/file.php?id=247
User avatar
Nathan Risch
 
Posts: 3313
Joined: Sun Aug 05, 2007 10:15 pm

Post » Thu May 24, 2012 12:51 am

If we could suggest how to solve the multiple BSA problem and they could implement it - I'd think having the dummy esp load order determine which wins would be the most modder friendly.

http://skyrim.nexusmods.com/downloads/file.php?id=247
What happens if you have a 'dummy' plugin that isn't a dummy? Then you've got resources tied to records, which is less flexible. Better they give as flexible a system as possible for us to impose any restrictions we want upon, rather than us having to hack away at a restricted system to give the flexibility we want.

There are two separate issues for modding Skyrim ATM:

1. BSA load order. This is an issue for Bethesda to fix. Lojack has notified Gstaff and provided an optimal solution (IHHO, but IMHO too).

2. Steam Workshop using timestamps for version checking. This is an issue for Valve to fix. I've notified Gstaff and hopefully he can pass that on to Valve.

Unless anyone knows of a better way to contact Valve, I don't think there's much more we can do.
User avatar
emily grieve
 
Posts: 3408
Joined: Thu Jun 22, 2006 11:55 pm

Post » Wed May 23, 2012 11:48 pm

I did some hacks with FindFirstFile / FindNextFile and here are my findings.

WARNING: big text file there! http://dl.dropbox.com/u/954487/skyrim.txt

here is the extract of interest

00010295 980.02227783 [5976] FindFirstFileA[01a94338]. lpFileName: DATA\*.esp. Found: Acquisitive Soul Gems.esp00010296 980.03222656 [5976] FindNextFileA[01a94338]. cFileName: dd - realistic ragdoll force - realistic.esp, ftLastWriteTime: ef6eba6c00010297 980.03247070 [5976] FindNextFileA[01a94338]. cFileName: hideout.esp, ftLastWriteTime: b545fc0000010298 980.04028320 [5976] FindNextFileA[01a94338]. cFileName: HighResTexturePack01.esp, ftLastWriteTime: 49fc2a0000010299 980.04064941 [5976] FindNextFileA[01a94338]. cFileName: HighResTexturePack02.esp, ftLastWriteTime: 6dbf700000010300 980.04095459 [5976] FindNextFileA[01a94338]. cFileName: portal2mod.esp, ftLastWriteTime: e25f2f0700010301 980.04119873 [5976] FindNextFileA[01a94338]. cFileName: smakit_house_markers.esp, ftLastWriteTime: 7b6078c500010302 980.04144287 [5976] FindNextFileA[01a94338]. Finish.00010303 980.04150391 [5976] FindClose. HANDLE: 01a94338

as you can see esp files are loaded in alphabetic order (case insensitive) as OP pointed out. I believe we can hack this process
by ordering by ftLastWriteTime quite easily.

I tried but was unable to write a plugin for skse and wrote my own loader.

QUESTION to skse people. How do I write a plugin to Hook to a Windows API?

QUESTION for non-english people: I noticed that Skyrim uses FindFirstFileA instead of FindFirstFileW, so Skyrim might not support japanese/chinese/cyrillic (not ANSI) file names. Do you confirm?
User avatar
Claudz
 
Posts: 3484
Joined: Thu Sep 07, 2006 5:33 am

Post » Wed May 23, 2012 8:24 pm

BSAOpt. Don't have a link sorry, but it's on Nexus and the OBGE Wiki.

EDIT: Dammit, Lojack, that's the second time you've ninja'd me this week! Getting rusty...

But I don't want to pack them into a BSA again - I just want to unpack the BSA...
User avatar
Alan Cutler
 
Posts: 3163
Joined: Sun Jul 01, 2007 9:59 am

Post » Thu May 24, 2012 1:41 am

QUESTION for non-english people: I noticed that Skyrim uses FindFirstFileA instead of FindFirstFileW, so Skyrim might not support japanese/chinese/cyrillic (not ANSI) file names. Do you confirm?
Oh dear god, please don't tell me they're still not using Unicode?

But I don't want to pack them into a BSA again - I just want to unpack the BSA...
You can unpack only with BSAOpt IIRC.
User avatar
Veronica Martinez
 
Posts: 3498
Joined: Tue Jun 20, 2006 9:43 am

Post » Thu May 24, 2012 3:48 am

Well I don't want to harass the staff at Bethesda, but I'd think more than one PM would help. ... and this is all compounded by Steamworks resetting the timestamps on esp. A fix may be a while.
GStaff's good about getting back to us about real issues, plus knows enough about modding internals to understand all the technical jargon. I think patience here is the way to go. Plus, this thread's only been up what, 8 hours or so?

This hierarchy would at least solve the BSA redirection problem. I'm also wondering if the now missing "load loose files on the Skyrim Launcher was part of this problem.

If we could suggest how to solve the multiple BSA problem and they could implement it - I'd think having the dummy esp load order determine which wins would be the most modder friendly.
BSA Redirection isn't needed at all anymore for Skyrim. Loose Files always override files in registered BSAs. The #1 issue is what happens when two Plugin-loaded BSAs have the same resource - deciding which one to load. The #2 issue is that Loose Files can't override a file in a Plugin-loaded BSA, although this one can be worked around.

1. BSA load order. This is an issue for Bethesda to fix.
Which is exacerbated by the fact that EVERY Steam Workshop mod uses a BSA, and a lot of Steam Workshop mods are texture replacers - so you run into the situation quite often with multiple BSAs containing the same file.
I did some hacks with FindFirstFile / FindNextFile and here are my findings.

QUESTION for non-english people: I noticed that Skyrim uses FindFirstFileA instead of FindFirstFileW, so Skyrim might not support japanese/chinese/cyrillic (not ANSI) file names. Do you confirm?
I'm personally going to hold off on a plugin to solve the problem until we get some official word back.

For ANSI stuff: yes I can confirm that. Not to mention plugins.txt isn't encoded in a UTF-8 or other similar encoding, it's encoded in ANSI. The Russian version of the game is actually a different build because of this, Russian characters aren't supported by the Windows 1252 codepage, so they need a different EXE that uses the Windows 1251 codepage.

Oh dear god, please don't tell me they're still not using Unicode?

You can unpack only with BSAOpt IIRC.
Dear god, they STILL aren't using Unicode.

And BSAopt can output to a .BSA, just add the '.bsa' on to the output file name. Took me a while to figure that one out myself.
User avatar
Jimmie Allen
 
Posts: 3358
Joined: Sun Oct 14, 2007 6:39 am

Post » Thu May 24, 2012 4:06 am

Oh dear god, please don't tell me they're still not using Unicode?
You can unpack only with BSAOpt IIRC.
And BSAopt can output to a .BSA, just add the '.bsa' on to the output file name. Took me a while to figure that one out myself.

Ah, yes, got it sorted. Interface was confusing me a bit. If you only want to unpack, you pick a folder and just say Use Folder, otherwise it wants a file name for the new BSA.

Very good. Thanks guys.
User avatar
Tanika O'Connell
 
Posts: 3412
Joined: Fri Jan 26, 2007 1:34 am

Post » Thu May 24, 2012 6:30 am

GStaff's good about getting back to us about real issues, plus knows enough about modding internals to understand all the technical jargon. I think patience here is the way to go. Plus, this thread's only been up what, 8 hours or so?
And I've also linked a post in the beta forum to this as well, for added visibility. It won't get lost in the sea of posts as easily this way.

Also, a very excellent write-up and testing protocol. I don't think I'd have had the patience for all that, but your findings mirror my own less than stellar testing.
User avatar
T. tacks Rims
 
Posts: 3447
Joined: Wed Oct 10, 2007 10:35 am

Post » Wed May 23, 2012 9:08 pm

I had also thought about that approach initially when coming up for a plan for Wrye Bash. It'd be easy enough with Wrye Bash - BAIN already knows which files should be winning, just make a BSA out of that and then ensure it loads last. But, I decided against it because:

Uninstall a package, using Loose Files:
  • Determine if the file(s) should be replaced by a lower Install Order package.
  • If so, extract those files from the lower Install Order packages (this is the slowest part) and install them.
  • If not, just delete the files
Uninstall a package, using a master BSA that's always loaded last:
  • Determine the new files that should be in the BSA.
  • Fastest way:
    • Unpack the current BSA (slow for a large BSA).
    • Replace/remove applicable files.
    • Repackage into BSA (slow, again).
And of course similar flow for installing a package.

I think you have assumed, here, that ZZZ.bsa (or whatever name) is primary data. But we don't need that.

I was thinking: build ZZZ.bsa from known conflicts based on lose files.

If that's still too slow [and eventually, I am sure that it will be] there are a variety of ways to manage the needed time. For example, note that the bsa file format can be used inefficiently. (You could append a "zip" file header to a .bsa file that would let you unpack it using zip methods.) But probably a better approach is to just have the user decide when and if to do rebuilds (much like bashed patch), instead of tying rebuilds to package install/uninstall.

Then again, if Bethesda will fix things so that loose files get loaded last (which I think will also matter for sane behavior of Creation Kit), all of this should be unnecessary...
User avatar
Lyndsey Bird
 
Posts: 3539
Joined: Sun Oct 22, 2006 2:57 am

Post » Thu May 24, 2012 8:08 am

Thanks for all your research on this LoJack, and brilliantly written post :)
User avatar
Tyrone Haywood
 
Posts: 3472
Joined: Sun Apr 29, 2007 7:10 am

PreviousNext

Return to V - Skyrim