Trade Routes, Ship Regeneration, Neutron Stars, Black Holes

Trade Routes, Ship Regeneration, Neutron Stars, Black Holes; support/discussion/questions

Moderator: thunderchero

User avatar
Gowron
Code Master
Code Master
Posts: 304
Joined: Sat Apr 26, 2008 2:00 am
Location: 50° N, 11° E

Trade Routes, Ship Regeneration, Neutron Stars, Black Holes

Post by Gowron » Thu May 01, 2008 3:55 pm

1. Credit Output from Trade Routes

The number of credits generated by a trade route from one of your own systems with a population size P1 to a foreign system with a population size P2 will be:

(0.05 * P1) + (0.1 * P2)

The result is always rounded down (cut at the decimal point).
It does not depend on any other factors like morale or race.
Note that the formula is not symmetrical. A trade route from a small system to a big system will be more profitable than one from a big system to a small system.


Bonuses
Bonuses will not be displayed on the F1 screen, instead you'll only see the basic output. But on the F2 screen, the number of credits produced by the system will include all trade routes and bonuses.
There are 3 bonus types that apply to trade route outputs:
(1) trade route bonuses (e.g. Tower of Commerce)
(2) local credits bonuses (e.g. Trade Center)
(3) global credits bonuses
Again, multiple bonuses of the same type are cumulative, not multiplicative.

=> Trade Route Outputs






2. Number of Trade Routes

To support a new trade route, a system must reach (not actually reach, see below) a multiple of a certain population number. This number depends on the controlling empire:

Code: Select all

Ferengi:     125
Federation:  150
Cardassians: 160
Romulans:    175
Klingons:    185
Location of the trade route thresholds in trek.exe, by JOKER:
Joker wrote:pos dec 1628740
int

So a Ferengi pop 125 system can have 1 trade route, a Ferengi pop 250 system can have 2 trade routes, and so on.
A system will not lose a trade route if it shrinks.
A system will not get more than one trade route per threshold, even if the threshold is passed multiple times (due to alternating growth and shrinkage).

But now for the complicated part:
You don't actually get the new trade route when your system's population reaches the threshold number. You'll already get it "one turn earlier". The game tries to extrapolate the future growth (from this turn to the next turn) from the current growth (from the previous turn to this turn). So if you're playing as Ferengi and your system grows from pop 121 to pop 123, it will now get its first trade route.

When extrapolating the population for the next turn, the game ignores the system's maximum population capacity. This can be exploited: For example, when playing als the Klingons, the threshold for the second trade route is 370, but you have a system with a max. pop of 360, you can get a second trade route for that system by proper growth control (i.e. you want to get a big growth step to as close to 360 as possible).






3. Ship Regeneration

A damaged ship will repair a part of its hull at the very start of each turn. The amount of hit points that are gained depends on the square that the ship occupies.
If the square contains a star system (no matter if friendly or not, no matter if inhabitated or not), then the ship gains an amount of HPs equal to 10% of its maximum hull strength.
If the square does not contain a star system, but there's an outpost or a starbase (no matter if friendly or not), the the ship gains an amount of HPs equal to 5% of its maximum hull strength.
If the square does not contain a star system or an outpost/starbase, then the ship gains an amount of HPs equal to 1% of its maximum hull strength.

These amounts willl always be rounded down (cut at the decimal point), i.e. a ship with a maximum hull strength of less than 100 on an empty square will not be able to regenerate its hull at all, no matter how long it stays there.






4. Neutron Stars

If a ship starts its turn on a square with a neutron star, then it will receive 225 points of damage. If the shield strength is lower then 225, then the hull will take the rest of the damage. If the combined shield+hull strength is lower than 225, then the ship is destroyed.

This takes place before hull regeneration, so a part (or even all) of the hull may be repaired immediately, making it seem as if the neutron star did less than 225 points of damage.

Cloaked ships WILL be protected by their shields.

Ships with a combined shield+hull strength of exactly 225 (e.g. Ferengi Light Raider I) will survive with 0 HPs left. (it's the same phenomenon as with orbitals)

On a side note, I tested this with a Ferengi Light Raider I. With 0 HPs left, I moved it into a nebula where it encountered a Federation scout. The scout retreated, and the Light Raider won the battle with zero shields and zero hull ^^

Edit: The damage value has been discovered, see below :)




5. Black Holes

If a ship with a movement rate of 1 starts its turn on a square with a black hole, then there's a chance that it's destroyed. I don't know the formula for the destruction probabilily, but a Ferengi Scout I is *much* more likely to be destroyed than a Cardassian Battleship I. In a test, I've sent 100 Ferengi Scouts (type I) into a black hole. 25 survived the first turn (in comparison, all of my 50 Cardassian Battleships survived the first turn), but when I re-loaded the saved game (previous turn), I got the same result (even the same ships were destroyed). After several tries with the same result, I re-loaded, let the ships wait one more turn, then sent them to the black hole and got a different result. So it's not just a matter of probability, but obviously also a matter of the game state.

Ships with a movement rate of 2 or more are not destroyed by black holes, and neither are outposts or starbases (if you manage to build them there ;)).
Last edited by Gowron on Thu Sep 25, 2008 9:47 am, edited 1 time in total.

User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 721
Joined: Sun Apr 27, 2008 2:00 am

Re: Trade Routes, Ship Regeneration, Neutron Stars, Black Ho

Post by Spocks-cuddly-tribble » Thu Jul 24, 2008 5:39 pm

[Edit]
Gowron wrote:5. Black Holes

If a ship with a movement rate of 1 starts its turn on a square with a black hole, then there's a chance that it's destroyed.
:arrow: The table of likelihoods by Gowron.
Gowron wrote:Ships with a movement rate of 2 or more are not destroyed by black holes
The needed minimum speed in order to be save is in trek.exe at 0x17882C (8 bytes) - default value 2.0

[/Edit]


Gowron wrote:A damaged ship will repair a part of its hull at the very start of each turn.
If the square contains a star system (no matter if friendly or not, no matter if inhabitated or not), then the ship gains an amount of HPs equal to 10% of its maximum hull strength.
Funny: Supernovae work fine too. :wink:
Last edited by Spocks-cuddly-tribble on Tue Jul 14, 2009 6:25 pm, edited 1 time in total.
On the verge of a nervous breakdown? Try the relaxing tribble sounds.

User avatar
Gowron
Code Master
Code Master
Posts: 304
Joined: Sat Apr 26, 2008 2:00 am
Location: 50° N, 11° E

Post by Gowron » Thu Sep 25, 2008 9:45 am

UPDATE:

I've located the damage value for Neutron Stars.

It's stored in trek.exe two times.

The first entry is found at position 0x6B104.
length: 4 bytes (yep, that's a LOT of damage potential ^^)
default value: 0xE1 = 225(dec)
If the combined (nominal!) ship+hull strength of the resp. ship is lower than this value, then the ship is destroyed without applying damage calculation.

The second entry is located at position 0x6B1A5.
length: 4 bytes
default value: 0xE1 = 225(dec)
This is the actual damage value. It's only used if the ship's combined ship+hull strength is higher than the value at 0x6B104. If so, then the damage value is first reduced by the ship's shield strength, and then the remaining damage (if any) is applied to the hull strength.


Spocks-cuddly-tribble wrote: Neutron Star Bug (fix)
Gowron wrote:Ships with a combined shield+hull strength of exactly 225 (e.g. Ferengi Light Raider I) will survive with 0 HPs left. (it's the same phenomenon as with orbitals)

Code: Select all

46BD08      jge loc_46BDA4  -> bug should be "jg"
i.e. in trek.exe at 0x6B109 change 8D to 8F
A discovery consists in seeing something everybody has seen and at the same time thinking something nobody has thought yet.

User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 721
Joined: Sun Apr 27, 2008 2:00 am

Re: Trade Routes, Ship Regeneration, Neutron Stars, Black Ho

Post by Spocks-cuddly-tribble » Mon Jul 27, 2009 12:02 pm

Gowron wrote:3. Ship Regeneration

A damaged ship will repair a part of its hull at the very start of each turn. The amount of hit points that are gained depends on the square that the ship occupies.
If the square contains a star system (no matter if friendly or not, no matter if inhabitated or not), then the ship gains an amount of HPs equal to 10% of its maximum hull strength.
If the square does not contain a star system, but there's an outpost or a starbase (no matter if friendly or not), the the ship gains an amount of HPs equal to 5% of its maximum hull strength.
If the square does not contain a star system or an outpost/starbase, then the ship gains an amount of HPs equal to 1% of its maximum hull strength.

These amounts willl always be rounded down (cut at the decimal point), i.e. a ship with a maximum hull strength of less than 100 on an empty square will not be able to regenerate its hull at all, no matter how long it stays there.
Ship Repair is controlled by sub_46B560.

The trek.exe locations of the repair multipliers for: (all stored as 4-byte floats)
  • Star Systems --- 0x6A9A7 (0.1) -/ asm code loc_46B580
  • Space Stations - 0x6AAA3 (0.05) / asm code loc_46B697
  • Standard Repair 0x6AABF (0.01) / asm code loc_46B6B8
The Star System value has the priority, even if it's lower than the Outpost/Starbase value.

Even stations under construction provide repair bonus. :?



The Self-repair multiplier for Space Stations - (8 bytes double precision)

0x17891C (0.05) / asm code loc_46B6C8


NOTE: BotF mistakenly multiplies the current hull points instead of nominal hull! (Star systems are irrelevant here) thus every damage below 20 HPs is for eternity (unmodded).
Last edited by Spocks-cuddly-tribble on Fri Feb 18, 2011 11:36 am, edited 2 times in total.
On the verge of a nervous breakdown? Try the relaxing tribble sounds.

User avatar
Gowron
Code Master
Code Master
Posts: 304
Joined: Sat Apr 26, 2008 2:00 am
Location: 50° N, 11° E

Re: Trade Routes, Ship Regeneration, Neutron Stars, Black Ho

Post by Gowron » Mon Jul 27, 2009 2:51 pm

Spocks-cuddly-tribble wrote:NOTE: BotF mistakenly multiplies the current hull points instead of nominal hull! (Star systems are irrelevant here) thus every damage below 20 HPs is for eternity (unmodded).


This should resolve the problem, in theory... it didn't work. :(

loc_46B6C8:
fild dword ptr [ebx] // ebx=nominal hull
fmul ds: 57AB1C // (self_repair_stations0_05)
fild dword ptr [esi+4Ch] // esi+4Ch=current HPs
Funny bug ^^

The new code didn't work because you loaded the value at address [ebx] into the FPU. Instead, you would need to load ebx itself into the FPU, but AFAIK it's not possible to do such a thing directly.
So more space is needed. Maybe it would be best to use integer arithmetics here.
A discovery consists in seeing something everybody has seen and at the same time thinking something nobody has thought yet.

User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 721
Joined: Sun Apr 27, 2008 2:00 am

Re: Trade Routes, Ship Regeneration, Neutron Stars, Black Ho

Post by Spocks-cuddly-tribble » Mon Jul 27, 2009 8:49 pm

Thanks for the info. I divined its an invalid command and already considered the integer solution, but this is easy enough and more elegant:



Outpost/Starbase self-repair bug (fix)


In trek.exe at 0x6AAC8 replace:

Code: Select all

DB 46 4C D9 C0 DC 0D 1C AB 57 00 DE C1 E8 FA 1F 0B 00 DB 5E 4C 8B 94 24 A8 00 00 00
with:

Code: Select all

DB 84 24 A8 00 00 00 DC 0D 1C AB 57 00 DB 46 4C DE C1 E8 F5 1F 0B 00 DB 5E 4C 89 DA

asm loc_46B6C8:

Code: Select all

fild    dword ptr [esp+0A8h]
fmul    ds:57AB1C
fild    dword ptr [esi+4Ch]
faddp   st(1), st
call    sub_ 51D6D4
fistp   dword ptr [esi+4Ch]
mov     edx, ebx
Last edited by Spocks-cuddly-tribble on Sat Dec 11, 2010 10:11 am, edited 1 time in total.
On the verge of a nervous breakdown? Try the relaxing tribble sounds.

User avatar
Flocke
BORG Trouble Maker
BORG Trouble Maker
Posts: 2540
Joined: Sun Apr 27, 2008 2:00 am
Location: Hamburg, Germany
Contact:

Re: Trade Routes, Ship Regeneration, Neutron Stars, Black Ho

Post by Flocke » Tue Jul 28, 2009 3:44 am

ahh, great solution! fits just in to the place :D

Gowron wrote:Funny bug ^^
seconded! Although I didn't ever realize starbases having a self repair at all :lol:

User avatar
Gowron
Code Master
Code Master
Posts: 304
Joined: Sat Apr 26, 2008 2:00 am
Location: 50° N, 11° E

Post by Gowron » Thu Jul 30, 2009 11:52 am

Very good solution :)

Since edx and ebx are used for the same value, we could even skip the
"mov edx, ebx"
instruction and replace edx by ebx in the statement at position 46B6F9. This would free up another 2 bytes :)
A discovery consists in seeing something everybody has seen and at the same time thinking something nobody has thought yet.

User avatar
Spocks-cuddly-tribble
Code Master
Code Master
Posts: 721
Joined: Sun Apr 27, 2008 2:00 am

Ship Repair - Ally & Shipyard Bug-fix

Post by Spocks-cuddly-tribble » Fri Feb 18, 2011 6:34 am

Gowron wrote:3. Ship Regeneration

...star system (no matter if friendly or not, no matter if inhabitated or not), ...outpost or a starbase (no matter if friendly or not),...
Some broken/unfinished code at that area corrupts the whole concept of ship repair, culminating in the providing of the enemies shipyards during system attacks:
Gowron wrote:...you'll find out that your ships will seem to take a little less damage than they "should". This is due to the fact that orbital combat takes place in-between turns, and the surviving ships will instantly regenerate HPs equal to 10% of their nominal hull strength.
=> Pop Support, Ground Combat, Orbital Batteries, Credit Output



Replacing the flawed code sequences - using the info on the sector.lst file - we can implement an ally check, plus a shipyard check for star systems, to restore the full tactical implications of ship repair in accordance with the game manual. :)



Ship Repair - Ally & Shipyard Bug-fix

Code: Select all

1.) trek.exe at 0x6A954
replace: (87 bytes)
00 00 00 00 00 00 00 00 00 00 00 00 53 51 52 56 57 55 81 EC 34 01 00 00 A1 54 23 5B 00 E8 2A F1 0A 00 89 C5 85 C0 0F 84 B9 00 00 00 8D 45 38 E8 28 25 FD FF 89 C2 89 E8 E8 47 D0 FD FF 8B 42 0A C1 F8 10 83 F8 FF 0F 84 F7 00 00 00 C7 84 24 2C 01 00 00 CD CC CC 3D
with:
53 51 52 56 57 55 81 EC 34 01 00 00 A1 54 23 5B 00 E8 36 F1 0A 00 8B E8 85 C0 0F 84 C5 00 00 00 8D 45 38 E8 34 25 FD FF 8B C8 33 C0 8B 54 81 10 83 FA FF 75 06 04 01 3C 06 75 F1 8B 45 34 E8 D9 49 FC FF 85 C0 0F 85 F8 00 00 00 B9 0A D7 23 3C 89 8C 24 2C 01 00 00

2.) at 0x6AA35 change 47 to -> 3B

3.) at 0x6AA97
replace: (46 bytes)
8B 42 06 C1 F8 10 83 F8 FF 74 16 B9 CD CC 4C 3D E8 04 F9 FD FF 89 8C 24 2C 01 00 00 E9 F3 FE FF FF C7 84 24 2C 01 00 00 0A D7 23 3C E9 E3
with:
0F BF 41 0C 83 F8 FF 74 13 E8 9B 96 FD FF 85 C0 74 0A B9 CD CC CC 3D E9 F1 FE FF FF 66 83 79 08 FF 0F 84 E1 FE FF FF B9 CD CC 4C 3D E9 DC

4.) at 0x6AE23 change 39 to -> 2D


46B554     53                PUSH EBX
46B555     51                PUSH ECX
46B556     52                PUSH EDX
46B557     56                PUSH ESI
46B558     57                PUSH EDI
46B559     55                PUSH EBP
46B55A     81EC 34010000     SUB ESP, 134
46B560     A1 54235B00       MOV EAX, DS:[5B2354] //GTForceHd[+20=GTForceList]
46B565     E8 36F10A00       CALL 51A6A0 (load first taskforce enty)
46B56A     8BE8              MOV EBP, EAX  // GTForceList entry
46B56C     85C0              TEST EAX, EAX // if no TaskForces in game...
46B56E     0F84 C5000000     JE 46B639 // ...goto self repair stations
46B574     8D45 38           LEA EAX, [EBP+38]  // sector row & [+4 column] 
46B577     E8 3425FDFF       CALL 43DAB0 (load sector.lst entry)
46B57C     8BC8              MOV ECX, EAX  // sector.lst entry
46B57E     33C0              XOR EAX, EAX  // index for loop
46B580     8B5481 10         MOV EDX, [ECX+EAX*4+10] // start loop
46B584     83FA FF           CMP EDX, -1   // sector owner ?
46B587     75 06             JNZ SHORT 46B58F  // exit loop if race ID
46B589     04 01             ADD AL, 1
46B58B     3C 06             CMP AL, 6
46B58D    ^75 F1             JNZ SHORT 46B580  // goto start loop
46B58F     8B45 34           MOV EAX, [EBP+34] // taskforce owner ID
46B592     E8 D949FCFF       CALL 42FF70 (Ally check)
46B597     85C0              TEST EAX, EAX
46B599     0F85 F8000000     JNZ 46B697  // if own/ally goto yard/station check
46B59F     B9 0AD7233C       MOV ECX, 3C23D70A  // standard repair 0.01
46B5A4     898C24 2C010000   MOV [ESP+12C], ECX  // store repair value

46B633    ^0F85 3BFFFFFF     JNZ 46B574 // goto next taskforce

46B697     0FBF41 0C         MOVSX EAX, WORD [ECX+C]   // star system check
46B69B     83F8 FF           CMP EAX, -1
46B69E     74 13             JE SHORT 46B6B3   // if no star system goto station check
46B6A0     E8 9B96FDFF       CALL 444D40  (ship yard check)
46B6A5     85C0              TEST EAX, EAX
46B6A7     74 0A             JE SHORT 46B6B3   // if no yard goto station check
46B6A9     B9 CDCCCC3D       MOV ECX, 3DCCCCCD  // shipyard repair 0.1
46B6AE    ^E9 F1FEFFFF       JMP 46B5A4  // goto store repair value
46B6B3     66:8379 08 FF     CMP WORD [ECX+8], -1 // station check
46B6B8    ^0F84 E1FEFFFF     JE 46B59F    // if no station goto standard repair
46B6BE     B9 CDCC4C3D       MOV ECX, 3D4CCCCD  // station repair 0.05
46B6C3    ^E9 DCFEFFFF       JMP 46B5A4   // goto store repair value

46BA22     E8 2DFBFFFF       CALL 46B554 (Ship/Station Repair)
Note the locations of all three repair multipliers for ships have been changed now!

Also there're still two minor flaws: no checks for unpowered shipyards & uncompleted stations.
On the verge of a nervous breakdown? Try the relaxing tribble sounds.

User avatar
Axis
Lieutenant-Commander
Lieutenant-Commander
Posts: 142
Joined: Sun Aug 16, 2015 8:28 am

Re: Trade Routes, Ship Regeneration, Neutron Stars, Black Holes

Post by Axis » Thu Aug 20, 2015 11:16 am

Here`s just to clarify things a little :

Trade Routes population requirements

Race: Dec value / Hex value [Botf assembler] (Hex address)
Cardassians: 160 /A0 00 00 00 [58fc44] (0x0018DA44)
Federation:  150 /96 00 00 00 [58fc48] (0x0018DA48)
Ferengi:      125 / 7D 00 00 00 [58fc4c] (0x0018DA4C)
Klingons:    185 / B9 00 00 00 [58fc50] (0x0018DA50)
Romulans:    175 / AF 00 00 00 [58fc54] (0x0018DA54)

Races and values etc. in that order (as they always are).

Because this was a little cryptic at first:

Location of the trade route thresholds in trek.exe, by JOKER:
Joker wrote:pos dec 1628740
int

I had to find and change those values because I raised the planet populations so much,
now I have Cardassians 525, Federation 500, Ferengi 475, Klingons 575 and Romulans 550!

User avatar
EnPhreg
Lieutenant-Commander
Lieutenant-Commander
Posts: 130
Joined: Thu Jul 10, 2008 2:00 am

Re: Trade Routes, Ship Regeneration, Neutron Stars, Black Holes

Post by EnPhreg » Thu Jul 21, 2016 1:10 pm

Also there're still two minor flaws: no checks for unpowered shipyards & uncompleted stations.
addition to the unfinished-station-bug: tested it with ecm 4.0, the unfinished station gives only repair value when it's build in a sector with a star-system.

Kurn
Lieutenant-Junior Grade
Lieutenant-Junior Grade
Posts: 60
Joined: Thu Aug 12, 2010 2:00 am
Location: Germany

Re: Ship Repair - Ally & Shipyard Bug-fix

Post by Kurn » Sun Mar 26, 2017 11:39 am

Spocks-cuddly-tribble wrote: Ship Repair - Ally & Shipyard Bug-fix

Code: Select all

1.) trek.exe at 0x6A954
replace: (87 bytes)
00 00 00 00 00 00 00 00 00 00 00 00 53 51 52 56 57 55 81 EC 34 01 00 00 A1 54 23 5B 00 E8 2A F1 0A 00 89 C5 85 C0 0F 84 B9 00 00 00 8D 45 38 E8 28 25 FD FF 89 C2 89 E8 E8 47 D0 FD FF 8B 42 0A C1 F8 10 83 F8 FF 0F 84 F7 00 00 00 C7 84 24 2C 01 00 00 CD CC CC 3D
with:
53 51 52 56 57 55 81 EC 34 01 00 00 A1 54 23 5B 00 E8 36 F1 0A 00 8B E8 85 C0 0F 84 C5 00 00 00 8D 45 38 E8 34 25 FD FF 8B C8 33 C0 8B 54 81 10 83 FA FF 75 06 04 01 3C 06 75 F1 8B 45 34 E8 D9 49 FC FF 85 C0 0F 85 F8 00 00 00 B9 0A D7 23 3C 89 8C 24 2C 01 00 00

2.) at 0x6AA35 change 47 to -> 3B

3.) at 0x6AA97
replace: (46 bytes)
8B 42 06 C1 F8 10 83 F8 FF 74 16 B9 CD CC 4C 3D E8 04 F9 FD FF 89 8C 24 2C 01 00 00 E9 F3 FE FF FF C7 84 24 2C 01 00 00 0A D7 23 3C E9 E3
with:
0F BF 41 0C 83 F8 FF 74 13 E8 9B 96 FD FF 85 C0 74 0A B9 CD CC CC 3D E9 F1 FE FF FF 66 83 79 08 FF 0F 84 E1 FE FF FF B9 CD CC 4C 3D E9 DC

4.) at 0x6AE23 change 39 to -> 2D


46B554     53                PUSH EBX
46B555     51                PUSH ECX
46B556     52                PUSH EDX
46B557     56                PUSH ESI
46B558     57                PUSH EDI
46B559     55                PUSH EBP
46B55A     81EC 34010000     SUB ESP, 134
46B560     A1 54235B00       MOV EAX, DS:[5B2354] //GTForceHd[+20=GTForceList]
46B565     E8 36F10A00       CALL 51A6A0 (load first taskforce enty)
46B56A     8BE8              MOV EBP, EAX  // GTForceList entry
46B56C     85C0              TEST EAX, EAX // if no TaskForces in game...
46B56E     0F84 C5000000     JE 46B639 // ...goto self repair stations
46B574     8D45 38           LEA EAX, [EBP+38]  // sector row & [+4 column] 
46B577     E8 3425FDFF       CALL 43DAB0 (load sector.lst entry)
46B57C     8BC8              MOV ECX, EAX  // sector.lst entry
46B57E     33C0              XOR EAX, EAX  // index for loop
46B580     8B5481 10         MOV EDX, [ECX+EAX*4+10] // start loop
46B584     83FA FF           CMP EDX, -1   // sector owner ?
46B587     75 06             JNZ SHORT 46B58F  // exit loop if race ID
46B589     04 01             ADD AL, 1
46B58B     3C 06             CMP AL, 6
46B58D    ^75 F1             JNZ SHORT 46B580  // goto start loop
46B58F     8B45 34           MOV EAX, [EBP+34] // taskforce owner ID
46B592     E8 D949FCFF       CALL 42FF70 (Ally check)
46B597     85C0              TEST EAX, EAX
46B599     0F85 F8000000     JNZ 46B697  // if own/ally goto yard/station check
46B59F     B9 0AD7233C       MOV ECX, 3C23D70A  // standard repair 0.01
46B5A4     898C24 2C010000   MOV [ESP+12C], ECX  // store repair value

46B633    ^0F85 3BFFFFFF     JNZ 46B574 // goto next taskforce

46B697     0FBF41 0C         MOVSX EAX, WORD [ECX+C]   // star system check
46B69B     83F8 FF           CMP EAX, -1
46B69E     74 13             JE SHORT 46B6B3   // if no star system goto station check
46B6A0     E8 9B96FDFF       CALL 444D40  (ship yard check)
46B6A5     85C0              TEST EAX, EAX
46B6A7     74 0A             JE SHORT 46B6B3   // if no yard goto station check
46B6A9     B9 CDCCCC3D       MOV ECX, 3DCCCCCD  // shipyard repair 0.1
46B6AE    ^E9 F1FEFFFF       JMP 46B5A4  // goto store repair value
46B6B3     66:8379 08 FF     CMP WORD [ECX+8], -1 // station check
46B6B8    ^0F84 E1FEFFFF     JE 46B59F    // if no station goto standard repair
46B6BE     B9 CDCC4C3D       MOV ECX, 3D4CCCCD  // station repair 0.05
46B6C3    ^E9 DCFEFFFF       JMP 46B5A4   // goto store repair value

46BA22     E8 2DFBFFFF       CALL 46B554 (Ship/Station Repair)
Note the locations of all three repair multipliers for ships have been changed now!
where are the positions now?

I would like to change the repair values of starbases and star systems.
my personal mod is based on the ECM2, so the "Ship Repair - Ally & Shipyard Bug-fix" was done. which codes have I to edit?

User avatar
thunderchero
Site Administrator aka Fleet Admiral
Site  Administrator aka Fleet Admiral
Posts: 6043
Joined: Fri Apr 25, 2008 2:00 am
Location: On a three month training mission, in command of the USS Valiant.
Contact:

Re: Trade Routes, Ship Regeneration, Neutron Stars, Black Holes

Post by thunderchero » Sun Mar 26, 2017 12:20 pm

Kurn wrote:ECM2
:shock: :shock: :shock: :shock:

no idea, that is so old I don't even have a copy of that any more.

Kurn
Lieutenant-Junior Grade
Lieutenant-Junior Grade
Posts: 60
Joined: Thu Aug 12, 2010 2:00 am
Location: Germany

Re: Trade Routes, Ship Regeneration, Neutron Stars, Black Holes

Post by Kurn » Sun Mar 26, 2017 2:55 pm

found it.

shipyard repair 0.1 is at 0x6aaa9
station repair 0.05 is at 0x6aabe

I finally starting to understand how to use all these numbers. :smile:
thunderchero wrote:
Kurn wrote:ECM2
:shock: :shock: :shock: :shock:

no idea, that is so old I don't even have a copy of that any more.
I guess ECM2/ECML2 was first downloadable in 2011, when I started to edit with UE.

Kurn
Lieutenant-Junior Grade
Lieutenant-Junior Grade
Posts: 60
Joined: Thu Aug 12, 2010 2:00 am
Location: Germany

Re: Trade Routes, Ship Regeneration, Neutron Stars, Black Ho

Post by Kurn » Thu Mar 14, 2019 7:11 am

Spocks-cuddly-tribble wrote:
Mon Jul 27, 2009 8:49 pm

Outpost/Starbase self-repair bug (fix)
Originally outposts shouldn't be able to repair ships, only starbases and shipyards should have this ability. Is there a code to disable the ability for outposts?

Post Reply

Return to “Trade Routes, Ship Regeneration, Neutron Stars, Black Holes”

Who is online

Users browsing this forum: No registered users