Regrettably, the using of shipyards/starbases, to upgrade ships with industry/credits, is unrealistic within the restrictions of the game. But even apart from the somewhat solved "upgrade and scrap" exploit, auto-upgrading is still an imbalance issue that has to be addressed.
This topic summarizes the means available up to the closest possible approach to simulate a refitting process (section 3.3).
1. Basics
1.1 No Ship Upgrades
=> shiptech.sst & shiplist.sst -mechanics
1.2 No Auto-Upgrades (for ships on map, under construction/build queue)
=> how to make ships obsolete
1.3 Different upgrades for the same ship (useful infos by Thunderchild)
=> Upgrades - some ideas
2. Known Bugs
2.1 There is a bug preventing auto-upgrading ships under construction (& in build queue), if not same ship(ID) present on map or finished that turn.-> (fix-3.1)
2.2 Code for (2.1) is not shared by AI, but there hides a similar AI bug somewhere else.
2.3 For one turn, the displayed cost & total credits preview is wrong (old price) for auto-upgraded ships under construction. It's just cosmetics, but in the worst case this can lead to a "credit deficit".
2.4 The update of task force map speed is delayed by a turn. -> (fix-3.3 or redeploy).
2.5 Instant repair of all hull damage when auto-upgrading damaged ships.-> (fix-3.3)
3. Bugfixes & Modding Options
3.1 Ships in build queue occasionally not auto-upgraded (fix)
Code: Select all
trek.exe at:
0x49796 change A7 01 -> B2 00
0x497B4 change 69 01 -> 94 00
0x497D1 change 0F 85 4A 01 00 00 -> 75 79 90 90 90 90
and at 0x49851
replace: (15 bytes)
31 C0 66 8B 49 28 A0 28 2B 5A 00 D3 E2 85 D0
with:
8A 8C 24 30 01 00 00 D3 E2 84 15 28 2B 5A 00
44A394 0F84 B2000000 JE 44A44C //goto ships under construction
44A3B2 0F85 94000000 JNZ 44A44C
44A3D1 75 79 JNZ SHORT 44A44C
44A3D3 90909090 NOP
44A451 8A8C24 30010000 MOV CL, [ESP+130] // race ID
44A458 D3E2 SHL EDX, CL
44A45A 8415 282B5A00 TEST [5A2B28], DL // AI check
3.2 Auto-Upgrades for AI only
For game balance, this would be the best solution i.e. players have to scrap/replace obsolete ships with newer ones (AI won't do that see link 1.2).
However, there's another problem to deal with:
Since BotF doesn't support transferring crew(-experience) -or names- between ships, this feature somewhat diminishes the concept of "crew experience". Unfortunately, the implemetation of crew-transfer is also not practicable.
Anyhow, here is the option:
Code: Select all
Trek.exe at 0x497D7
replace: (30 bytes)
31 C0 89 E2 8A 84 24 2C 01 00 00 E8 D9 55 02 00 8B 84 24 20 01 00 00 8B 94 24 A8 00 00 00
with:
8A 8C 24 30 01 00 00 B5 01 D2 E5 84 2D 28 2B 5A 00 8B 8C 24 20 01 00 00 75 5B EB 3C 90 90
44A3D7 8A8C24 30010000 MOV CL, [ESP+130] // race ID
44A3DE B5 01 MOV CH, 1
44A3E0 D2E5 SHL CH, CL
44A3E2 842D 282B5A00 TEST [5A2B28], CH // AI ?
44A3E8 8B8C24 20010000 MOV ECX, [ESP+120] // GShiplist
44A3EF 75 5B JNZ SHORT 44A44C // if not AI goto ships under construction
44A3F1 EB 3C JMP SHORT 44A42F // auto-upgrade ships on map
44A3F3 90 90 NOP
3.3 Instant hull repair fix + one turn delay fix (#2.4)
This fix keeps the current hull points so that auto-upgraded ships regenerate to new nominal hull (will also prevent auto-upgrade abuse w.r.t hull damage -particularly for ramming- between two battles/system attacks).
Note that completition of new ships is executed before the auto-upgradings. So all ships produced for the old price will be affected by this hull feature.
Side note w.r.t. the "upgrade and scrap" exploit:
Keep in mind that scrapping damaged ships in BotF doesn't yield cash. So one would have to wait until the refitting proccess is completed (i.e. full new nominal hull reached) in order to scrap the upgraded ships for credits.
Simulating a Refitting Process (Option)
Given all the above discussed ties and bounds regarding the BotF code, the best possible approach to simulate a refitting process is a loss of hull points.
This does mean, even though the upgraded systems (weapons, speed, sensors, shields) become available instantly, the refitting task isn't fully completed, reflected by a reduction of current hull points. That way, a temporary withdrawal from the front line and visiting star systems /stations could be recommended to accelerate the upgrading (i.e. regenerate hull).
Note the Ship Repair - Ally & Shipyard Bug-fix
Since ships during refitting, temporarily are also more vulnerable for ramming, an interesting counter concept, that tactic-wise plays out quite well (hull loss vs. stronger weapons, shields, agility).
Code: Select all
Trek.exe at 0x497F8
replace: (84 bytes)
39 D0 75 21 31 D0 8A 84 24 28 01 00 00 89 E2 E8 B4 55 02 00 8B 94 24 20 01 00 00 8B 84 24 A8 00 00 00 89 42 3C 8B 94 24 20 01 00 00 8B 84 24 28 01 00 00 66 89 42 52 8B 94 24 26 01 00 00 8B 84 24 20 01 00 00 C1 FA 10 8B 8C 24 20 01 00 00 E8 C4 02 00 00
with:
8A 8C 24 30 01 00 00 B5 01 D2 E5 84 2D 28 2B 5A 00 74 09 33 D2 66 F7 35 44 2B 5A 00 8B D8 8B 84 24 20 01 00 00 8B 94 24 28 01 00 00 E8 E7 02 00 00 8B 8C 24 20 01 00 00 89 59 3C 0F B7 41 50 BA 00 00 00 00 E8 DF F3 FF FF E8 92 E1 FF FF 90 90 90 90 90 90
44A3F8 8A8C24 30010000 MOV CL, [ESP+130] // race ID
44A3FF B5 01 MOV CH, 1
44A401 D2E5 SHL CH, CL
44A403 842D 282B5A00 TEST [5A2B28], CH // AI ?
44A409 74 09 JE SHORT 44A414 // if AI skip player hull loss
44A40B 33D2 XOR EDX, EDX
44A40D 66:F735 442B5A00 DIV WORD [5A2B44] // difficulty level
44A414 8BD8 MOV EBX, EAX // old hull points
44A416 8B8424 20010000 MOV EAX, [ESP+120] // GShipList
44A41D 8B9424 28010000 MOV EDX, [ESP+128] // shiplist.sst ID
44A424 E8 E7020000 CALL 44A710 // update GShipList
44A429 8B8C24 20010000 MOV ECX, [ESP+120] // GShiplist
44A430 8959 3C MOV [ECX+3C], EBX // restore old hull points
44A433 0FB741 50 MOVZX EAX, WORD [ECX+50] // load fleet ID
44A437 BA 00000000 MOV EDX, 0
44A43C E8 DFF3FFFF CALL 449820 // load taskforce entry
44A441 E8 92E1FFFF CALL 4485D8 // update taskforce abilities
44A446-44A44B 90 NOP
(if you only want the bugfix for 2.5, without refitting simulation, just replace 74 with EB at asm-44A409)