Unwanted AI Ship Scrapping Fix

AI Fleet Buildup (basics); support/discussion/questions

Moderator: thunderchero

Post Reply
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1928
Joined: Sun Apr 27, 2008 2:00 am

Unwanted AI Ship Scrapping Fix

Post by Spocks-cuddly-tribble »

This fix is dedicated to Flocke, who complained about the issue during his outstanding digging into the mechanics of savegame files. :up:


Keeps the AI from scrapping stranded task forces (redeploying might free some ships) and mindless scrapping too many ships during credit deficit.

Code: Select all

NAME: Unwanted AI Ship Scrapping Fix
DESC: Keeps the AI from scrapping stranded task forces and scrapping too many ships during credit deficit.
AUTHOR: Spocks-cuddly-tribble
URL: https://www.armadafleetcommand.com/onscreen/botf/viewtopic.php?p=54681#p54681

# remove 40D1B3 call 40CE30 AI_Scrap_Stranded_Task_forces
>> 0xC5B3 E8 78 FC FF FF
<< 0xC5B3 90 90 90 90 90

# remove 40D1DD div esi (senseless division/lowering of credit deficit)
>> 0xC5DD F7 F6
<< 0xC5DD 90 90
# 40D205 MOV ECX,EBX (use 'real fleet support cost' i.e. scrap ships until income OK)
>> 0xC601 31 FF
<< 0xC601 8B CB

# 40D1F1 JMP 40D1C2, NOP // disable scrapping ships due to credit deficit when at war OPTION
# >> 0xC5F1 B8 09 00 00 00
# << 0xC5F1 EB CF 90 90 90

So destroying an outpost or stealing some credits won't cut it anymore to get rid of an overpowered AI fleet. :wink:
Last edited by Spocks-cuddly-tribble on Sun Aug 22, 2021 9:20 am, edited 1 time in total.
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 3246
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: Unwanted AI Ship Scrapping Fix

Post by Flocke »

Nice one! What I complained however wasn't stranded ships nor that they scrap too many to compensate their deficite, but that the AI scrapped valueable ships for nothing that could have turned around the war it was about to loose against the other ai empires. That situation it better accepted the deficit or even go in dept but keep it's fleet to fight the other empires back.

By this fix the ai doesn''t behave any less mindless I fear. When the deficit is reached it happily scraps half the fleet in a loosing war where the whole empire is soon to be conquered and the enemy fleets are right ahead and already attacking. Ah well, but the deficit is balanced. Loose my most powerful homeworld system but the deficit is fine. Great. :lol:

But in my save game testing I found I just needed to give them a multitude of excessive money and all was fine. Guess the AI plans ahead the deficit for several turns and mindless starts to scrap ships if in fear of a coming bankruptcy.

Was the Romulans btw that I had to witness that tragedy, just like they mindlessly blew up their homeworld in the show. Not my universe. :x
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1928
Joined: Sun Apr 27, 2008 2:00 am

Disable ANY AI Ship Scrapping (for Flocke)

Post by Spocks-cuddly-tribble »

You are right, the fix won't entirely take care of your issue. But it corrects the bias to scrap ships until the cumulated 'maintenance' costs of the srapped ships reach the 'deficit' (in most cases the AI will scrap its entire fleet with no credit compensation :shock: ).

Flocke wrote: Sat Aug 21, 2021 9:51 pmThat situation it better accepted the deficit or even go in dept but keep it's fleet to fight the other empires back.
The BotF AI is a 'massive tool' with no global awareness of the overall situation. However, here comes your workaround:

Code: Select all

NAME: Disable ANY AI Ship Scrapping
DESC: Disables any AI Ship Scrapping no matter what.
AUTHOR: Spocks-cuddly-tribble
URL: https://www.armadafleetcommand.com/onscreen/botf/viewtopic.php?p=54687#p54687

# remove 40DDF7 call 40D170 AI_Ship_Scrap_if_Range_Loss_Credit_Deficit
>> 0xD1F7 E8 74 F3 FF FF
<< 0xD1F7 90 90 90 90 90

EDIT: I also updated above patch with an option to disable scrapping ships due to credit deficit when at war. :wink:

Alternatively, you can have the AI scrapping only its colony ships due to credit deficit when at war: :idea:

Code: Select all

0040D1F1                 mov     eax, 9  // 0xC5F2 09 -> 01

But keep in mind a credit deficit in unmodded BotF is bad news. It means (inter alia) all build tasks are on hold, with only the square root of the industry outputs used to lower the deficit. After the last TTs are consumed there won't be ever any possibility to conquer systems. You can't expand due to inability to build shipyards, you can't even produce basic food structures to prevent population from starving....
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 3246
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: Unwanted AI Ship Scrapping Fix

Post by Flocke »

Like you say, the BotF AI is a massive tool with no awareness of the situation. :lol: Yeah there are situations where it might be wise to scrap some ships. The AI however doesn't care much on system buildup and stuff anyhow. Not sure if a deficit actually prevents it from spawning ships. Even if so, I rather watch it starve this way than to scrap it's fleet while it is in a large need for defense.

To check for whether it is at war I think is a great compromise! :up:
User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 7935
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.

Re: Unwanted AI Ship Scrapping Fix

Post by thunderchero »

Flocke wrote: Tue Aug 24, 2021 5:54 am To check for whether it is at war I think is a great compromise! :up:
even better would be if at war they scrap only all those TT's they build. :grin:
Post Reply

Return to “AI Fleet Buildup (basics)”