This code extends the production value range of colony ships for terraforming and colonising.
This mod is based on the instant terraforming bug fix postet by Spocks-cuddle-tribbles.
The main goal is to increase the range of production value so it is possible to assign different colony production values for majors without putting the game into disbalance. Possible range starts form 0 to 127, but the highest value could be higher. Usefull upper limit is below 400 (or any other lowest troop transporter production value), to have the instant terraforming bug fix working after all.
But using production values higher than 127 should addapt terraforming value calculation.
Terraforming value is calculated by this way:
terraforming value = (production value + 5) * 16
BTW:
grouping of colony ships for faster terraforming don't work as usual, since the production value of all grouped colony ships is added first, then added 5 and the result multiplied by 16.
Example:
- with prod. value 0 one ships has a terraforming value of 80, 2 of 160 and 3 of 240
with prod. value 4 one ships has a terraforming value of 144, 208 of 160 and 3 of 272
with prod. value 20 one ships has a terraforming value of 400, 720 of 1040 and 3 of 240
with prod. value 20 one ships has a terraforming value of 400, 720 of 1040 and 3 of 240
This should simulate tuning problems when more than one colony ship crew works together while terraforming of one planet. :-)
But since the new code frees up some code space, it should be easy to move the "add ecx, 5" on asm location 469261 and adapt the following code. ;-)
old code is:
Code: Select all
46925A:
cmp eax, 0Ah
jge short loc_469261
add ecx, eax
loc_469261:
mov eax, [esi+4]
add ebx, 4
cmp edx, eax
jl short loc_469241
nop
loc_46926C:
cmp word ptr [ebp+3Ah], 0
jz short loc_4692E5
mov eax, ecx
shl ecx, 2
sub ecx, eax
shl ecx, 3
add ecx, eax
mov eax, ebp
xor edx, edx
xor eax, ebp
mov dx, [ebp+3Ah]
mov ax, [ebp+3Ch]
sub edx, eax
shl ecx, 2
loc_469AF4:
cmp edi, 0Ah
jge loc_469DC4
loc_469AFD:
lea eax, ds:0[edi*4]
sub eax, edi
mov edx, [esp+1F0h+var_C]
mov eax, ds:dword_5904B8[eax*4]
loc_469B8C:
lea ebx, ds:0[edi*4]
sub ebx, edi
shl ebx, 2
mov esi, ds:dword_5904BC[ebx]
loc_469BB5:
call sub_445DF0
cmp ecx, ds:dword_5904BC[ebx]
loc_469BFC:
lea ebx, ds:0[edi*4]
sub ebx, edi0
shl ebx, 2
mov edx, ds:dword_5904BC[ebx]
loc_469C22:
call sub_445DF0
cmp ecx, ds:dword_5904C0[ebx]
Code: Select all
46925A:
cmp eax, 7Fh
jge short loc_469261
add ecx, eax
loc_469261:
mov eax, [esi+4]
add ebx, 4
cmp edx, eax
jl short loc_469241
nop
loc_46926C:
cmp word ptr [ebp+3Ah], 0
jz short loc_4692E5
mov eax, ecx
add ecx, 5
shl ecx, 4
nop
nop
nop
nop
add ecx, eax
mov eax, ebp
xor edx, edx
xor eax, ebp
mov dx, [ebp+3Ah]
mov ax, [ebp+3Ch]
sub edx, eax
nop
nop
nop
loc_469AF4:
cmp edi, 7Fh
jge loc_469DC4
loc_469AFD:
mov eax, edi
add eax, 14h
shr eax, 1
nop
mov edx, [esp+1F0h+var_C]
7 x nop
loc_469B8C:
mov ebx, edi
add ebx, 14h
shr ebx, 3
nop
3 x nop
mov esi, ebx
4 x nop
loc_469BB5:
call sub_445DF0
cmp ecx, ebx
4 x nop
loc_469BFC:
mov ebx, edi
add ebx, 18h
shr ebx, 4
5 x nop
mov edx, ebx
4 x nop
loc_469C22:
call sub_445DF0
cmp ecx, ebx
4 x nop
in hex it is:
Code: Select all
at 0x06864F:
E84C 6400 0025 FFFF 0000 4283 F87F 7D02
01C1 8B46 0483 C304 39C2 7CD6 9066 837D
3A00 7472 89C8 83C1 05C1 E104 9090 9090
89E8 31D2 31E8 668B 553A 668B 453C 29C2
9090 90
at 0x068EF4:
83FF 7F0F 8DC7 0200 0089 F883
C014 C1F8 0190 8B94 24E4 0100 0090 9090
9090 9090
at 0x068F8C:
89FB 83C3 14C1 FB03 9090 9090 89DE 9090
9090
at 0x068FB4:
39D9 9090 9090
at 0x068FFC:
89FB 83C3 18C1 FB04 9090 9090 89DA 9090
9090
at 0x069027:
39D9 9090 9090
new colonies will use the following values instead of table in trek.exe at hex 0x18E2B8 (Yes, this table could then be used for other modding purposes)
Code: Select all
production value, terraforming value, population, farms, factories
0 80 10 2 1
1 96 10 2 1
2 112 11 2 1
3 128 11 2 1
4 144 12 3 1
5 160 12 3 1
6 176 13 3 1
7 192 13 3 1
8 208 14 3 2
9 224 14 3 2
10 240 15 3 2
11 256 15 3 2
12 272 16 4 2
13 288 16 4 2
14 304 17 4 2
15 320 17 4 2
16 336 18 4 2
17 352 18 4 2
18 368 19 4 2
19 384 19 4 2
20 400 20 5 2
21 416 20 5 2
22 432 21 5 2
23 448 21 5 2
24 464 22 5 3
25 480 22 5 3
26 496 23 5 3
27 512 23 5 3
28 528 24 6 3
29 544 24 6 3
30 560 25 6 3
31 576 25 6 3
32 592 26 6 3
33 608 26 6 3
34 624 27 6 3
35 640 27 6 3
36 656 28 7 3
37 672 28 7 3
38 688 29 7 3
39 704 29 7 3
40 720 30 7 4
41 736 30 7 4
42 752 31 7 4
43 768 31 7 4
44 784 32 8 4
45 800 32 8 4
46 816 33 8 4
47 832 33 8 4
48 848 34 8 4
49 864 34 8 4
50 880 35 8 4
51 896 35 8 4
52 912 36 9 4
53 928 36 9 4
54 944 37 9 4
55 960 37 9 4
56 976 38 9 5
57 992 38 9 5
58 1008 39 9 5
59 1024 39 9 5
60 1040 40 10 5
61 1056 40 10 5
62 1072 41 10 5
63 1088 41 10 5
64 1104 42 10 5
65 1120 42 10 5
66 1136 43 10 5
67 1152 43 10 5
68 1168 44 11 5
69 1184 44 11 5
70 1200 45 11 5
71 1216 45 11 5
72 1232 46 11 6
73 1248 46 11 6
74 1264 47 11 6
75 1280 47 11 6
76 1296 48 12 6
77 1312 48 12 6
78 1328 49 12 6
79 1344 49 12 6
80 1360 50 12 6
81 1376 50 12 6
82 1392 51 12 6
83 1408 51 12 6
84 1424 52 13 6
85 1440 52 13 6
86 1456 53 13 6
87 1472 53 13 6
88 1488 54 13 7
89 1504 54 13 7
90 1520 55 13 7
91 1536 55 13 7
92 1552 56 14 7
93 1568 56 14 7
94 1584 57 14 7
95 1600 57 14 7
96 1616 58 14 7
97 1632 58 14 7
98 1648 59 14 7
99 1664 59 14 7
100 1680 60 15 7
101 1696 60 15 7
102 1712 61 15 7
103 1728 61 15 7
104 1744 62 15 8
105 1760 62 15 8
106 1776 63 15 8
107 1792 63 15 8
108 1808 64 16 8
109 1824 64 16 8
110 1840 65 16 8
111 1856 65 16 8
112 1872 66 16 8
113 1888 66 16 8
114 1904 67 16 8
115 1920 67 16 8
116 1936 68 17 8
117 1952 68 17 8
118 1968 69 17 8
119 1984 69 17 8
120 2000 70 17 9
121 2016 70 17 9
122 2032 71 17 9
123 2048 71 17 9
124 2064 72 18 9
125 2080 72 18 9
126 2096 73 18 9
127 2112 73 18 9