AI Tasks

AI Task Modifiers; support/discussion/questions

Moderator: thunderchero

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

AI Tasks

Post by Spocks-cuddly-tribble »

:arrow: AI Task Modifiers (ds:58AFEC)


Address of the two byte modifiers in trek.exe at 0x188DEC + (race ID * 144h) + (task ID * 12h) + (agenda ID * 2).

To get a better overview copy & paste the whole 0x144 byte tables into new hex-editor windows (one for each empire) and set them to 18 bytes per row. Each line represents a task and each two byte column an agenda:


:arrow: Task IDs: (ship tasks according to sub_4E4218)
0 - Explore
1 - Raid
2 - Colonize
3 - Tform
4 - Develop System
5 - Build Ship
6 - Buildbase
7 - Invade
8 - Accept Proposal (default -1)
9 - Offer Proposal
A - Attack
B - Build Wonder
C - Patrol
D - Train
E - Repair
F - Harass

:arrow: Agenda IDs: (set by sub_406990)
DCER wrote:0 - Normal Expansion
1 - Unopposed Expansion
2 - Normal Consolidation
3 - Defensive Consolidation
4 - Offensive Consolidation
5 - Cold War
6 - Defensive War
7 - Offensive War
8 - Jihad

- the modifiers influence (to some extent) which AI tasks take precedence over others (assigning of ships or sysDev vs BldShip)
- default range of the modifiers is between 0 and 10 (task8 -1), higher values are possible
- Proposal modifiers of 0 did not prevent the AI from accepting/offering non-aggression
- Offer Proposal (9) might influence AI gifts to other AI empires and/or minor races, Accept Proposal (8) seems to have no impact at all
- Build Wonder (B) is flawed code for one-per-empire structures

I successfully tested colonization modifiers of 0x32 (for all 9 cardassian task 2 agendas) observing a more aggressive colonization behavior.
Last edited by Spocks-cuddly-tribble on Thu Jun 23, 2022 2:26 pm, edited 25 times 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: 3179
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: AI Project

Post by Flocke »

cool stuff, am sure AI can be tweaked alot! :)
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: AI Project

Post by thunderchero »

Nice piece of the puzzle agreed, :wink:

I wonder if the table could be increased to include minors :D (I know I am just dreaming)

thunderchero
User avatar
Peter1981
Rear-Admiral
Rear-Admiral
Posts: 1118
Joined: Tue May 06, 2008 2:00 am
Location: England

Re: AI Project

Post by Peter1981 »

Spocks-cuddly-tribble wrote:I successfully tested colonization modifiers of 0x32 (for all 9 cardassian task 2 agendas), observing a more aggressive colonization behavior.
This may hold the promise to solve one of the most obvious AI flaws. Good work SCT :D
User avatar
Tethys
Past Administrator
Past Administrator
Posts: 2392
Joined: Fri Jul 18, 2008 2:00 am
Location: Your mom's bed ;)
Contact:

Re: AI Project

Post by Tethys »

Just some thoughts on the ones that are still unknown, hopefully some will be right :lol: :

Enter wormhole
Fleet (re)deployment
Defend
Rendezvous
Not for the weak of heart...
Galaxies MOD v0.4.0 <--- GALM/Galaxies Mod latest version
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1870
Joined: Sun Apr 27, 2008 2:00 am

OB Firepower & Ground Combat Checks for AI Invade/Harass Tasks

Post by Spocks-cuddly-tribble »

The default codes read nonsensical values like shipcosts vs inaccurate OB firepower and unused/wrong features for the ground combat chance.

Note the patches require fixing all known bugs and missing features of the game manual from this topic: viewtopic.php?p=17963#p17963

Code: Select all

NAME: OB Check Fix for AI Invade/Harass Tasks
DESC: Sets a Fleet Shields/Hull vs OB Firepower reference Ratio of X:1 (default 4).
AUTHOR: Spocks-cuddly-tribble
URL: https://www.armadafleetcommand.com/onscreen/botf/viewtopic.php?p=34120#p34120

>> 0x78D3F 8A 40 52 89 E2 25 FF 00 00 00 E8 72 60 FF FF 8B 54 24 68 66 83 FA 04 0F 85 FF 00 00 00 31 C0 66 8B 84 24 1C 01 00 00 47 01 C6
<< 0x78D3F 8B 68 3C 89 E2 0F B6 40 52 90 E8 72 60 FF FF 8A 44 24 68 3C 04 7F 13 8B 94 24 94 00 00 00 3C 03 75 03 D1 E2 90 03 EA 47 03 F5

>> 0x78DA1 E8 DA 9C FD FF 89 C3 0F AF D9 31 C0 BA 02 00 00 00 8A 45 4C E8 C6 9C FD FF 0F AF C1 8B 94 24 30 01 00 00 01 D8 0F AF D0 8D 04 95 00 00 00 00 29 D0
<< 0x78DA1 3C 23 75 03 8A 45 44 E8 D3 9C FD FF 8B 9C 24 30 01 00 00 3B FB 7D 02 33 FF 0F AF C1 0F AF C3 90 90 3B C6 7C 02 33 FF 8B D0 D1 E0 D1 E0 90 90 90 90

#0047993F     8B68 3C           MOV EBP,[EAX+3C] // current hull points

#00479944     0FB640 52         MOVZX EAX,BYTE[EAX+52] // shiplist.sst ID
#00479948     90                NOP

#0047994E     8A4424 68         MOV AL,[ESP+68] // ship function
#00479952     3C 04             CMP AL,4
#00479954     7F 13             JG SHORT 479969 // skip if not 0-4 (war ship)
#00479956     8B9424 94000000   MOV EDX,[ESP+94] // shields
#0047995D     3C 03             CMP AL,3 // if strike cruiser...
#0047995F     75 03             JNZ SHORT 479964
#00479961     D1E2              SHL EDX,1 // ...double shields vs OBs (given the missing feature fix for strike cruisers)
#00479963     90                NOP
#00479964     03EA              ADD EBP,EDX // shields + hull

#00479967     03F5              ADD ESI,EBP // sum shields + hull of all war ships


#004799A1     3C 23             CMP AL,23 // for minor & rebel...
#004799A3     75 03             JNZ SHORT 4799A8
#004799A5     8A45 44           MOV AL,[EBP+44] // ...use pop ID for weapon tech level
#004799A8     E8 D39CFDFF       CALL 453680 // GetTechLevel
#004799AD     8B9C24 30010000   MOV EBX,[ESP+130] // number of OBs...
#004799B4     3BFB              CMP EDI,EBX     // vs number of war ships (funtions 0-4)
#004799B6     7D 02             JGE SHORT 4799BA // if more OBs than war ships...
#004799B8     33FF              XOR EDI,EDI  // ...skip system attack

#004799BD     0FAFC3            IMUL EAX,EBX // OB fire power * number of OBs vs...
#004799C0     9090              NOP
#004799C2     3BC6              CMP EAX,ESI // ...sum shields + hull of all war ships
#004799C4     7C 02             JL SHORT 4799C8 // if the fleet is in danger... 
#004799C6     33FF              XOR EDI,EDI  // ...skip system attack
#004799C8     8BD0              MOV EDX,EAX  // OB firepower total
#004799CA     D1E0              SHL EAX,1 // * 2 OB firepower total
#004799CC     D1E0              SHL EAX,1 // 2 * 2 OB firepower total * 4 = effect limit 4:1 fleet vs OB firepower total
#004799CE     90909090          NOP

#004799CC     03C2              ADD EAX,EDX     ; = effect limit 3:1 for Fleet Shields + Hull vs OB firepower total // 9090 NOP = 2:1

#47990B call 4466F0 AI_OB_output_ID_11_check_get_num -> call 446894 popup_nums_OBs_active => OPTION to read number of active OBs (cheat)
Output value is 0-1 depending on a ratio with a 'satisfactory' effect limit.

Reference ratio can be adjusted at the end of the code for the AI taking more risks against OBs:

D1 E0 90 90 90 90 (4:1) -> 03 C2 90 90 90 90 (3:1) ; even more risks -> 90 90 90 90 90 90 (2:1).

Higher reference ratios might slow down the AI conquering enemy systems, but in the long run it might do better.



Code: Select all

NAME: AI Invade Task Ground Combat Check Fix
DESC: Source Data Corrected & Output changed from Ratio to Success Chance.
AUTHOR: Spocks-cuddly-tribble
URL: https://www.armadafleetcommand.com/onscreen/botf/viewtopic.php?p=34120#p34120

>> 0x78F6C E8 0F 9B FD FF
<< 0x78F6C 90 90 90 90 90

>> 0x78F91 31 C0 8D 94 24 20 01 00 00
<< 0x78F91 03 7B 70 EB 55 90 90 90 90
 
>> 0x79006 89 84 24 4C 01 00 00 8B 84 24 5C 01 00 00 8B 94 24 5C 01 00 00 8B 40 40 66 8B 52 44 89 84 24 48 01 00 00 31 C0 DF AC 24 48 01 00 00 66 89 D0 DD 9C 24 48 01 00 00 E8 AF C7 FE FF DC 8C 24 48 01 00 00 D9 84 24 60 01 00 00
<< 0x79006 8B D4 8B C5 89 3A DB 02 69 C8 BC 01 00 00 0F B7 89 A6 1B 5B 00 83 C1 64 89 0A DB 02 DC 0D 7C 87 57 00 DE C9 E8 C1 C7 FE FF DE C9 D8 C8 8B 84 24 5C 01 00 00 0F BF 00 E8 AE CC FC FF 89 02 DB 02 D8 C8 D8 C1 DE F9 EB 75 90


#00479B6C     9090909090         NOP

#00479B91     037B 70            ADD EDI,[EBX+70]
#00479B94     EB 55              JMP SHORT 479BEB
#00479B96     90909090           NOP

#00479C06     8BD4               MOV EDX,ESP
#00479C08     8BC5               MOV EAX,EBP // attacker race ID
#00479C0A     893A               MOV [EDX],EDI
#00479C0C     DB02               FILD DWORD[EDX]
#00479C0E     69C8 BC010000      IMUL ECX,EAX,1BC
#00479C14     0FB789 A61B5B00    MOVZX ECX,WORD[ECX+5B1BA6]
#00479C1B     83C1 64            ADD ECX,64
#00479C1E     890A               MOV [EDX],ECX
#00479C20     DB02               FILD DWORD[EDX]
#00479C22     DC0D 7C875700      FMUL QWORD[57877C]
#00479C28     DEC9               FMULP ST(1),ST
#00479C2A     E8 C1C7FEFF        CALL 4663F0 // GroundCombat_Race_Weapon_tech_to_FPU
#00479C2F     DEC9               FMULP ST(1),ST
#00479C31     D8C8               FMUL ST,ST
#00479C33     8B8424 5C010000    MOV EAX,[ESP+15C]
#00479C3A     0FBF00             MOVSX EAX,WORD[EAX]
#00479C3D     E8 AECCFCFF        CALL 4468F0 // Ground_Defense__system
#00479C42     8902               MOV [EDX],EAX
#00479C44     DB02               FILD DWORD[EDX]
#00479C46     D8C8               FMUL ST,ST
#00479C48     D8C1               FADD ST,ST(1)
#00479C4A     DEF9               FDIVP ST(1),ST
#00479C4C     EB 75              JMP SHORT 479CC3
#00479C4E     90                 NOP
Gives the AI the correct success chance of invasion with the TTs the AI tries to assign to the Invade task (cf. viewtopic.php?p=56533#p56533).

Code: Select all

41E87C   fcomp   ds:577704 // 0.75 at 0x175504 (00 00 00 00 00 00 E8 3F) -> min limit to issue the invade task

41E45B   fcomp   ds:577754 // 0.85 at 0x175554 (33 33 33 33 33 33 EB 3F) -> max limit to skip allocation of further TTs
0.75 (success chance) = ratio of 1.75 times defender ground combat value
0.85 (success chance) = ratio of 2.4 times defender ground combat value

I.e. a minimum safety buffer of e.g. 4 times defender ground combat value = 0.941 at 0x175504 and > 0.941 at 0x175554.


Yet, this might not work as intended:

- TTs attack at the same time with the AI war ships (OBs not destroyed = random TT loss issue)
- TTs not always in the same taskforce when invading with more than one taskforce (bad for success chance)
- AI fleet staging function is awful, with an ally in particular (TTs go to ally fleet but not to own invasion fleet)
- bad random engine, FPU even worse (0-1 vs success chance of invasion) bad numbers fail even with 10 times advantage


Additional workaround to force a minimum number of TTs for Invade tasks:

Code: Select all

NAME: Minimum Number of TTs for AI Invade Tasks 
DESC: Patch default stes a minimum requirement of 4 TTs.
AUTHOR: Spocks-cuddly-tribble
URL: https://www.armadafleetcommand.com/onscreen/botf/viewtopic.php?p=34120#p34120

>> 0x0001d865 08
>> 0x0001d873 00 00 00 00
>> 0x0001d87a 00 00 00 00 00
>> 0x0001dc17 00 00 00 00 00 00 00 00 00
>> 0x0001dc57 35
>> 0x0001dc86 0f
>> 0x0001dc8d 89 d0 e8 8c fa ff ff eb c2 b8 01 00 00 00

<< 0x0001d865 0d
<< 0x0001d873 66 83 be 9e
<< 0x0001d87a 04 7f f1 eb e7
<< 0x0001dc17 8b c2 e8 02 fb ff ff eb 38
<< 0x0001dc57 bf
<< 0x0001dc86 06
<< 0x0001dc8d 66 83 ba 9e 00 00 00 04 7d f0 33 c0 b0 01


#0041E464     73 0D                  JNB SHORT 41E473

#0041E473     66:83BE 9E000000 04    CMP WORD [ESI+9E],4 // skip ship allocation limit if less than 4 TTs
#0041E47B    ^7D F1                  JGE SHORT 41E46E
#0041E47D    ^EB E7                  JMP SHORT 41E466


#0041E817     8BC2                   MOV EAX,EDX
#0041E819     E8 02FBFFFF            CALL 41E320
#0041E81E     EB 38                  JMP SHORT 41E858

#0041E856    ^75 BF                  JNZ SHORT 41E817

#0041E885     73 06                  JNB SHORT 41E88D

#0041E88D     66:83BA 9E000000 04    CMP WORD [EDX+9E],4 // demand a minimum of 4 TTs for Task
#0041E895    ^7C F0                  JL  SHORT 41E887
#0041E897     33C0                   XOR EAX,EAX
#0041E899     B0 01                  MOV AL,1


thunderchero wrote:I wonder if the table could be increased to include minors
For minor race ship tasks see sub_414E50. There are references to Explore, Patrol, Raid and Harass.
The Raid/Harass random switch at asm-414C51 could be replaced with a minor race personality check. :idea:
Last edited by Spocks-cuddly-tribble on Thu Jun 23, 2022 2:31 pm, edited 10 times 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
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1870
Joined: Sun Apr 27, 2008 2:00 am

AI Buying Behavior

Post by Spocks-cuddly-tribble »

Another step closer to controlling AI tasks. :)

Three categories of expenditures (ships, buildings and gifts) are sorted by priority 1-3 in two identical tables in trek.exe.

0x188DB0 (asm-58AFB0) -> credit allotments (aka budget limits)
0x18A048 (asm-58C248) -> chronology of purchase orders

Set to 12 bytes per row we see the default priorities 1-3 for AI empires card-rom:

Code: Select all

01 00 00 00 04 00 00 00 03 00 00 00
03 00 00 00 04 00 00 00 01 00 00 00
04 00 00 00 03 00 00 00 01 00 00 00
01 00 00 00 04 00 00 00 03 00 00 00
04 00 00 00 01 00 00 00 03 00 00 00
01 = Ships
03 = Gifts/Offers
04 = Buildings/Upgrades

First the AI determines its budget limit by substracting a reserve fund of 5 times effective fleet support cost from the current total credits (if fleet cost is larger than pop support). Another unkown value gets substracted, but most likely it's zero due to broken code and meant to be treaty costs per turn.

This result gets compared with the nominal income and the greater value is used as budget limit for priority 1 tasks. After that, the budget limit for priorities 2 and 3 is obtained by successively substracting the lower values each i.e. by increasing the untouchable reserve fund.

Example:

Klingon AI; 12000 credits, 1000 income, 300 credits/turn effective fleet support cost

Budget limits for buying: (reduced after each purchase order)

12000 -1500(5*300) = 10500 (Ships 01) -> unusable reserve = 1500
10500 -1000 = 9500 (Buildings/Upgrades 04) -> unusable reserve = 2500
9500 -1000 = 8500 (Gifts/Offers 03) -> unusable reserve = 3500

The chronology of the purchase orders, i.e. the category priorities from table 0x18A048, is skipped if the AI loses all shipyards, refineries or the territory is threatened. In this case the chronology is: 1. Gifts/Offers, 2. Ships, 3. Buildings/Upgrades. It's the same check for triggering the emergency ship building agenda: viewtopic.php?p=34142&sid=2ecf63a015a38 ... 6e1#p34142

Every item gets purchased if not prevented by the corresponding budget limit. Unlike ships and buildings the AI just lowers the amount of Gifts/Offers if insufficient credits instead to skip them. viewtopic.php?p=24148&sid=2ecf63a015a38 ... 6e1#p24148
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1870
Joined: Sun Apr 27, 2008 2:00 am

Displaying AI Datas on the Map

Post by Spocks-cuddly-tribble »

A diagnostic development feature enables viewing of 24 types of AI map data.

0x193674 (default 01) -> 0 = show AI data if "Build Tasks" are turned off
0x193678 (default 01) -> 0-17h = map ai data type
0xE6BC6 (default 30 D2) -> B2 0X = show data of AI empire ID X (next ID if player, default 0 card)

Index code key of the "map ai data type" switch: (at asm-4E7430)
0 'Sector Density' (based on nearby map objects, own systems do not count) 
1 'Current Build' (most trade goods, AI gives orders between turns)
2 'Current System Class' (property type)
3 'All System Classes' (property potential)
4 'Sectors Scanned'
5 'System Production' (output values)
6 'Ship Tasks' (token)
7 'Ship List (%s)' (detailed task list)
8 'Population Data' (laborer assignations)
9 'Territory' (sector claims)
A 'Border Influence' (claim predictors)
B 'System Colonization Value (%s)' (base layer)
C 'System Colonization Priority (%s)'
D 'Rights of Passage (%s)' (sectors not accessible)
E 'Task List (%s)' (agenda, production focus & planned tasks)
F 'Game Statistics' (economic & military power)
10 'Local Advantage (%s)' (range class of possible target systems)
11 'Staging Points (%s)' (mark closest opponent systems with XXX)
12 'Diplomatic Info'
13 'Threat Level (%s)' (depends on opponent systems in sector range)
14 'Base Placement (%s)' (sector density + own systems 100, with yard 110, anomaly = 0)
15 'Raiding Value (%s)' (nearby systems pop -system defenses)
16 'Sphere Of Influence' (purpose unknown, close to savegame file SphOfIn)
17 'Defense Patrol Points (%s)' (purpose unknown, based on own + ally territory)

- Labels taken from asm-581450. 10h+ are out of sync, i.e. maybe some are wrong assigned.
- Data types 7, E, F and 12h display a list instead of the map (navigation still via I, O and arrow keys).
- Some datas depend on known opponents i.e. show nothing on turn 1 (e.g. 11h, 13h).
- Some views are restricted to the AI's range other not (e.g. Colonization, Raiding).

Map datas 13h, 14h and C have a major importance and are loaded into the main AI-Agents every time a game is started or loaded.

13h View1 -> sub_419260
14h View2 -> sub_419B70 (cf. sub_41A580)
C View3 -> sub_41A6D0

Code: Select all

NAME: Hotkey Control for 24 Map AI Data Types - Diagnostics - Not for Mods!
DESC: 'Build Tasks' must be turned ON to display AI data (list see link). Q = toggle AI/player view.
DESC: M = loop Map AI data types / R = next AI Race (non-iterable! After Romulan data re-load saved game to avoid issues!)
AUTHOR: Spocks-cuddly-tribble
URL: https://www.armadafleetcommand.com/onscreen/botf/viewtopic.php?p=34204#p34204

>> 0x000d7df4 4c 8a 4d
>> 0x000d7e04 4c 8a 4d
>> 0x000d7e08 4c 8a 4d
>> 0x000e6897 74 3b 83 3d
>> 0x000e68a0 74 37
>> 0x000e68b0 81 f9 e4 13 58
>> 0x000e68b6 75 18 bb 04 14
>> 0x000e68bc 00 ba e8 02 00 00 b8 28 14 58
>> 0x000e68c7 e8 e4 0c 02 00 85 c0 75 e0 31 c0 59 c3
>> 0x000e6bc6 30 d2 31 c0 88 d0 e8 ef d4 f1 ff 85 c0 0f 84 2e 01 00 00 88 15 80 58 59 00
>> 0x000e6d07 fe c2 80 fa 05 0f 82 b6 fe
>> 0x000e6d11 ff e9 d7 fe ff ff

<< 0x000d7df4 c1 74 4e
<< 0x000d7e04 b8 74 4e
<< 0x000d7e08 c9 74 4e
<< 0x000e6897 75 40 f6 05
<< 0x000e68a0 75 32
<< 0x000e68b0 89 0d 78 58 59
<< 0x000e68b6 eb 2b 80 35 74
<< 0x000e68bc 59 00 01 eb 0e fe 05 78 58 59
<< 0x000e68c7 eb 06 fe 05 80 58 59 00 e9 e3 16 ff ff
<< 0x000e6bc6 b9 80 58 59 00 8b 11 8b c2 e8 ec d4 f1 ff 85 c0 0f 84 2b 01 00 00 89 11 90
<< 0x000e6d07 42 83 fa 05 0f 82 bc fe ff
<< 0x000e6d11 33 d2 eb f3 90 90
Image

Code: Select all

NAME: Using Strategic Timer as Time-Lapse Function (AI Diagnosis)
DESC: Launching BotF BEFORE setting the timer you must start/load any game (else crash)!
DESC: BEFORE saving games the timer must be set to 0 (else data corruption)!
DESC: Time-lapse until the next multiple of the timer setting (might start in options screen)
DESC: Turn-display -1 (1 is 0) so Timer 25 stops turns -> 1, 26, 51, 76, 101...
AUTHOR: Spocks-cuddly-tribble / thunderchero's Q-tip
URL: https://www.armadafleetcommand.com/onscreen/botf/viewtopic.php?p=34204#p34204

>> 0x000b9051 64
>> 0x000b917b 74
>> 0x000b9255 8b 15 5c 30 59 00 85 d2 75 61 8b 0d 64 30 59 00 85 c9 7e 5d 8d 59 9c 89 1d 64 30 59 00 81 fb f8 11 00 00

<< 0x000b9051 01
<< 0x000b917b eb
<< 0x000b9255 a1 18 29 5a 00 90 8b d0 c1 fa 1f f7 3d 7c 2b 5a 00 90 83 fa 00 74 4f e8 af e2 f9 ff eb 48 90 90 90 90 90

#004B9C50     B8 01000000    MOV EAX,1   ; delay

#004B9D7B     EB 17          JMP SHORT 4B9D94  display_turn_number

#004B9E55     A1 18295A00    MOV EAX,DWORD [5A2918]  turn number
#004B9E5A     90             NOP
#004B9E5B     8BD0           MOV EDX,EAX
#004B9E5D     C1FA 1F        SAR EDX,1F
#004B9E60     F73D 7C2B5A00  IDIV DWORD [5A2B7C] gameInfo_2A4_strategic_timer
#004B9E66     90             NOP
#004B9E67     83FA 00        CMP EDX,0
#004B9E6A     74 4F          JE SHORT 4B9EBB     render
#004B9E6C     E8 AFE2F9FF    CALL 458120         end turn
#004B9E71     EB 48          JMP SHORT B9EBB     render
#004B9E73     9090909090     NOP
Last edited by Spocks-cuddly-tribble on Tue Oct 18, 2022 3:11 pm, edited 4 times 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
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1870
Joined: Sun Apr 27, 2008 2:00 am

'Unopposed' AI Agenda Fix

Post by Spocks-cuddly-tribble »

DCER wrote:At the begining their agenda is Normal expansion. One would expect Unopposed expansion, but that is not the case.
viewtopic.php?f=218&t=707#p9673

'Unopposed' requires:
  • all empires unknown
  • a minimum distance of 6+ sectors between the own and all other empire home systems
However, sub_4068D0 is bizarrely flawed, even by BotF standards. It loads instead of the other empire's StarIDs always the own one for comparison.


'Unopposed' AI Agenda Fix (helps AI in the beginning of large map games)

Code: Select all

trek.exe at 0x5D05 change 0x15 bytes to

33 DB E8 A4 03 04 00 8B 04 5D 5E 23 5B 00 3A 5F 08 75 42 90 90

-asm-
00406905   33DB              XOR EBX,EBX              // prepare empire ID for loop

0040690C   8B045D 5E235B00   MOV EAX, [EBX*2+5B235E]  // prepare starID from RToSInfo
00406913   3A5F 08           CMP BL, [EDI+8]          // own empire?
00406916   75 42             JNZ 40695A               // if not check distance
00406918   90 90             NOP
The minimum distance to all other home systems must be greater than: ds:576810 (default 5.0) 8 byte float
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1870
Joined: Sun Apr 27, 2008 2:00 am

Federation AI code for Minor Races (no attacks & liberation) + Fix

Post by Spocks-cuddly-tribble »

suggestions for Terran Empire mod wrote:Here is the Federation AI special code for not attacking & liberating Minor Races. So you could switch the feature to empire ID 2 ferengi or disable via ID 5+.

Code: Select all

federation prefer to attack subjugated systems
40E958                 cmp     cx, 1 // 0xDD5B

federation don't invade free minors
40EA8E                 cmp     word ptr [ebx+8], 1 // 0xDE92

federation free subjugated minors
41E758                 cmp     word ptr [eax+8], 1 // 0x1DB5C

Federation minor race gift/traderoute bonus code

Code: Select all

-amounts- (gifts)
40780D                 cmp     ah, 1 // 0x6C0F
-effects- (gifts & traderoutes)
407B91                 cmp     ah, 1 // 0x6F93
Instead disabling/changing the empire ID, you could inverse the corresponding multipliers:

fed1 (1.5 -> 0.666)
fed2 (0.5 -> 2.0)

See Gowron 'Gifts to Minor Races' Fed1 / Fed2 values.


AI federation declares war at liberated minor races issue: viewtopic.php?f=4&t=3714#p49144


Keep AI Federation from declaring War on Minor Races (Fix)

Code: Select all

0x137FD change (0xF bytes) -> 8B 50 3C 85 D2 0F 85 5B FF FF FF 66 8B 56 08 -> 83 78 3C 00 75 25 0F B6 56 08 80 FA 01 74 05

004143FD   8378 3C 00    CMP DWORD [EAX+3C], 0    // if not a free minor...
00414401   75 25         JNZ SHORT 414428         // ...exit check next
00414403   0FB656 08     MOVZX EDX, BYTE [ESI+8]   // AI empire ID
00414407   80FA 01       CMP DL, 1                // if Federation...
0041440A   74 05         JE SHORT 414411          // ...exit check next


EDIT:


Here are some remaining codes for AI empire behavior. I did not analyze/manipulate them further cause it think the results will be more or less disappointing. I didn't even expect to find such codes, since the 'experienced' AI behavior appears to be allways the same (IIRC).

Code: Select all

AUTO:0041428C                 cmp     word ptr [esi+8], 1 ; Federation  0x13690 // negative diplomatic shift vs. empires with subjugated system in range of federation
AUTO:0043110E                 cmp     dx, 1               ; Federation  0x30511 // same as above but only if no score or tech deviation issue resp SphOfIn issue

AUTO:0043031A                 cmp     word ptr [ebx+8], 1 ; Federation  0x2F71E // skip some offensive ship tasks when Cold War (Harras / Attack)

loc_43022A                    empire IDs 4, 0, 2 & 3 Raid OK ; Federation missing // Raid when Cold War  

AUTO:00422FE5                 cmp     word ptr [esi+8], 1 ; Federation  0x223E9 // some minor race attitude bonus +50

AUTO:00422FF8                 cmp     word ptr [esi+8], 0 ; Cardassians 0x223FC // some minor race attitude penalty -50

-> lower 4-byte float value seems to indicate more warlike behavior?:

58F84C AI_fleet_deviation_floats_1_2__1_3__1_3__1_1__1_25 (card-rom)
58F860 AI_mil_4_sector_distance_floats_1_35__1_5__1_7__1_2__1_5 (card-rom)


sub_430F40 for set war type, AI to AI gifts, Treaty Offers sizes & Turn lenghts
58F874 AI_fleet_values_0_5__0_9__1_75__0_5__0_5 (card-rom) -> Ferengi peak value?

sub_432390 Treaty Offers sizes & Turn lenghts (card-rom deviations)


Another funny AI empire value is the score deviation tolerance (default: 1.2 - double float 577DFC).
AI majors sometimes get kind of 'pissed off' if other empire's score exceed theirs by more than 20%.... :evil:
Last edited by Spocks-cuddly-tribble on Mon Jun 20, 2022 8:08 pm, edited 6 times 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
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1870
Joined: Sun Apr 27, 2008 2:00 am

AI Colonize, Tform & Buildbase Tasks

Post by Spocks-cuddly-tribble »

These AI tasks are partly controlled by four subroutines which are closely related to some of the above listed map ai data types.


1.) Sub_410070 (Colonize + prior Tform if required) -> 'System Colonization Priority (%s)'

Cf. the AI minimum terraform threshold: viewtopic.php?f=222&t=1131#p16638 -> M-Class fix (410134 = nop // 0xF534 -> 75 0D to 90 90)
NOTE: If a new Task gets added (or colonize order executed?) next code 2# is skipped that turn!


2.) Sub_40FF40 (Colonize + prior Tform if required + Build Outpost) -> 'Base Placement (%s)' also influenced by 'Threat Level (%s)'

Here a build outpost task is set for the same sector, maybe to secure the location if no colony ship is available (or too far away).
Skip build outpost at the same sector ? - experimental option - (410018 = JMP 41003B // 0xF418 -> 8B 44 24 14 to EB 21 90 90)
-> M-Class fix 2 ? (40FFF8 = nop // 0xF3F8 -> 75 1E to 90 90)


3.) Sub_40F810 (Tform improve own systems)


4.) Sub_40F1B0 (Build Outpost or Starbase) -> if no Buildbase 2# since AI cannot perform more than one Buildbase task at the same time

4a - First the AI checks its own star systems whether it wants to build an outpost somewhere

4b - If not it can build an outpost outside its territory when in 'Offensive Consolidation'(sub_42A890) -> missing range check Bug

4c - If not 4a or 4b it checks again its own star systems for Outposts whether it wants to upgrade one to a Starbase

Remeber an exception for outposts outside of the AI's territory is 'Base Placement' 2#.



And now let's try to give that lazy AI some bashes: :wink:

Code: Select all

NAME: Dynamic Danger Check for AI Colonize, Tform & BldBase Tasks 
DESC: Checks enemy ships like the AI Raid task instead of min distance to enemy patrol range (5 sectors, 3 in own territory).
AUTHOR: Spocks-cuddly-tribble
URL: https://www.armadafleetcommand.com/onscreen/botf/viewtopic.php?p=50865#p50865

>> 0x7A9F 30 DB BF 01 00 00 00 88 D9 89 F8 8B 14 24 D3 E0 21 D0 75 4E FE C3
<< 0x7A9F 6A 00 8B 44 24 40 50 8B 44 24 40 50 8B C5 E8 AE 34 02 00 EB 3B 90

#0040869F   6A 00         PUSH 0
#004086A1   8B4424 40     MOV EAX,[ESP+40]
#004086A5   50            PUSH EAX
#004086A6   8B4424 40     MOV EAX,[ESP+40]
#004086AA   50            PUSH EAX
#004086AB   8BC5          MOV EAX,EBP
#004086AD   E8 AE340200   CALL 42BB60 // Enemy_NEXT_turn_in_sector_Cheat?_test
#004086B2   EB 3B         JMP SHORT 4086EF
#004086B4   90            NOP
-> A good patch to prevent inactive AIs, but can disrupt safe distance & diplomacy vs powerful opponents, so second option:

Code: Select all

NAME: AI ColonizeTformBldBase Safe Distance Free 3 Sectors (remove Dynamic Danger Check)

>> 0x7B69 74 22
<< 0x7B69 75 44

Force AI to Tform improve all its systems (Workaround)

Code: Select all

0xEC67 change 74 26 -> EB 35
0xED24 change 75 30 -> 90 90
0xED64 change 83 3C 24 00 -> 85 FF 90 90

-asm-
0040F867   EB 35            JMP 40F89E

0040F924   90 90            NOP

0040F964   85FF             TEST EDI,EDI
0040F966   90 90            NOP

Keep AI in the beginning from wasting a TT for home system outpost

Code: Select all

0xE9A6 change 0F 85 -> 90 E9

AUTO:0040F5A6   jnz -> jmp nop

ds:576E44 Buildbase threshold 20.0 (8 byte float) at 0x174C44 (shared for all outposts & starbases @ code 4#)

ds:57AC44 // 0x17A844 (8 byte float) -> 0.25 = default percent done when building a Starbase
Last edited by Spocks-cuddly-tribble on Sun Jan 01, 2023 5:55 pm, edited 13 times 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
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1870
Joined: Sun Apr 27, 2008 2:00 am

Unlocking the AI Ram Command - OUTDATED

Post by Spocks-cuddly-tribble »

:!: Warning - the old patch is outdated due to unwanted side effects when extending the 'pugnacity' value range from 4(5) to 7 :!:

For Unlocking the AI Ram Command try the 'Improving AI Combat Commands for Warships vs enemy Ships' patch (see next post) :idea:

Code: Select all

NAME: Remove outdated parts of AI 'Pugnacity' value-range / Ram Bug-fixes aka Unlocking the AI Ram Command
DESC: Restores useful parts of vanilla code.
AUTHOR: Spocks-cuddly-tribble
URL: https://www.armadafleetcommand.com/onscreen/botf/viewtopic.php?p=50905#p50905

>> 0x776E3 03 C3 EB 1F 90
<< 0x776E3 89 D9 83 F8 02
>> 0x777C8 8C
<< 0x777C8 85
>> 0x77907 7E
<< 0x77907 75
>> 0x7787F 07
<< 0x7787F 05

OLD POST: The AI's ability to use the 'ram' command in tactical combat depends on a 'pugnacity' value of 5+ against the opponent. If the value is lower 5 and it wants to use 'ram' the AI is forced to use retreat instead. :shock: EDIT: More complicated for warships and armed support, see next post.

Pugnacity (sub_478108) vs players is the sum of 'hostility' (0 - 4 neutral to enraged) and 'war type' (0 - 3 peace/cold war/war/jihad) i.e. with a value range of 0 - 7, BUT the pugnacity code is throttled to a max value of 4 unless jihad and even then to a maximum of 5.

So let's get rid of that embarrassing child safety device: Combat-group / Pugnacity-threshold for Ram (cf. viewtopic.php?f=209&t=1998&start=15#p48958)

To unlock most comprehensive options from the 'pugnacity' range the ram commands become available successively:

War ships = 5+ ; non-combat armed = 6+ ; non-combat unarmed = 7+

AI 'Pugnacity' value-range / Ram Bug-fixes - OUTDATED

Code: Select all

0x774F4 change 20 83 47 00 19 -> 19 83 47 00 20
0x776E3 change 89 D9 83 F8 02 -> 03 C3 EB 1F 90
0x777C8 change 85 -> 8C
0x77907 change 75 -> 7E
0x7787F change 05 -> 07

-asm-:

hostility jump table error (loc_478319)

pugnacity value range fix 'hostility' + 'war type'

004782E3   03C3     ADD EAX, EBX
004782E5   EB 1F    JMP SHORT 478306
004782E7   90       NOP

war ships
4783C0                 cmp     ds:AI_Combat_Pugnacity_0_5, 5
4783C7                 jnz     478590 -> jl

non-combat armed
478500                 cmp     ds:AI_Combat_Pugnacity_0_5, 5
478507                 jnz     478563 -> jng

non-combat unarmed
478479                 cmp     ds:AI_Combat_Pugnacity_0_5, 5 -> 7
478480                 jge     4784E4
Last edited by Spocks-cuddly-tribble on Sat Jul 09, 2022 9:05 am, edited 7 times 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
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 1870
Joined: Sun Apr 27, 2008 2:00 am

AI Commands in Tactical Combat

Post by Spocks-cuddly-tribble »

The topic is a bit confusing due to the order of processing (priority) so keep in mind the first met condition sets the command:

Hail - Retreat (-> AI Allies)
Retreat - Hail - Retreat (-> Fleet)
Ram - Retreat - Random Commands (-> Ship/Group)


1.) Entire-Fleet Commands

AI allies (affiliation/alliance) are forced to join :arrow: Hail or :arrow: Retreat of players when on the same side of the battle (kinda random when both opponents are allies of a third party). Player ram commands confuse the AI (cf. jihad ram/retreat) so setting all ships to ram (be it just to get closer to the enemy) forces AI allies to Hail. :???: (477FD5 cmp edx, 9 // player ally Ram check for AI join Hail/Retreat -> 0x773D7 = FF fixes AI confusion).


Following three main parameters suffer from debatable reliability and validity: (default range 0-4)

- Pugnacity: how mad the AI is at someone (vs players) = Hostility(0-4 neutral-enraged) + War Type(0-3 peace/cold war/war/jihad) max 4 (jihad = 5)
- Importance: of the fleet task (cf. first post) highest value of e.g. raid/harras 0 (1 own sector), own station 3, invade/attack 3 (4 arrived)
- Prognosis: 0 defeat no enemy losses, 1 defeat, 2 equal, 3 win, 4 win no losses -> Distance/Position & Model Radius (hit probability) ignored
-> 'Auto' button in tactical combat (fleets screen) sets Pugnacity & Importance 4 for players

At 5907B4 (0x18E5B4 +14h*raceID) is five modifier per empire + race index five shared for all minors: (1, 3 & 4 unused - defaults 0-100)

2nd - Bravery : increases chance of uphill battles instead of Retreat (defaults card-rom 60 55 40 85 50 minors 50)
5th - Peaceableness : increases chance to use Hail (defaults card-rom 50 85 75 25 75 minors 50)


Prognosis 0 :arrow: Retreat

A reasonable main condition for fleet retreat if there is no possibility to destroy the weakest enemy ship. To prevent this just bring some weak scouts (best set to evade). One could argue to merge retreat with an improved hail check to spare AI the morale losses from evitable retreats.


Hail is restricted to no war & sympathy 2+ (out of range 0-8)

Counterside Hail & Importance 0-3 & Prognosis 0-1 :arrow: Hail
else for Prognosis 2-4 if random 0-99 lower than (Peaceableness [+30 if Prognosis 2] - Pugnacity*5) :arrow: Hail

Counterside doesn't Hail or Importance 4 works only for the first turn with Pugnacity 0-4 (no jihad)
If random 0-99 lower than (Peaceableness - Pugnacity*5) :arrow: Hail


Importance 0 & (own losses expected or Pugnacity 0) :arrow: Retreat



2.) Ship / Combat-Group Commands:

0 - fast attack
1 - long range / artillery
2 - command / slow / cruiser
3 - support / non-combat
4 - monster

All ships not expected to survive shootouts vs 3 random enemy ships & Pugnacity 5 (jihad) :arrow: Ram

If NO 'leader' of the groups 0-2 is expected to survive 3 shootouts & Bravery + 10x (Pugnacity + Importance) lower than 100 :arrow: Retreat (+ group 3)
-> 'leader' = mouseover group first ship bottom left

Armed group 3 ships expected to survive 3 shootouts which 'could' kill an enemy :arrow: Assault else :arrow: Evade

The above Ram and Assault orders specify no target (wildcard -1) i.e. targeting like using Hold or Evade or remaining shots after kills.
Same with AI stations and first-turn random commands for players (until changed they can cause crashes when a target is reqired e.g. vs Edo God).


Target Selection

All remaining ships of combat-groups 0-2 'should' target the same enemy ship/station:

- get primary enemy fleet by highest Pugnacity
- if combat simulation indicates the AI 'could' destroy objects of this enemy next turn -> most expensive of them
- else if this enemy has un-cloaked objects with shields down -> lowest hull points
- else if this enemy has un-cloaked objects which died in combat simulation -> quickest kill in turns
- else repeat for secondary enemy fleet
- else i.e. all enemies destroyed in combat simulation cloaked :arrow: Hold (weapons free)

The code iterates for each ship, but for groups 0-2 only for 'leaders' (unless it's a mixed group of cloaked and uncloaked ships, then it runs twice) i.e. there can be random deviations of targets and commands between combat-simulation iterations. The last ship processed or the 'leader' sets the group command, but all targets and command deviations are set in solo-mode (hard to notice if equal).


:arrow: Combat Group 0-2 Commands vs enemy Outposts & Starbases:

Code: Select all

0047874B                 mov     eax, edx(is 5)  ; Strafe for group 0 // example to change this 0x77B4B (89 D0) -> B0 01 (Charge) 
00478741                 mov     eax, 2          ; Assault for group 1
00478737                 mov     eax, 1          ; Charge for group 2


:arrow: Command Probabilities for Combat Groups 0-2 vs enemy Combat Groups 0-4

At 5905D4 (0x18E3D4 + [own group ID x 160] + [enemy group ID x 32]) is four command entries each:

- 8 bytes per entry -> Command ID / Relative Frequency (0 = unused)
- 4th random command (default always evade) is not used if the own ship is cloaked
- own/enemy combat-group 'fast vs fast' reads: :arrow: Harry 50 / Charge 30 / Strafe 15 / Evade 5
- by default sum of 1-4 is 100 i.e. Relative Frequency = Command Probability in % (unless cloaked); all frequencies 0 :arrow: Evade
- commands vs Monster group 4 are not used but instead enemy slow group 2 (Combat Drone & Husnock = enemy fast group 0)




3.) Patches to improve the code of random commands for groups 0-2 and fix miscellaneous bugs:

Code: Select all

NAME: Improving AI Combat Commands for Warships vs enemy Ships (UPDATED)
DESC: Fixes broken AI Battle Modifier for special Frontal Assault(1), Ram Escalation(3), Escort Evade(4) & other minor glitches. 
AUTHOR: Spocks-cuddly-tribble
URL: https://www.armadafleetcommand.com/onscreen/botf/viewtopic.php?p=52751#p52751

# Ram Escalation Overkill skip Retreat Options
>> 0x76ED6 85 D2 0F 85 E0 01 00 00 85 FF 0F 8E C9 01 00 00 85 DB 0F 85 B2 01 00 00 BB FF FF FF FF 8B 84 24 34 01 00 00 89 15 70 58 5B 00 BA 0A 00 00 00
<< 0x76ED6 33 C0 85 D2 74 09 40 85 FF 74 08 B0 02 EB 0F 85 FF 75 01 40 85 ED 75 01 40 85 DB 74 01 40 A3 70 58 5B 00 85 C0 75 0D E9 9E 01 00 00 6A FF 5B

>> 0x770A0 C7 05 70 58 5B 00 01 00 00 00 E9 5B FE FF FF C7 05 70 58 5B 00 02 00 00 00 E9 4C FE FF FF 85 FF 7E 0F C7 05 70 58 5B 00 02 00 00 00 E9 39 FE FF FF 85 ED 7E 0F C7 05 70 58 5B 00 03 00 00 00 E9 26 FE FF FF C7 05 70 58 5B 00 04 00 00 00 E9 17 FE FF FF
<< 0x770A0 8B 84 24 34 01 00 00 33 D2 B2 0A 83 3D 84 78 59 00 00 0F 84 4A FE FF FF 8B 0D 60 58 5B 00 83 79 08 65 0F 8C 3A FE FF FF 0F 84 3C FE FF FF B2 09 E9 2D FE FF FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

# disable player Ram check for AI ally join Hail/Retreat FIX
>> 0x773D7 09
<< 0x773D7 FF

>> 0x779E0 BA 01 00 00 00
<< 0x779E0 B2 01 8B EB 90

>> 0x77AB5 00 00 00 00 00 00 00 00 00 00 00 E4 87 47 00 E4 87 47 00 E4 87 47 00 E4 87 47 00 E4 87 47 00 E4 87 47 00 E4 87 47 00
<< 0x77AB5 A1 64 58 5B 00 02 05 6C 58 5B 00 B2 0A F7 EA 2C 64 F6 D8 8A F8 A1 60 58 5B 00 38 38 7C 36 90 84 DB 74 26 B2 02 EB 22

>> 0x77AE2 89 D1 89 DD
<< 0x77AE2 8B F9 8B CA

>> 0x77AF4 5D
<< 0x77AF4 C0

>> 0x77AFE BE 30 BA 57 00 BF C8 B9 57 00 B9 13 03 00 00 89 F3 89 CA 89 F8 E8 98 FA 08 00 85 C0 75 F1 B8 07 00 00 00 5D 5F 5E 59 C3
<< 0x77AFE 02 15 70 58 5B 00 80 FA 04 7D 2E 83 C5 18 B8 DC 01 00 00 03 C8 03 F8 80 39 24 7C 38 B2 00 80 39 2B 7D 3E B2 02 EB 3A 90

>> 0x77B3C 5D 5F 5E 59 C3
<< 0x77B3C 83 FE 01 75 05

>> 0x77B52 83 B9 78 01 00 00 07 74 6D 83 B9 78 01 00 00 01 0F 85 87 00 00 00 8B 91 9C 01 00 00 8D 04 D5 00 00 00 00 29 D0 C1 E0 02 01 D0 8B 15 60 78 59 00 8B 44 82 3C C1 E0 05 83 FE 01 0F 83 7E 00 00 00 85 F6 75 07 BF D4 05 59 00 01 C7 B8 03 00 00 00 31 C9 85 ED 0F 85 80 00 00 00 8D 14 C5 00 00 00 00 01 FA
<< 0x77B52 6B 41 C0 74 03 05 60 78 59 00 8A 50 3C 84 DB 75 32 8D 81 60 01 00 00 80 39 24 7C 03 83 E8 54 8B 00 3B 87 5C 01 00 00 7C 6F 80 3D 70 58 5B 00 02 7D 50 A1 60 58 5B 00 38 78 08 7C 46 80 39 24 7C 59 EB 33 B1 05 D3 E2 8B C6 C1 E0 02 03 C6 D3 E0 8D BC 10 D4 05 59 00 B8 03 00 00 00 2A C3 33 C9 8D 14 C7

>> 0x77BC8 66 8B 81 DC 01 00 00 83 E8 24 66 3D 06 00 77 13 25 FF FF 00 00 FF 24 85 C0 86 47 00 B8 02 00 00 00 EB 9B 31 C0 EB 97 BB 34 BA 57 00 BA 25 03 00 00 B8 C8 B9 57 00 E8 AD F9 08 00 85 C0 0F 85 50 FF FF FF E9 58 FF FF FF 77 07 BF 74 06 59 00 EB 82 83 FE 02 0F 85 7B FF FF FF BF 14 07 59 00 E9 6F FF FF FF B8 02 00 00 00 E9 76
<< 0x77BC8 3B F2 7C 08 6A 09 58 5D 5F 5E 59 C3 85 F6 75 BD F6 45 74 01 74 4A A1 60 58 5B 00 38 78 0C 7D AD EB 79 EB 16 8B 81 5C 01 00 00 3B 87 60 01 00 00 7F DA F6 45 74 01 74 D4 EB CA A1 60 58 5B 00 38 78 08 7C 11 80 3D 70 58 5B 00 02 7C B7 74 E3 3B F2 7F DF EB B7 80 3D 70 58 5B 00 02 7C D4 EB AC 80 3D 70 58 5B 00 00 74 AD E9 5F
ASM-Notes:
► Show Spoiler

Code: Select all

NAME: AI Battle Modifier (1/3/4 require 'Improving AI Combat Commands')
DESC: Changes unlock(1/3/5) resp lock(2/4) thresholds for special Hail(5), Retreat(2), Assault(1), Ram(3) & Evade(4) checks.
AUTHOR: Spocks-cuddly-tribble
URL: https://www.armadafleetcommand.com/onscreen/botf/viewtopic.php?p=52751#p52751

# @ 5907B4  F.-Assault  Bravery     RamEscal.   EscortSt.   Peaceabl.
#           Assault(+)  Retreat(-)  Ram(+)      Evade(-)    Hail(+)
# Cardassians
>> 0x18E5B4 19 00 00 00 3C 00 00 00 50 00 00 00 32 00 00 00 32 00 00 00
<< 0x18E5B4 64 00 00 00 14 00 00 00 64 00 00 00 0A 00 00 00 32 00 00 00
# Federation
>> 0x18E5C8 32 00 00 00 37 00 00 00 4B 00 00 00 32 00 00 00 55 00 00 00
<< 0x18E5C8 64 00 00 00 14 00 00 00 64 00 00 00 0A 00 00 00 55 00 00 00
# Ferengi
>> 0x18E5DC 19 00 00 00 28 00 00 00 14 00 00 00 19 00 00 00 4B 00 00 00
<< 0x18E5DC 64 00 00 00 14 00 00 00 64 00 00 00 0A 00 00 00 4B 00 00 00
# Klingons
>> 0x18E5F0 50 00 00 00 55 00 00 00 19 00 00 00 55 00 00 00 19 00 00 00
<< 0x18E5F0 64 00 00 00 14 00 00 00 64 00 00 00 0A 00 00 00 19 00 00 00
# Romulans
>> 0x18E604 0F 00 00 00 32 00 00 00 4B 00 00 00 32 00 00 00 4B 00 00 00
<< 0x18E604 64 00 00 00 14 00 00 00 64 00 00 00 0A 00 00 00 4B 00 00 00
# Minors
>> 0x18E618 32 00 00 00 32 00 00 00 32 00 00 00 32 00 00 00 32 00 00 00
<< 0x18E618 64 00 00 00 14 00 00 00 64 00 00 00 14 00 00 00 32 00 00 00

# card-rom/minors - New Values:
# 100 100 100 100 100 100 -> 'Frontal Assault' when Win Prognosis 4 (no losses expected); cloaked 2-4 -> All always ON 
# 20 20 20 20 20 20 -> 'Bravery' skips check for smart Retreat -> All only if battle threshold 80+ (max importance)
# 100 100 100 100 100 100 -> 'Ram Escalation' unlocks more Ram features -> All always ON (adaptive wrt groupLeader vs target data & battle prognosis)
# 10 10 10 10 10 20 -> 'Escort Steadiness' no Evade if groupLeader shields down & no other special code -> All only if battle threshold 90+ (jihad + max importance) minors 80+ (no minor jihad)
# 50 85 75 25 75 50 -> 'Peaceableness'-> e.g. unlocks Hail response if (Peaceableness[+30 P=2-]-5*Pugnacity) reach random 0-99 -> Unchanged vanilla defaults
(card-rom/minors) - New Values: (see elaboration below :idea:)

100 100 100 100 100 100 -> 'Frontal Assault' when Win Prognosis 4 (no losses expected); cloaked 2-4 -> All always ON
20 20 20 20 20 20 -> 'Bravery' skips check for smart Retreat -> All only if battle threshold 80+ (max importance)
100 100 100 100 100 100 -> 'Ram Escalation' unlocks more Ram features -> All always ON (adaptive wrt groupLeader vs target data & battle prognosis)
10 10 10 10 10 20 -> Escort Steadiness' skips Evade if groupLeader shields down -> All only if battle threshold 90+ (jihad + max importance) minors 80+
50 85 75 25 75 50 -> 'Peaceableness'-> e.g. unlocks Hail response if (Peaceableness[+30 P=2-]-5*Pugnacity) reach random 0-99 -> Unchanged vanilla

New smart Ram Escalation, Escort Steadiness OFF (evade if shields down) and also the vanilla Bravery-defaults work better using: :wink:

Code: Select all

NAME: Different Solo Commands within AI Combat Groups
DESC: Allows ship specific features/commands instead of group leader only (increases group/formation fragmentation each turn).
AUTHOR: Spocks-cuddly-tribble
URL: https://www.armadafleetcommand.com/onscreen/botf/viewtopic.php?p=52751#p52751

>> 0x77A31 46 54 89 C8 8B 50 38 3B 51 38 75 15 8A 91 0C 02 00 00 89 99 FC 01 00 00 80 CA 02 88 91 0C 02 00 00 69 91 7C 01 00 00 C8 03 00 00 8B 0D 64 78 59 00 01 D1 39 C1 75 CD
<< 0x77A31 99 FC 01 00 00 80 89 0C 02 00 00 02 8B C1 33 D2 2B 05 64 78 59 00 BF C8 03 00 00 F7 F7 3B 46 50 75 03 89 5E 54 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90


# ASM-Notes:

# 00478630     8999 FC010000       MOV DWORD PTR DS:[ECX+1FC],EBX // set ship command
# 00478636     8089 0C020000 02    OR BYTE PTR DS:[ECX+20C],2     // 'command is set' marker
# 0047863D     8BC1                MOV EAX,ECX
# 0047863F     33D2                XOR EDX,EDX
# 00478641     2B05 64785900       SUB EAX,DWORD PTR DS:[597864] // TC_ship_info_block_3C8h
# 00478647     BF C8030000         MOV EDI,3C8
# 0047864C     F7F7                DIV EDI
# 0047864E     3B46 50             CMP EAX,DWORD PTR DS:[ESI+50] // if group leader...
# 00478651     75 03               JNZ SHORT 00478656 
# 00478653     895E 54             MOV DWORD PTR DS:[ESI+54],EBX // ...also set group command
# 00478656-478667   90....         NOP                           // remove solo loop for other ships in group

Fixing the AI Command Probabilities

- Sum of relative frequencies always = 100 %
- Long range -> disable invalid 'Circle' add low frequency 'Hold'
- Command slow -> correct 'Strafe' & 'Harry' to 'Flyby' & 'Circle'

Code: Select all

NAME: AI Command Probabilities Fix
DESC: Corrects sum of relative frequencies, some invalid default commands and adds low frequency Hold.
AUTHOR: Spocks-cuddly-tribble
URL: https://www.armadafleetcommand.com/onscreen/botf/viewtopic.php?p=52751#p52751

# fast group 0
>> 0x018E3D4 03 00 00 00 32 00 00 00 01 00 00 00 1E 00 00 00 05 00 00 00 0F 00 00 00 07 00 00 00 05 00 00 00 01 00 00 00 23 00 00 00 05 00 00 00 28 00 00 00 03 00 00 00 19 00 00 00 07 00 00 00 05 00 00 00 03 00 00 00 1E 00 00 00 05 00 00 00 28 00 00 00 01 00 00 00 19 00 00 00 07 00 00 00 05 00 00 00 03 00 00 00 1E 00 00 00 05 00 00 00 28 00 00 00 01 00 00 00 19 00 00 00 07 00 00 00 05 00 00 00
<< 0x018E3D4 03 00 00 00 23 00 00 00 01 00 00 00 1E 00 00 00 05 00 00 00 1E 00 00 00 07 00 00 00 05 00 00 00 01 00 00 00 23 00 00 00 05 00 00 00 23 00 00 00 03 00 00 00 19 00 00 00 07 00 00 00 05 00 00 00 03 00 00 00 1E 00 00 00 05 00 00 00 28 00 00 00 01 00 00 00 19 00 00 00 07 00 00 00 05 00 00 00 03 00 00 00 05 00 00 00 05 00 00 00 05 00 00 00 01 00 00 00 55 00 00 00 07 00 00 00 05 00 00 00

# artillery group 1
>> 0x018E474 04 00 00 00 2D 00 00 00 02 00 00 00 28 00 00 00 06 00 00 00 0F 00 00 00 07 00 00 00 00 00 00 00 04 00 00 00 28 00 00 00 02 00 00 00 28 00 00 00 06 00 00 00 14 00 00 00 07 00 00 00 00 00 00 00 04 00 00 00 23 00 00 00 02 00 00 00 28 00 00 00 06 00 00 00 19 00 00 00 07 00 00 00 00 00 00 00 04 00 00 00 23 00 00 00 02 00 00 00 28 00 00 00 06 00 00 00 19 00 00 00 07 00 00 00 00 00 00 00
<< 0x018E474 04 00 00 00 00 00 00 00 02 00 00 00 50 00 00 00 06 00 00 00 0F 00 00 00 0D 00 00 00 05 00 00 00 04 00 00 00 00 00 00 00 02 00 00 00 4B 00 00 00 06 00 00 00 14 00 00 00 0D 00 00 00 05 00 00 00 04 00 00 00 00 00 00 00 02 00 00 00 46 00 00 00 06 00 00 00 19 00 00 00 0D 00 00 00 05 00 00 00 04 00 00 00 00 00 00 00 02 00 00 00 5A 00 00 00 06 00 00 00 0A 00 00 00 07 00 00 00 00 00 00 00

# slow group 2
>> 0x018E514 03 00 00 00 28 00 00 00 05 00 00 00 23 00 00 00 01 00 00 00 19 00 00 00 07 00 00 00 00 00 00 00 01 00 00 00 3C 00 00 00 05 00 00 00 19 00 00 00 03 00 00 00 0F 00 00 00 07 00 00 00 00 00 00 00 05 00 00 00 23 00 00 00 02 00 00 00 23 00 00 00 03 00 00 00 1E 00 00 00 07 00 00 00 00 00 00 00 05 00 00 00 23 00 00 00 02 00 00 00 23 00 00 00 03 00 00 00 1E 00 00 00 07 00 00 00 00 00 00 00
<< 0x018E514 04 00 00 00 28 00 00 00 06 00 00 00 23 00 00 00 01 00 00 00 19 00 00 00 07 00 00 00 00 00 00 00 01 00 00 00 3C 00 00 00 06 00 00 00 19 00 00 00 04 00 00 00 0F 00 00 00 07 00 00 00 00 00 00 00 06 00 00 00 23 00 00 00 02 00 00 00 23 00 00 00 04 00 00 00 1E 00 00 00 07 00 00 00 00 00 00 00 06 00 00 00 23 00 00 00 02 00 00 00 23 00 00 00 01 00 00 00 1E 00 00 00 07 00 00 00 00 00 00 00

New AI Command Probabilities vs. enemy groups 0-3 (# changed)

:arrow: Fast group(0) vs.:

0 = Harry 35 #, Charge 30, Strafe 30 #, Evade 5
1 = Charge 35, Strafe 35 #, Harry 25, Evade 5
2 = Harry 30, Strafe 40, Charge 25, Evade 5
3 = Harry 5 #, Strafe 5 #, Charge 85 #, Evade 5

:arrow: Long range group(1) vs.:

0 = Circle 0 #, Assault 80 #, Flyby 15, Hold # 5 #
1 = Circle 0 #, Assault 75 #, Flyby 20, Hold # 5 #
2 = Circle 0 #, Assault 70 #, Flyby 25, Hold # 5 #
3 = Circle 0 #, Assault 90 #, Flyby 10 #, Evade 0

:arrow: Slow group(2) vs.:

0 = Circle # 40, Flyby # 35, Charge 25, Evade 0
1 = Charge 60, Flyby # 25, Circle # 15, Evade 0
2 = Flyby # 35, Assault 35, Circle # 30, Evade 0
3 = Flyby # 35, Assault 35, Charge # 30, Evade 0

Remember the order of processing. All other codes take precedence over the random commands :!:


EDIT:

Code: Select all

NAME: AI Retreat Fix for Importance 0 Battles
DESC: Adverse retreat trigger corrected to own losses expected + Pugnacity 0 i.e. all 3 conditions simultaneously.
AUTHOR: Spocks-cuddly-tribble
URL: https://www.armadafleetcommand.com/onscreen/botf/viewtopic.php?p=52751#p52751

>> 0x000771d9 7f 0d 83 3d 64 58 5b 00 00 0f 85 d5 fd ff ff
<< 0x000771d9 0f 84 de fd ff ff 83 3d 64 58 5b 00 00 75 e9

#00477DD9    ^0F84 DEFDFFFF      JE 477BBD // skip FLEET_retreat_battle_Importance_0
#00477DDF     833D 64585B00 00   CMP DWORD [5B5864],0 // Pugnacity
#00477DE6    ^75 E9              JNZ SHORT 477DD1 // skip FLEET_retreat_battle_Importance_0

Code: Select all

NAME: Hostility jump table error fix for AI tactical combat 'Pugnacity'
DESC: Fixes wrong jump destinations leading to wrong Hostility values in loc_478319.
AUTHOR: Spocks-cuddly-tribble
URL: https://www.armadafleetcommand.com/onscreen/botf/viewtopic.php?p=52751#p52751

>> 0x774F4 20 83 47 00 19
<< 0x774F4 19 83 47 00 20


AI Battle Modifier Explanation: ('Improving AI Combat Commands' patch)

Base calculation for 1-4 is always the same -> [Modifier]+10x(Pugnacity+Importance) = 100+ -> unlock (or lock) feature switch:

Modifier 100 means always unlocked for 'Enable'(offense) but 0 for 'Disable'(defense) feature checks. Vanilla defaults card-rom: (minors all 50)

25 50 25 80 15 (kling+ rom-) -> (1) Frontal Assault if Prognosis 4 (no losses expected); cloaked 2-4
60 55 40 85 50 (kling+ fer-) --> (2) Bravery skips check for smart Retreat
80 75 20 25 75 (card+ fer-) ---> (3) Ram Escalation unlocks more smart Ram features
50 50 25 85 50 (kling+ fer-) --> (4) Escort Steadiness skips smart Evade check for escorts (group leader shields down & no other special code)
50 85 75 25 75 (fed+ kling-) --> (5) Peaceableness -> e.g. unlocks Hail response if ('Peaceableness'[+30 P=2-] -5x Pugnacity) reach random 0-99

1 & 3 = 'enable' more special features for Frontal Assault & Ram
2 & 4 = 'block' some special features for smart fleet Retreat & smart Evade for escorts
5 = 'enable' feature for Hail response (politico-military double edged and shared for random blind Hail)

- 'Bravery' is not enable offense but disable smart Retreat = defense feature (vanilla defaults work better using the recommended AI Solo Commands patch)
- 'Frontal Assault' & 'Ram Escalation' 0 with 'Escort Steadiness' 100 gives vanilla behavior (exception ram 'light' is still on)
- 'Bravery' 100 with 'Ram Escalation' 101+ (overkill) usually let's the AI fight to the last ship

Cloaked -> skip Ram Escalation & Escort NoShields Evade & 4th random command

Ram Escalation if Prognosis: (no escalation i.e. 'ram light' = lose & noShields & KillRamOK)

- Win = noShields & KillRamOK & HigherGroup (so fast group noShields should use evade)
- Unclear = noShields & KillRamOK
- Lose = KillRamOK or (SacrificeRamOK & noShields or (Monster & NoHigherGroup))

KillRamOK = own ship can survive ramming the target
SacrificeRamOK = ramming can kill target (no matter own ship survives)

Overkill (101 65h) = skip Prognosis 0 Retreat (unless battle start)
Havoc (102+ 66h+) = whole fleet random target wildcard Ram if Pronosis 0 (battle start Retreat)


Current (instead of nominal) Hull Points as Ramming Damage to Opponent: viewtopic.php?p=18230#p18230

Code: Select all

NAME: Code deviation for 'Improving AI Combat Commands' patch reading current hull points as expected ramming damage 
DESC: Adapts the AI ram check when using current (instead of nominal) hull points as ramming damage to opponent.
AUTHOR: Spocks-cuddly-tribble
URL: https://www.armadafleetcommand.com/onscreen/botf/viewtopic.php?p=52751#p52751

>> 0x77B65 60
<< 0x77B65 5C

>> 0x77BF4 60
<< 0x77BF4 5C

# 478763  8D81 60010000  LEA EAX,[ECX+160]  // target nominal hull -> use current hull [ECX+15C]

# 4787F2  3B87 60010000  CMP EAX,[EDI+160]  // own nominal hull    -> use current hull [EDI+15C]


Since the latest ECM5 AI does pretty nice in tactical combat (by vanilla standards) I'll provide a simple cumulative update patch. :wink:

Patch shows red 'pseudo-conflict' if one of the reposted/OT patches is present or modifiers get changed afterwards e.g.:

- AI fast-attack group 'Pakled tactic' fix vs. Space stations (Strafe -> Charge)
- Hostility jump table error fix for AI Pugnacity (useful part of outdated 'Unlocking the AI Ram Command')
- Random Engine Fix for single player turn process (OT, but makes Combat/AI more unpredictable for save scumming)
- AI Battle Modifier (vanilla Peaceabl./Bravery defaults, F.-Assault 100, RamEscal. 101 & EscortSt. 10 off/low).

Code: Select all

NAME: Improving AI Commands in Tactical Combat -> Cumulative Multi Patch (Vanilla to ECM codes)

# Random Engine Fix for single player turn process (makes Combat/AI more unpredictable for save scumming)
>> 0x0005763f 0f 84 6e ff ff ff e8 86 79 0b 00 83 c4 1c 5e 5a 59 c3
>> 0x00057652 00 00 00 00
>> 0x00057657 00 00 00 00
>> 0x0005765c 00 00 00 00
>> 0x0005768d 0a
<< 0x0005763f 74 05 e8 8a 79 0b 00 e9 68 ff ff ff 33 c0 e8 f5 e9 0b
<< 0x00057652 a3 ac 6b 59
<< 0x00057657 e8 f4 fb 0a
<< 0x0005765c dd d8 eb 38
<< 0x0005768d bd

# disable player Ram check for AI ally join Hail/Retreat FIX
>> 0x773D7 09
<< 0x773D7 FF

# AI Battle Modifier - vanilla Peaceabl. & Bravery defaults, F.-Assault 100, RamEscal. 101 & EscortSt. 10(low).
# @ 5907B4  F.-Assault  Bravery     RamEscal.   EscortSt.   Peaceabl.
#           Assault(+)  Retreat(-)  Ram(+)      Evade(-)    Hail(+)
# Cardassians
>> 0x18E5B4 19 00 00 00 3C 00 00 00 50 00 00 00 32 00 00 00 32 00 00 00
<< 0x18E5B4 64 00 00 00 3C 00 00 00 65 00 00 00 0A 00 00 00 32 00 00 00
# Federation
>> 0x18E5C8 32 00 00 00 37 00 00 00 4B 00 00 00 32 00 00 00 55 00 00 00
<< 0x18E5C8 64 00 00 00 37 00 00 00 65 00 00 00 0A 00 00 00 55 00 00 00
# Ferengi
>> 0x18E5DC 19 00 00 00 28 00 00 00 14 00 00 00 19 00 00 00 4B 00 00 00
<< 0x18E5DC 64 00 00 00 28 00 00 00 65 00 00 00 0A 00 00 00 4B 00 00 00
# Klingons
>> 0x18E5F0 50 00 00 00 55 00 00 00 19 00 00 00 55 00 00 00 19 00 00 00
<< 0x18E5F0 64 00 00 00 55 00 00 00 65 00 00 00 0A 00 00 00 19 00 00 00
# Romulans
>> 0x18E604 0F 00 00 00 32 00 00 00 4B 00 00 00 32 00 00 00 4B 00 00 00
<< 0x18E604 64 00 00 00 32 00 00 00 65 00 00 00 0A 00 00 00 4B 00 00 00
# Minors
>> 0x18E618 32 00 00 00 32 00 00 00 32 00 00 00 32 00 00 00 32 00 00 00
<< 0x18E618 64 00 00 00 32 00 00 00 65 00 00 00 14 00 00 00 32 00 00 00

# Hostility jump table error fix for AI tactical combat 'Pugnacity'
>> 0x774F4 20 83 47 00 19
<< 0x774F4 19 83 47 00 20

# skip Prognosis 0 Retreat Options for Ram Escalation 101 Overkill / 102+ Havoc
>> 0x76ED6 85 D2 0F 85 E0 01 00 00 85 FF 0F 8E C9 01 00 00 85 DB 0F 85 B2 01 00 00 BB FF FF FF FF 8B 84 24 34 01 00 00 89 15 70 58 5B 00 BA 0A 00 00 00
<< 0x76ED6 33 C0 85 D2 74 09 40 85 FF 74 08 B0 02 EB 0F 85 FF 75 01 40 85 ED 75 01 40 85 DB 74 01 40 A3 70 58 5B 00 85 C0 75 0D E9 9E 01 00 00 6A FF 5B
>> 0x770A0 C7 05 70 58 5B 00 01 00 00 00 E9 5B FE FF FF C7 05 70 58 5B 00 02 00 00 00 E9 4C FE FF FF 85 FF 7E 0F C7 05 70 58 5B 00 02 00 00 00 E9 39 FE FF FF 85 ED 7E 0F C7 05 70 58 5B 00 03 00 00 00 E9 26 FE FF FF C7 05 70 58 5B 00 04 00 00 00 E9 17 FE FF FF
<< 0x770A0 8B 84 24 34 01 00 00 33 D2 B2 0A 83 3D 84 78 59 00 00 0F 84 4A FE FF FF 8B 0D 60 58 5B 00 83 79 08 65 0F 8C 3A FE FF FF 0F 84 3C FE FF FF B2 09 E9 2D FE FF FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

# AI Retreat Fix for Importance 0 Battles
>> 0x000771d9 7f 0d 83 3d 64 58 5b 00 00 0f 85 d5 fd ff ff
<< 0x000771d9 0f 84 de fd ff ff 83 3d 64 58 5b 00 00 75 e9

# Improving AI Combat Commands for Warships vs enemy Ships
>> 0x779E0 BA 01 00 00 00
<< 0x779E0 B2 01 8B EB 90
>> 0x77AB5 00 00 00 00 00 00 00 00 00 00 00 E4 87 47 00 E4 87 47 00 E4 87 47 00 E4 87 47 00 E4 87 47 00 E4 87 47 00 E4 87 47 00
<< 0x77AB5 A1 64 58 5B 00 02 05 6C 58 5B 00 B2 0A F7 EA 2C 64 F6 D8 8A F8 A1 60 58 5B 00 38 38 7C 36 90 84 DB 74 26 B2 02 EB 22
>> 0x77AE2 89 D1 89 DD
<< 0x77AE2 8B F9 8B CA
>> 0x77AF4 5D
<< 0x77AF4 C0
>> 0x77AFE BE 30 BA 57 00 BF C8 B9 57 00 B9 13 03 00 00 89 F3 89 CA 89 F8 E8 98 FA 08 00 85 C0 75 F1 B8 07 00 00 00 5D 5F 5E 59 C3
<< 0x77AFE 02 15 70 58 5B 00 80 FA 04 7D 2E 83 C5 18 B8 DC 01 00 00 03 C8 03 F8 80 39 24 7C 38 B2 00 80 39 2B 7D 3E B2 02 EB 3A 90
>> 0x77B3C 5D 5F 5E 59 C3
<< 0x77B3C 83 FE 01 75 05
>> 0x77B52 83 B9 78 01 00 00 07 74 6D 83 B9 78 01 00 00 01 0F 85 87 00 00 00 8B 91 9C 01 00 00 8D 04 D5 00 00 00 00 29 D0 C1 E0 02 01 D0 8B 15 60 78 59 00 8B 44 82 3C C1 E0 05 83 FE 01 0F 83 7E 00 00 00 85 F6 75 07 BF D4 05 59 00 01 C7 B8 03 00 00 00 31 C9 85 ED 0F 85 80 00 00 00 8D 14 C5 00 00 00 00 01 FA
<< 0x77B52 6B 41 C0 74 03 05 60 78 59 00 8A 50 3C 84 DB 75 32 8D 81 60 01 00 00 80 39 24 7C 03 83 E8 54 8B 00 3B 87 5C 01 00 00 7C 6F 80 3D 70 58 5B 00 02 7D 50 A1 60 58 5B 00 38 78 08 7C 46 80 39 24 7C 59 EB 33 B1 05 D3 E2 8B C6 C1 E0 02 03 C6 D3 E0 8D BC 10 D4 05 59 00 B8 03 00 00 00 2A C3 33 C9 8D 14 C7
>> 0x77BC8 66 8B 81 DC 01 00 00 83 E8 24 66 3D 06 00 77 13 25 FF FF 00 00 FF 24 85 C0 86 47 00 B8 02 00 00 00 EB 9B 31 C0 EB 97 BB 34 BA 57 00 BA 25 03 00 00 B8 C8 B9 57 00 E8 AD F9 08 00 85 C0 0F 85 50 FF FF FF E9 58 FF FF FF 77 07 BF 74 06 59 00 EB 82 83 FE 02 0F 85 7B FF FF FF BF 14 07 59 00 E9 6F FF FF FF B8 02 00 00 00 E9 76
<< 0x77BC8 3B F2 7C 08 6A 09 58 5D 5F 5E 59 C3 85 F6 75 BD F6 45 74 01 74 4A A1 60 58 5B 00 38 78 0C 7D AD EB 79 EB 16 8B 81 5C 01 00 00 3B 87 60 01 00 00 7F DA F6 45 74 01 74 D4 EB CA A1 60 58 5B 00 38 78 08 7C 11 80 3D 70 58 5B 00 02 7C B7 74 E3 3B F2 7F DF EB B7 80 3D 70 58 5B 00 02 7C D4 EB AC 80 3D 70 58 5B 00 00 74 AD E9 5F

# Different Solo Commands within AI Combat Groups
>> 0x77A31 46 54 89 C8 8B 50 38 3B 51 38 75 15 8A 91 0C 02 00 00 89 99 FC 01 00 00 80 CA 02 88 91 0C 02 00 00 69 91 7C 01 00 00 C8 03 00 00 8B 0D 64 78 59 00 01 D1 39 C1 75 CD
<< 0x77A31 99 FC 01 00 00 80 89 0C 02 00 00 02 8B C1 33 D2 2B 05 64 78 59 00 BF C8 03 00 00 F7 F7 3B 46 50 75 03 89 5E 54 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90 90

# AI Command Probabilities Fix
# fast group 0
>> 0x018E3D4 03 00 00 00 32 00 00 00 01 00 00 00 1E 00 00 00 05 00 00 00 0F 00 00 00 07 00 00 00 05 00 00 00 01 00 00 00 23 00 00 00 05 00 00 00 28 00 00 00 03 00 00 00 19 00 00 00 07 00 00 00 05 00 00 00 03 00 00 00 1E 00 00 00 05 00 00 00 28 00 00 00 01 00 00 00 19 00 00 00 07 00 00 00 05 00 00 00 03 00 00 00 1E 00 00 00 05 00 00 00 28 00 00 00 01 00 00 00 19 00 00 00 07 00 00 00 05 00 00 00
<< 0x018E3D4 03 00 00 00 23 00 00 00 01 00 00 00 1E 00 00 00 05 00 00 00 1E 00 00 00 07 00 00 00 05 00 00 00 01 00 00 00 23 00 00 00 05 00 00 00 23 00 00 00 03 00 00 00 19 00 00 00 07 00 00 00 05 00 00 00 03 00 00 00 1E 00 00 00 05 00 00 00 28 00 00 00 01 00 00 00 19 00 00 00 07 00 00 00 05 00 00 00 03 00 00 00 05 00 00 00 05 00 00 00 05 00 00 00 01 00 00 00 55 00 00 00 07 00 00 00 05 00 00 00
# artillery group 1
>> 0x018E474 04 00 00 00 2D 00 00 00 02 00 00 00 28 00 00 00 06 00 00 00 0F 00 00 00 07 00 00 00 00 00 00 00 04 00 00 00 28 00 00 00 02 00 00 00 28 00 00 00 06 00 00 00 14 00 00 00 07 00 00 00 00 00 00 00 04 00 00 00 23 00 00 00 02 00 00 00 28 00 00 00 06 00 00 00 19 00 00 00 07 00 00 00 00 00 00 00 04 00 00 00 23 00 00 00 02 00 00 00 28 00 00 00 06 00 00 00 19 00 00 00 07 00 00 00 00 00 00 00
<< 0x018E474 04 00 00 00 00 00 00 00 02 00 00 00 50 00 00 00 06 00 00 00 0F 00 00 00 0D 00 00 00 05 00 00 00 04 00 00 00 00 00 00 00 02 00 00 00 4B 00 00 00 06 00 00 00 14 00 00 00 0D 00 00 00 05 00 00 00 04 00 00 00 00 00 00 00 02 00 00 00 46 00 00 00 06 00 00 00 19 00 00 00 0D 00 00 00 05 00 00 00 04 00 00 00 00 00 00 00 02 00 00 00 5A 00 00 00 06 00 00 00 0A 00 00 00 07 00 00 00 00 00 00 00
# slow group 2
>> 0x018E514 03 00 00 00 28 00 00 00 05 00 00 00 23 00 00 00 01 00 00 00 19 00 00 00 07 00 00 00 00 00 00 00 01 00 00 00 3C 00 00 00 05 00 00 00 19 00 00 00 03 00 00 00 0F 00 00 00 07 00 00 00 00 00 00 00 05 00 00 00 23 00 00 00 02 00 00 00 23 00 00 00 03 00 00 00 1E 00 00 00 07 00 00 00 00 00 00 00 05 00 00 00 23 00 00 00 02 00 00 00 23 00 00 00 03 00 00 00 1E 00 00 00 07 00 00 00 00 00 00 00
<< 0x018E514 04 00 00 00 28 00 00 00 06 00 00 00 23 00 00 00 01 00 00 00 19 00 00 00 07 00 00 00 00 00 00 00 01 00 00 00 3C 00 00 00 06 00 00 00 19 00 00 00 04 00 00 00 0F 00 00 00 07 00 00 00 00 00 00 00 06 00 00 00 23 00 00 00 02 00 00 00 23 00 00 00 04 00 00 00 1E 00 00 00 07 00 00 00 00 00 00 00 06 00 00 00 23 00 00 00 02 00 00 00 23 00 00 00 01 00 00 00 1E 00 00 00 07 00 00 00 00 00 00 00

# AI fast-attack 'Pakled tactic' fix vs. Space stations (Strafe -> Charge)
>> 0x77B4B 89 D0
<< 0x77B4B B0 01
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.
Post Reply

Return to “AI Task Modifiers”