Hi Flocke, I hope you're doing well. Some additions/corrections:
Flocke wrote: ↑Thu May 20, 2021 12:36 pm---
treaty file ---
0x30-0x33: treatyType (1:peace 2:alliance 3:war pact 4:accepted demand 5:friendship 6:affiliation 7:membership 8:gift)
0x70-0x71: targetRaceId (for war pact, else -1)
treatyType 9 = Bribe aka request to minor race to terminate treaty with empire targetRaceId X (can be combined with credit offer)
treatyType 4 is for every demand (credits & contested territory claims), not only accepted ones

- AI_Diplomacy.png (44.77 KiB) Viewed 100 times
Flocke wrote: ↑Thu May 20, 2021 12:36 pm---
GTForceList/GWTForce ---
ability mask 0x0008 (08 00) = ?? never seen used
sub_4485D8 SetTaskForceAbilities -> see IDA:
https://workupload.com/file/4yVDdUwcf7T
Indicates at least one ship has zero hull points in GShipList (possible due to vanilla bugs e.g. orbital batteries and neutron stars).
For an unused feature I guess (TF features crippled, repair, forced scrap?)
Also @ +50 -> greatest colony ship production value, so your 'contains colony ships' = 1 doesn't work for patches (but greater null will).
+44 = colony ship ID with greatest production value (vanilla different values possible due to missed upgrade bug) Both values should be unused by default.
Using the info I implemented a workaround for a TF NULL crash problem due an unknown AI colony ship task issue in one of my patches.
00448D7E 8078 50 01 CMP BYTE PTR DS:[EAX+50],1 // greatest colony ship production value
00448D82 7D 5B JGE SHORT 448DDF // contains colony ships
It won't relocate stranded fleets containing colony ships anymore, but better than sporadic crashes or no patch:
viewtopic.php?p=57729#p57729
More than that I fixed an annoying bug with AI fleets keeping old/bad stats after re-deploying. Limping with speed 1 (and/or short range) to the next staging point after some tasks can cause massive delays between the AI fleet tasks (worse in larger maps).
Example for the vanilla AI Fleets glitch (note wrong speed 1, TT with scout scan value and scout with med range):

- AI_Fleets_Glitch.png (52.59 KiB) Viewed 205 times
► Show Spoiler
NAME: AI Fleets with wrong Speed/Range after redeploy (Fix)
>> 0x000086ce 8b 40 4e ba 01 00 00 00 c1 f8 10 e8 42 05 04 00 8b 50 04 89 c1
>> 0x00008727 15 03 04
>> 0x0000872c 44 24 fe ba 01
>> 0x00008732 00 00 c1 f8 10
>> 0x0000c4db 8d 94 24 20 01 00 00
>> 0x0000c51d 84 24 20 01 00 00
>> 0x0000c525 0f bf 16 e8 73 af 03 00 8d 84 24 20 01 00 00
<< 0x000086ce 0f b7 40 50 42 e8 48 05 04 00 8b c8 e8 f9 f2 03 00 8b 51 04 90
<< 0x00008727 ad f2 03
<< 0x0000872c c4 e8 0e 03 04
<< 0x00008732 0f b7 04 24 42
<< 0x0000c4db 8b d0 8b d8 90 90 90
<< 0x0000c51d 03 0f bf 16 90 90
<< 0x0000c525 e8 76 af 03 00 8b c1 e8 a7 b4 03 00 8b c3 90
004092CE 0FB740 50 MOVZX EAX,WORD [EAX+50] // fleet ID from GShipList
004092D2 42 INC EDX
004092D3 E8 48050400 CALL 449820 // GetTaskForceEntry
004092D8 8BC8 MOV ECX,EAX
004092DA E8 F9F20300 CALL 4485D8 // update TaskForceAbilities
004092DF 8B51 04 MOV EDX,[ECX+4] // ship count
004092E2 90 NOP
00409326 E8 ADF20300 CALL 4485D8 // update TaskForceAbilities
0040932B 8BC4 MOV EAX,ESP
0040932D E8 0E030400 CALL 449640 // AI_add_to_TF_sector_list_3C
00409332 0FB70424 MOVZX EAX,WORD [ESP]
00409336 42 INC EDX
0040D0DB 8BD0 MOV EDX,EAX
0040D0DD 8BD8 MOV EBX,EAX
0040D0DF 909090 NOP
0040D11B 66:8903 MOV [EBX],AX
0040D11E 0FBF16 MOVSX EDX,WORD [ESI]
0040D121 9090 NOP
0040D125 E8 76AF0300 CALL 4480A0 // AI_remove_shipID_EDX_fleet_EAX
0040D12A 8BC1 MOV EAX,ECX // old fleet entry
0040D12C E8 A7B40300 CALL 4485D8 // update TaskForceAbilities
0040D131 8BC3 MOV EAX,EBX
0040D133 90 NOP
Also upcoming:
- Disable AI Fleet Buildup Support Limit in Peacetime for Affluent AIs
-> Fed AI with 1.5+ Mio. credits but -3k income (without AI cheats) stopped after only 3 Defiants in one of my test games
► Show Spoiler
NAME: Disable AI Fleet Buildup Support Limit in Peacetime for Affluent AIs
DESC: AIs with more than 400,000 credits use the increased war NETCRALLOC limit even in peacetime.
AUTHOR: Spocks-cuddly-tribble
URL:
>> 0x00006294 8b 6a 04 83 fd 07
>> 0x0000629b 85
>> 0x00006390 83 fd 06 0f 84 07 ff ff ff
>> 0x0000639d 84
<< 0x00006294 81 fd 80 1a 06 00
<< 0x0000629b 8c
<< 0x00006390 8b 6a 04 83 fd 06 7c 0a 90
<< 0x0000639d 8e
#00406E94 81FD 801A0600 CMP EBP,61A80 // 400,000
#00406E9A 0F8C F0000000 JL 406F90 // check war agendas
#00406F90 8B6A 04 MOV EBP,[EDX+4] // AI agenda
#00406F93 83FD 06 CMP EBP,6
#00406F96 7C 0A JL SHORT 406FA2 // not war
#00406F98 90 NOP
#00406F9C ^0F8E FEFEFFFF JLE 406EA0 // is war
- AI Rejecting Alliance Fix to allow Domination team Victory -> Example for the issue:
viewtopic.php?p=57051#p57051
-> this one was tricky, default requires 20+ 'Good' special events (my klingons have only 6 with the feds in below pic):

- map_ai_data_types_E_F_12.png (11.58 KiB) Viewed 205 times
► Show Spoiler
NAME: AI Rejecting Alliance Fix to allow Domination team Victory
DESC:
AUTHOR: Spocks-cuddly-tribble
URL:
>> 0x00030969 31 d2 88 fa 31 c9
>> 0x00030970 6c 49 fd ff 66 8b 4e 08 89 c5 8d 04 cd 00 00 00 00 01 c8 c1 e0 02 01 c8 c1 e0 02 89 c1 c1 e0 02 bf 98 1a 5b 00 29 c8 30 db 01 c7 31 c9 88 d9 89 f0 89 ca e8 38 49 fd ff 85 c0 75 2a fe c3 80 fb 05 72 e8 31 d2 88 fa 89 d0 e8 02 37 fd ff 85 c0 74 29 7c 0a 66 83 bd d6 01 00 00 03 7e 40
>> 0x000309d7 bc 8f 10 01 00 00 02
>> 0x000309e8 c3
>> 0x000309ec bf 06 e8 ad 43 fd ff 83 f8 07 7c d6 66 83 bd d4 01 00 00 14 7c cc 66 83 bd d6 01 00 00 03 7e 17
<< 0x00030969 e8 72 49 fd ff 8b
<< 0x00030970 b9 bc 01 00 00 0f b6 7e 08 0f af f9 81 c7 a8 1b 5b 00 32 db 33 d2 8a d3 8b c6 52 e8 50 49 fd ff 5a 85 c0 75 41 fe c3 80 fb 05 72 e8 80 7c 29 1a 03 7f 2b 8a d7 8b c2 e8 14 37 fd ff 85 c0 7c 1e 75 5c 66 81 7d 02 ee 02 7c 14 80 7c 29 18 14 7d 62 8b 77 a0 ba 48 1b 5b 00 0f b6 c7 eb 1d
<< 0x000309d7 3c 97 02 90 90 90 90
<< 0x000309e8 ac
<< 0x000309ec af c1 03 34 10 33 db 8d 04 8b 03 1c 10 2b c1 7d f9 8d 04 5b c1 e8 02 3b f0 7f 1c 90 90 90 90 90
► Show Spoiler
00431569 E8 7249FDFF CALL 405EE0
0043156E 8BE8 MOV EBP,EAX
00431570 B9 BC010000 MOV ECX,1BC // entry size empsInfo
00431575 0FB67E 08 MOVZX EDI,BYTE [ESI+8]
00431579 0FAFF9 IMUL EDI,ECX
0043157C 81C7 A81B5B00 ADD EDI,5B1BA8 // empsInfo 0x5B1A98+0x110=0x5B1BA8
00431582 32DB XOR BL,BL
00431584 33D2 XOR EDX,EDX
00431586 8AD3 MOV DL,BL
00431588 8BC6 MOV EAX,ESI
0043158A 52 PUSH EDX
0043158B E8 5049FDFF CALL 405EE0
00431590 5A POP EDX
00431591 85C0 TEST EAX,EAX
00431593 75 41 JNZ SHORT 4315D6
00431595 FEC3 INC BL
00431597 80FB 05 CMP BL,5
0043159A ^72 E8 JB SHORT 431584
0043159C 807C29 1A 03 CMP BYTE [ECX+EBP+1A],3
004315A1 7F 2B JG SHORT 4315CE
004315A3 8AD7 MOV DL,BH
004315A5 8BC2 MOV EAX,EDX
004315A7 E8 1437FDFF CALL 404CC0
004315AC 85C0 TEST EAX,EAX
004315AE 7C 1E JL SHORT 4315CE
004315B0 75 5C JNZ SHORT 43160E
004315B2 66:817D 02 EE02 CMP WORD [EBP+2],2EE // 750
004315B8 7C 14 JL SHORT 4315CE
004315BA 807C29 18 14 CMP BYTE [ECX+EBP+18],14
004315BF 7D 62 JGE SHORT 431623
004315C1 8B77 A0 MOV ESI,DWORD [EDI-60] // 0x110-0x60=0xB0 // cumulated total population AI empire
004315C4 BA 481B5B00 MOV EDX, 5B1B48 // empsInfo 0x5B1A98+0xB0=0x5B1B48 // cumulated total population
004315C9 0FB6C7 MOVZX EAX,BH
004315CC EB 1D JMP SHORT 4315EB
004315D6 833C97 02 CMP DWORD [EDI+EDX*4],2
004315DA 90909090 NOP
004315E7 ^74 AC JE SHORT 431595
004315EB 0FAFC1 IMUL EAX,ECX
004315EE 033410 ADD ESI,DWORD [EAX+EDX] // + cumulated total population player empire
004315F1 33DB XOR EBX,EBX
004315F3 8D048B LEA EAX,DWORD [EBX+ECX*4]
004315F6 031C10 ADD EBX,DWORD [EAX+EDX] // cumulated total population of all empires
004315F9 2BC1 SUB EAX,ECX
004315FB ^7D F9 JGE SHORT 4315F6
004315FD 8D045B LEA EAX,DWORD [EBX+EBX*2] // *3
00431600 C1E8 02 SHR EAX,2 // *3/4 = 75 %
00431603 3BF0 CMP ESI,EAX
00431605 7F 1C JG SHORT 431623 // Alliance can trigger domination Victory
00431607 9090909090 NOP
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.