Coupling Terraforming Output to current Bio Tech Level
The following code example ignores the shiplist.sst production value and calculates instead 50 times current Bio Tech Level per colony ship.
(smaller intervalls than 50, or using a tech & production value, quickly becomes confusingly)
Code: Select all
trek.exe at 0x68643
replace: (41 bytes)
06 C1 F8 10 E8 44 14 FE FF 8A 40 52 25 FF 00 00 00 E8 47 64 00 00 25 FF FF 00 00 42 01 C1 8B 46 04 83 C3 04 39 C2 7C D6 90
with:
08 E8 47 14 FE FF 8A 40 52 E8 1F 65 00 00 3C 05 75 01 41 42 83 C3 04 3B 56 04 7C E2 8B 47 08 33 D2 E8 17 A4 FE FF 0F AF C8
NOTE: when using the AI terraforming tweak (see below) just change at 0x68675 -> 64 to 32 instead of the following two modifications!
at 0x68673 change: 89 C8 C1 E1 02 -> 6B D9 32 90 90
AND at 0x6868F change: C1 E1 02 -> 8B CB 90
469241 8B43 08 MOV EAX, [EBX+8]
469244 E8 4714FEFF CALL 44A690 (LoadGShipList)
469249 8A40 52 MOV AL, [EAX+52] // shiplist.sst ID
46924C E8 1F650000 CALL 46F770 (GetShipFunction)
469251 3C 05 CMP AL, 5 // colony ship ?
469253 75 01 JNZ SHORT 469256
469255 41 INC ECX // number of colony ships
469256 42 INC EDX
469257 83C3 04 ADD EBX, 4
46925A 3B56 04 CMP EDX, [ESI+4]
46925D 7C E2 JL SHORT 469241 // loop next ship in task force
46925F 8B47 08 MOV EAX, [EDI+8] // race ID
469262 33D2 XOR EDX, EDX // tech ID 0 = Bio
469264 E8 17A4FEFF CALL 453680 (GetTechLevel)
469269 0FAFC8 IMUL ECX, EAX // colony ships * bio tech level
469273 6BD9 32 IMUL EBX, ECX, 32h // TF output * 50
469276 90 90 NOP
46928F 8BCB MOV ECX, EBX
469291 90 NOP
Modifying AI Terraforming Speed (compatible with all above modifications)
This gives the AI a speed bonus of 50% per difficulty level above 'simple'.
i.e. [Task Force Terrafoming Capacity] * [difficulty level +1] / 2
Code: Select all
trek.exe at 0x68673
replace: (57 bytes)
89 C8 C1 E1 02 29 C1 C1 E1 03 01 C1 89 E8 31 D2 31 E8 66 8B 55 3A 66 8B 45 3C 29 C2 C1 E1 02 89 D0 39 D1 76 02 89 D1 8B 04 24 89 CB 31 D2 8B 40 0A 66 8B 54 24 04 C1 F8 10
with:
6B D9 64 8A 4F 08 B5 01 D2 E5 84 2D 28 2B 5A 00 75 0C 66 A1 44 2B 5A 00 40 0F AF D8 D1 EB 0F B7 45 3A 66 2B 45 3C 3B D8 76 02 8B D8 8B 04 24 0F B7 54 24 04 0F B7 40 0C 90
469273 6BD9 64 IMUL EBX,ECX, 64h // default TF muliplier 100
469276 8A4F 08 MOV CL, [EDI+8] // race ID ship owner
469279 B5 01 MOV CH, 1
46927B D2E5 SHL CH, CL
46927D 842D 282B5A00 TEST [5A2B28], CH // AI ?
469283 75 0C JNZ SHORT 469291 // if not skip bonus
469285 66:A1 442B5A00 MOV AX, [5A2B44] // difficulty level
46928B 40 INC EAX
46928C 0FAFD8 IMUL EBX, EAX
46928F D1EB SHR EBX, 1
469291 0FB745 3A MOVZX EAX, WORD [EBP+3A] // planet TF cost total
469295 66:2B45 3C SUB AX, WORD [EBP+3C] // total - done = still to-do
469299 3BD8 CMP EBX, EAX
46929B 76 02 JBE SHORT 46929F
46929D 8BD8 MOV EBX, EAX // prevent terraforming overflow
46929F 8B0424 MOV EAX, [ESP]
4692A2 0FB75424 04 MOVZX EDX, WORD [ESP+4]
4692A7 0FB740 0C MOVZX EAX, WORD [EAX+C]
4692AB 90 NOP
If you still want more speed, replacing these statements with nop's increases the bonus to +100% (maybe a bit over the top):
Code: Select all
46928B 40 INC EAX
46928F D1EB SHR EBX, 1
To get rid of the AI colony ships' common 'sitting duck' behavior when facing powerful opponents (they do nothing useful and don't colonise):
Dynamic Danger Check for AI Colonize, Tform & BldBase Tasks:
viewtopic.php?p=50865#p50865
Given an AI speedup, the following link again becomes interesting:
the AI minimum terraform threshold
But better use 'Force AI to Tform improve all its systems' (above link).
I don't know how many bugs is too many but that point is reached somewhere before however many in BotF is.