Page 1 of 1

Ship Removal Subroutine

Posted: Sat Jun 13, 2009 11:23 am
by Gowron
At position 4491D0 there's a subroutine which removes a ship from the game. It's used for various instances of destruction or consumption of ships.

It is NOT used for ships which are destroyed as a result of battle, scrapped, destroyed by an intel attack or annihilated because of entering a one-way wormhole.


Subroutine 4491D0 is called from eight locations, depending on the cause of the ship removal:
  • 45E019: unknown.
  • 46828F: removal of 1 troop transport from a task force after a succesful invasion. Also used for removal of all troop transports from a task force after a failed invasion attempt. The ship role "troop transport" (0x09) is stored at position 46827F and can be changed to affect a different ship role instead. If no ship with the respective role is present, then no ship is removed.
  • 4686BF: destruction by orbital battery fire. Removing this call makes OBs unable to destroy any ships.
  • 468774: unknown.
  • 468D0F: removal of 1 troop transport from a task force after the completion of an outpost or a starbase. At position 468C55 the role "troop transport" is stored to determine which kind of ship can add production points to outpost/starbase construction.
  • 469CD2: removal of 1 colony ship from a task force when colonising a system.
  • 46BD1D: destruction by a neutron star.
  • 46BF3A: destruction by a black hole.
There's also a switch table which seems to determine the likelihood of a ship with a certain role being destroyed by a black hole. The switch table starts at position 46BDE0, and the values read as follows:

Code: Select all

value(dec)   ship_role
    95          0x00   // scout
    80          0x01   // destroyer
    15          0x02   // cruiser
    10          0x03   // artillery
     5          0x04   // battleship
    50          0x05   // colony ship
    70          0x09   // troop transport
Remember that only ships with a speed of 1 can be destroyed by black holes.

Posted: Sat Jun 13, 2009 12:43 pm
by stardust
45E019 , 468774

Could either of these values be responsible for the destruction or theft of a ship via sabotage?

Just an idea.

Posted: Sun Jun 14, 2009 1:50 am
by DCER
And the other one could be destruction by a one way wormhole.

Nice find, Gowron!

Posted: Sun Jun 14, 2009 2:24 am
by stardust
Ah, Gowron's pointed out at the top of his post that he's ruled out both the Intel and the one way wormhole already :oops: