+0x0274 = Dilithium (running) -> loaded from 0x013C
+0x0278 = bugged AI (& dilithium shortage) Marker 1 = read Industry Output for Ship Construction (AI military power check)
+0x027C = build ship marker (? cf. +80 =3)
+0x02CC = Dilithium (running) -> loaded from 0x01FC
+0x02D0 = bugged AI (& dilithium shortage) Marker 1 = read Industry Output for Ship Construction (AI military power check)
+0x02D4 = build ship marker (? cf. +80 =3)
Codes look like remains of an unfinished feature for global (+local) dilithium pools supposed to be used with ship specific dilithium costs.
Current state of affairs is the AI marker is set for ProvInfo star systems up to [number of running dilithium sources].
NOT sorted by pop, industry or even presence of shipyards i.e. just random system outputs.

My first patch corrects the marker to ship-producing systems up to the max dilithium capacity. Second patch adjusts the ratio for the AI offensive
military power check.
Code: Select all
NAME: AI Check of Industry Capacities for Ship Construction - Dilithium Allocation Fix
DESC: For mods with disabled dilithium requirements for finishing ships (e.g. UDM3) use deviation code (bottom).
AUTHOR: Spocks-cuddly-tribble
URL:
>> 0x00060477 e8 54 22 fe ff 01 fb
>> 0x000604ac 8b 14
>> 0x000604af 8d 34 95 00 00 00 00 29 d6 c1 e6 02 29 d6 c1 e6 03 0f bf 18 69 db 28 03 00 00 8b 15 c8 36 5a 00 01 da 81 c2 40 02 00 00 01 f2 85 c9 76 1a
>> 0x000604ed d2
<< 0x00060477 03 df 8b 43 3c 90 90
<< 0x000604ac 6b 34
<< 0x000604af 58 0f bf 18 69 db 28 03 00 00 03 1d c8 36 5a 00 8d 94 33 40 02 00 00 85 c9 76 2d 83 7a 3c 01 75 27 90 90 90 90 90 90 90 90 90 90 90 90 90
<< 0x000604ed c2
#00461077 03DF ADD EBX,EDI
#00461079 8B43 3C MOV EAX,[EBX+3C]
#0046107C 9090 NOP
#004610AC 6B3424 58 IMUL ESI,[ESP],58
#004610B0 0FBF18 MOVSX EBX,WORD[EAX]
#004610B3 69DB 28030000 IMUL EBX,EBX,328
#004610B9 031D C8365A00 ADD EBX,[5A36C8]
#004610BF 8D9433 40020000 LEA EDX,[EBX+ESI+240]
#004610C6 85C9 TEST ECX,ECX
#004610C8 76 2D JBE SHORT 4610F7 -> for mods with disabled dilithium requirements for finishing ships -> NOP
#004610CA 837A 3C 01 CMP DWORD[EDX+3C],1
#004610CE 75 27 JNZ SHORT 4610F7
#004610D0-4610DC 90 NOP
#004610EC ^75 C2 JNZ SHORT 4610B0
# Code deviation for mods with disabled dilithium requirements for finishing ships:
# >> 0x604C8 76 2D
# << 0x604C8 90 90
Code: Select all
NAME: AI Offensive Military Power Check - Ratio & Source Data Optimisation
DESC: Offensive War Fleet Cost + 8 * Industry Outputs for Ship Construction.
AUTHOR: Spocks-cuddly-tribble
URL:
>> 0x0002cad6 8d 04 d5 00
>> 0x0002cadc 00 01 d0 c1 e0 02 01 d0 c1 e0 02 89 c2 c1 e0 02 29 d0
>> 0x0002cb4e 8d 04 d5 00
>> 0x0002cb54 00 01 d0 c1 e0 02
>> 0x0002cb5e 01 d0
>> 0x0002cb65 e0 02
>> 0x0002cb6a c2 c1 e0 02
>> 0x0002cb72 29 d0
<< 0x0002cad6 69 c2 bc 01
<< 0x0002cadc 8b 90 4c 1c 5b 00 c1 ea 03 89 54 24 24 90 90 90 90 90
<< 0x0002cb4e 69 c2 bc 01
<< 0x0002cb54 8b 90 4c 1c 5b 00
<< 0x0002cb5e 90 90
<< 0x0002cb65 ea 03
<< 0x0002cb6a 54 24 20 90
<< 0x0002cb72 90 90
#0042D6D6 69C2 BC010000 IMUL EAX,EDX,1BC
#0042D6DC 8B90 4C1C5B00 MOV EDX,[EAX+5B1C4C]
#0042D6E2 C1EA 03 SHR EDX,3
#0042D6E5 895424 24 MOV [ESP+24],EDX
#0042D6E9 9090909090 NOP
#0042D74E 69C2 BC010000 IMUL EAX,EDX,1BC
#0042D754 8B90 4C1C5B00 MOV EDX,[EAX+5B1C4C]
#0042D75E 9090 NOP
#0042D764 C1EA 03 SHR EDX,3
#0042D769 895424 20 MOV [ESP+20],EDX
#0042D76D 90 NOP
#0042D772 9090 NOP
Old post:
I guess you mean this issue with trek.exe building IDs and main building IDs, base IDs and upgades? viewtopic.php?p=56248#p56248
viewtopic.php?p=56260#p56260
To limit issues like this (TF NULL crash after messing with [saved] game features), user could try to re-set all TF move destinations to current position i.e. select current sector as move destination, then release TF interface. Best wait one turn before giving new destination or new order: viewtopic.php?p=37836#p37836
On the other hand, IIRC sometimes you must permit a certain TF to keep moving at least one turn
