So I used WeiDU command line functions (--cmp-from BGMain_unpatched.exe --cmp-to BGMain.exe --out t-patch.tpp) to generate a non-smart patch for the .exe. It generated a ~480kb file over 19,000 lines, meaning it patches that many bytes in the .exe . But, the good news:I'd be happy if someone wrote a proper installer for this. Ideally it should:any chance of making the main patch a little more WeiDU-friendly? If for no other reason than most (pretty much all) megamods are WeiDU, thus better to have the chance of detecting each other and recording their installation in the WeiDU.log. I've done a WeiDU conversion for small snippets of your patch but don't understand the bsdiff/bspatch format well enough to translate it without a lot of manual hackery... maybe someone else can.
.patch the executable (same as now, but check whether the version is correct)
.replace _LOW animations in vanilla game files while checking to not accidentally replace them for creatures using new slots
Further components could include:
.automatically detecting mega mods and replacing their animation references with compatible ones
.going through the vanilla game files to make use of new animations (i.e. placing the new content in the game)
- The patch compresses to about 36kb - around half the compressed bspatch at ~78kb
- I diffed the .exes patched by the original bspatch and the WeiDU patch. They were identical.
- Rather amazingly, WeiDU patches all those bytes in the .exe in like a second or two
- It is called from about 3 lines of code in the .tp2, so it won't bog it down
- Adding new patches or changing this one is dead easy, even easier than directly editing the .exe (though you may need that as a reference).
I can try to compress the raw patch a bit with WRITE_LONGs or WRITE_ASCIIs instead of WRITE_BYTEs, but given the existing compression rate and execution speed, I don't think it's worth it. Plus it'd probably make it tougher to maintain. I will however make it a bit smarter to check for a few existing hex addresses have the expected data before applying the patch. Checking every single one would be a waste of time in my opinion, but we could check three or five or ten or whatever, in different spots. Unless you know of some bytes that are more significant, I'll just pick a few at random to check, something like first, middle and last blocks probably.
But that makes me think of something. Yes, this requires the patched ToB executable, but is it possible to do the same or similar for the patched SoA executable? The main reason I'm asking is because I know at least a couple folks are playing Aurora with the svirfneblin animations on SoA. And though I was going to "unstack" the existing slots we use and use this scheme instead for the next release, I don't want to foist ToB on them if they don't want to run out and get it (and some don't). And I'm not sure about the megamods, but I think at least one or two might be SoA-compatible too, or other smaller mods that add animations are anyhow.
So I'll work on making the _LOW patch a bit smarter after that, but I'm still wondering about this...
Still not quite sure why the existing patch isn't good enough. If it finds creatures that have the _LOW animations, it just changes them to the equivalent non-LOW versions, aye? Isn't that sufficient? Character-type creatures who don't have the _LOW animations should be fine as they are, shouldn't they? The only exceptions I can think of offhand are svirfneblin and maybe a few other gnomes, but we patch these in Aurora anyway, and I don't think that's what you're talking about.It's possible, but I wanted to avoid the huge .tp2 (bsdiff compresses extremely well) and keep it simple for me to maintain. You could still REQUIRE_COMPONENT if you check for the _LOW fix or the other (eventual) WeiDU components of this. You could also make a component check for the WeiDU component executing the current patch, now that I think about it.It should be possible (already does the latter, no?) but ideally the whole patch should be converted to WeiDU. Also then other WeiDU mods using new animations can do a REQUIRE_COMPONENT or similar on this, whereas it's difficult or impossible now.
It doesn't quite do the latter, it just replaces any _LOW (5xxx) animations it finds during install. A smart patch would replace all in the original game files and for override/mod files check if a creature looks like it should have a character animation (is it a humanoid race, does it have a corresponding class, etc.) and patch those while keeping new references (which could also be 5xxx) intact where they're used.
Edit: ok, I think I see what you're getting at re: mod _LOW creatures. I suspect there are very few of those, but I can check with WeiDU anyway, and see if there's some reason any that turn up should not get converted the same way as vanilla _LOW creatures.
So after that, that would leave:
The first item should be easy after Arkenor finishes his analysis. I can do part of the second since, as I said, we already do it in Aurora for the UD svirfneblin, goblin captains, etc. But someone should be able to help with this too, by suggesting other existing CREs who would more appropriately get IWD or other animations. And I'm thinking that someone (or one of the someones at least) should be Jarno, since he was champing at the bit for this and now has the chance to contribute something . An easy way to start is to just grep through the creature names with DLTCEP and see if there's an obvious targets, for stuff like Orc Shaman (if there are such CREs and animations, for example)..automatically detecting mega mods and replacing their animation references with compatible ones
.going through the vanilla game files to make use of new animations (i.e. placing the new content in the game)
Edited by Miloch, 22 December 2009 - 10:45 AM.