BotF Patcher - 22-Aug-2013 Update

BotF Patcher; support/discussion/questions

Moderator: thunderchero

User avatar
QuasarDonkey
Code Analyst
Code Analyst
Posts: 433
Joined: Tue Jul 26, 2011 8:29 pm
Location: Ireland

BotF Patcher - 22-Aug-2013 Update

Post by QuasarDonkey »

Hey guys, I have a new toy for you to play with. Actually it's not really new at all :D
I was hoping some of you wouldn't mind testing it. Presenting:

BotF Patcher

Get it here:
If you're running Windows, just extract the ZIP file, and run the EXE (make sure you extract the patches too).

:!: If you're prototyping a mod, make a Trek.exe backup before goofing with this! I'm 99% confident it won't mess anything up, but you never know.



What do all those colors mean?

After you open a Trek.exe, the list of patches may be colored or not. If not, then none of the listed patches are installed. If a patch is:
  • green: it is installed;
  • bright red with !: it's not installed or it's not vanilla; this means there's probably another conflicting patch installed (but that patch may not be in the list). It might not be wise to install or remove these patches (it's up to you);
  • yellow with +: this means that you've selected a patch to be installed (when you hit "apply");
  • dull red with -: this means that you've selected a patch to be removed (when you hit "apply");
  • otherwise: the patch is not installed (i.e. vanilla code was detected).
You might want to play around with selecting, installing & removing patches from the list. It might seem awkward at first, but I think it works.

The Patch Database

The patch database is not complete. It includes most of the ECM3 patches, but there are plenty of cool patches not included (yet). You can post requests for patches if you like.

:arrow: If you make any new patch files, or fix up the existing ones, please post them here or PM me, and I will update the database for everyone.

Patch File Format

Each patch is in its own .patch file. They're just text files, so you can use any text editor to edit the patch files. You'll find them in the "patches" folder. Here's an example patch:

Code: Select all

NAME: Send Chat Messages with Return Key
DESC: Makes the multiplayer chat window behave more like an instant message client.
AUTHOR: QuasarDonkey
URL: https://www.armadafleetcommand.com/onscreen/botf/viewtopic.php?f=9&t=2199

# This is the old vanilla code:
>> 0x1099c9  89 C8 E8 D0 61 03 00

# This the new patched code:
<< 0x1099c9  E8 22 FD FF FF 31 C0
The only mandatory things are the NAME and the patch codes. You can also specify metadata for DESCription, AUTHOR, and URL. You can add multiple description lines by adding more DESC: tags. And you can add comments with #.

The real meat is in the << and >> tags. Think out >> with the old, in << with the new. The first number after << or >> is the file offset in hex. The other numbers are the bytes (in hex). You can type as many bytes as you want in one line, or split them up into multiple << commands on separate lines. Note you must provide both vanilla code as well as the patched code. This is so the patch can be uninstalled (and it's used to test for conflicts).

The Future

There's still some features that could be added, like multilingual support (you're stuck with English for now). The ability to flag unknown patches/mods would be nice. I think it's better to spend time actually building the patch database first, to make it as useful as possible, because:

:!: The tool is only as good as the patch database. If your version of Trek.exe is patched with something not listed in the database, it will either not show up at all, or it will show up as a conflict in another patch (red with exclamation).
Last edited by QuasarDonkey on Thu Aug 22, 2013 6:41 pm, edited 3 times in total.
User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 3178
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: BotF Patcher

Post by Flocke »

nice one :)
User avatar
Martok
Rear-Admiral
Rear-Admiral
Posts: 1204
Joined: Thu May 01, 2008 2:00 am

Re: BotF Patcher

Post by Martok »

Wow, that looks awesome, QD!


Question: Any idea as to whether it'll conflict with any mods I have installed (and if so, to what degree)? I'm a big fan of Balance of Power, but I'd love to add some of those patches to it.


In any case, this is much appreciated! I'm not sure it's possible to adequately thank you for your efforts (for both this and your other BOTF projects)...but thank you. :D
"Evil is easy, and has infinite forms." -- Pascal
User avatar
QuasarDonkey
Code Analyst
Code Analyst
Posts: 433
Joined: Tue Jul 26, 2011 8:29 pm
Location: Ireland

Re: BotF Patcher

Post by QuasarDonkey »

Any patch that's not bright red should be safe to install/remove.

BoP shows about 9 red patches. If you want to play it safe, just leave those ones alone. But some of them are red because the patches have been updated since Gowron made BoP, e.g. the "Liberating Native Systems" patch.
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7824
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: BotF Patcher

Post by thunderchero »

Auto-Upgrading Ships (Options/Fixes)

your patch says without refit simulation, but has code for refitting.
(if you only want the bugfix for 2.5, without refitting simulation, just replace 74 with EB at asm-44A409)
this is code used in ECM
_________________________________________

Crew Experience fixes 1 & 3

in patch you have fix 2 this is already part of fix 3. this should install correctly but will always show as conflicting.
___________________________________________

Edo god / combat drone cloak (1.b/ 2.a,b,c/ 3.a,b).

you have patch adding 1.a (showing conflicting)
1.b) Disabling the monster cloak only for auto-battle (1.a is redundant for this)

This option is meant to protect the AI (auto-battling only) from losing main fleets against cloaked monsters.
______________________________________________

Orbital Batteries: Ships survive with 0 HPs (fix) & OBs survive with 0 PTs (fix)

at 0x67AA6 conflicts with Establishing a defensive bonus for Strike Cruisers against OBs patch
________________________________________________

If you would check with Flocke on "Send Chat Messages with Return Key" next version of MPR++ is using this code;

0x001099c9 e8 22 fd ff ff eb 33 90 90 90 90
________________________________________________

Ship stats pop-up bugfix

I am showing conflict in ECM 3.0 but do not see any code conflicts?
_________________________________________________

Terraforming Fix for Additional Starting Systems and Minors (updated)

here is what I got from old patcher you gave me.

Code: Select all

>> 0x00050cfe 0d
<< 0x00050cfe 35

>> 0x00050d06 c1
<< 0x00050d06 c6

>> 0x00050d12 41
<< 0x00050d12 46

>> 0x00050d15 3f
<< 0x00050d15 4c

>> 0x00050d17 f6 66 8b 71 6a 39 f3 74 2b ba 81 00 00 00 b8 60 93 57
<< 0x00050d17 c9 31 c0 66 8b 4e 6a 40 d3 e0 48 39 c3 74 32 ba 81 00

>> 0x00050d2a e8 c1 66 0b 00 89 c2 c1 fa 1f f7 fe 6b c2 4c 8b 91 b0 00 00 00 01 d0 66 83 78 3a 00 75 13 43 eb bc 89 d0 e8 1e 21 ff ff 89 41 40 5f 5e 5a 59 5b c3 66 c7 40 3a 00 00 43 eb a3 00 00 00 00
<< 0x00050d2a 00 b8 60 93 57 00 e8 bb 66 0b 00 89 c2 c1 fa 1f f7 f9 31 c0 89 d1 40 d3 e0 09 c3 6b c2 4c 8b 96 b0 00 00 00 01 d0 66 c7 40 3a 00 00 eb af 89 d0 e8 11 21 ff ff 89 46 40 5f 5e 5a 59 5b c3
sorry about the long list but you might also find some new ones to add here;

viewtopic.php?f=4&t=2127&p=34630&sid=b6 ... 290#p34630

thunderchero
User avatar
QuasarDonkey
Code Analyst
Code Analyst
Posts: 433
Joined: Tue Jul 26, 2011 8:29 pm
Location: Ireland

Re: BotF Patcher

Post by QuasarDonkey »

Wow, thanks for the in-depth analysis! I'll fix all the patches and upload them.

I'm not sure what to do with the orbital batteries patches. Is that a bug in my patches, or are they known to conflict? I'll just include a note in that case.
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7824
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: BotF Patcher

Post by thunderchero »

QuasarDonkey wrote:Wow, thanks for the in-depth analysis! I'll fix all the patches and upload them.

I'm not sure what to do with the orbital batteries patches. Is that a bug in my patches, or are they known to conflict? I'll just include a note in that case.
No just updated

you might just want to combine the 2 patches into one

Orbital Batteries: Ships survive with 0 HPs (fix) & OBs survive with 0 PTs (fix) and Establishing a defensive bonus for Strike Cruisers against OBs patch.

and omit 0x67AA6 change from "Ships survive with 0 HPs (fix)" since that change is part of new code for Strike Cruisers against OBs patch.

EDIT: but that would still show conflict if either was applied by it's self.

thunderchero
User avatar
QuasarDonkey
Code Analyst
Code Analyst
Posts: 433
Joined: Tue Jul 26, 2011 8:29 pm
Location: Ireland

Re: BotF Patcher

Post by QuasarDonkey »

In the old AFC page for ship stats popup, there's an error in the patch code: viewtopic.php?name=Forums&file=viewtopic&t=454
5.Disable error message at 0x6EDD0

75 A1 -> EB A1
That should read 75 1A -> EB 1A

And the new STM page: viewtopic.php?f=9&t=454&hilit=ship+stats is also wrong:
5.Disable error message at 0x6EDD0

75 A1 -> EB 1A
That should also read 75 1A -> EB 1A

I've checked vanilla/ECM in a hex editor and ollydbg. It's definitely 1A.
User avatar
QuasarDonkey
Code Analyst
Code Analyst
Posts: 433
Joined: Tue Jul 26, 2011 8:29 pm
Location: Ireland

Re: BotF Patcher

Post by QuasarDonkey »

The new version is here! The database has been expanded to include most, if not all, of the ECM3 patches (there are 70 patches in total).

Get it here: http://sourceforge.net/projects/bofpatcher/files/

The program itself has also been updated, mostly with a few cosmetic enhancements, like shortcut keys (ctrl-o to open, etc.), and the ability to "open with...". Double-clicking a patch will now show patch chunks that are different in the EXE. This is handy for examining conflicting or incorrectly applied patches.

I hope you find it useful. If there are any more patches you would like to see included, just post a request here (or make the patch yourself and send it to me via PM). And please let me know if you run into problems using it.
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7824
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: BotF Patcher - 18-Aug-2012 Update

Post by thunderchero »

looks great,

I still wish it could do other types of code changes but 99% would require user input or editing of files in stbof.res

example;

Tech Level Bonus Factors

viewtopic.php?f=9&t=238

but each one would require % input.

I know I am never happy :roll:

thunderchero
User avatar
QuasarDonkey
Code Analyst
Code Analyst
Posts: 433
Joined: Tue Jul 26, 2011 8:29 pm
Location: Ireland

Re: BotF Patcher - 18-Aug-2012 Update

Post by QuasarDonkey »

No worries. I had plans to add a lot more features, but I'm not sure it's worth spending time on. I'll be posting info shortly on the DLL approach to modding. It may just revolutionize BotF modding :)
User avatar
AlexMcpherson79
Commander
Commander
Posts: 332
Joined: Thu Sep 04, 2008 2:00 am

Re: BotF Patcher - 18-Aug-2012 Update

Post by AlexMcpherson79 »

hey, um... one tiny TINY little problem with the patcher.


grey text on grey background.


just sayin.

edit: Is it just 1.5? cuz the 1.4 screenshot shows a bigger color difference, while on mine here the two are very close (like a light-light grey on light grey.) like reading #000000 text on a #010101 background.
User avatar
QuasarDonkey
Code Analyst
Code Analyst
Posts: 433
Joined: Tue Jul 26, 2011 8:29 pm
Location: Ireland

Re: BotF Patcher - 19-Sep-2012 Update

Post by QuasarDonkey »

AlexMcpherson79 wrote:grey text on grey background.
Thanks for the report Alex. It turns out I was using default system colors in some places, and RGB colors in others. I've patched it up to use the exact same colors as in the above screenshot. Can you verify that it is to your liking? :D

As usual, get the latest version here:
User avatar
AlexMcpherson79
Commander
Commander
Posts: 332
Joined: Thu Sep 04, 2008 2:00 am

Re: BotF Patcher - 19-Sep-2012 Update

Post by AlexMcpherson79 »

Works now. Just a note though for when (if) you do the next version update, not at all required at this point. while we can show more text in the desc box via widening the program window, we can't extend that desc box like with some, ahm, 'user-expandable textboxes' that some websites allow. and since, when theres more text than can be shown at once, and at that point it will actually also create a horizontal scroll bar (even though it word-wraps, nothing pushes beyond the box horizontally AFAIK). Basically, only 2 lines of description available doesn't seem sufficient for the longer-described patches when we're doing several.


Secondary issue: Some patches cause others to go red, while the reserve doesn't seem true until installed alongside. Example:

installing Raid Fix wrt bankrupt empires red-lights Raid 1-4, but installing Raid 1-4 doesn't red-light the first.


also, bulk-installing doesn't do that function until 'applied', so doing them one-by-one to find any incompatibilities... takes a bit of time. eventually, once there's a lot more minipatches one can do, if there are any, there should be notes on what patches it's incompatible with in it's description. Just a suggestion. or 'predictive' function, so when you click 'install' (but not yet apply) it could highlight the ones that would be incompatible, and when you double click the red-lighted one, it could say 'incompatibility caused by:'
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7824
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: BotF Patcher - 19-Sep-2012 Update

Post by thunderchero »

Hi QD,

I just downloaded latest version, 8O I noticed a new patch "Convert Trek.exe to a DLL" but when applied I get message app is no longer vailed win 32 app. I am guessing it is still missing a launcher?

thunderchero
Post Reply

Return to “BotF Patcher”