searching for something else, I stumbled about some code in playerentity.m which makes me worry that the cloaking device is being used as an energy unit if it's disabled:
if ([self hasCloakingDevice])
{
if (cloaking_device_active)
{
energy -= (float)delta_t * CLOAKING_DEVICE_ENERGY_RATE;
if (energy < CLOAKING_DEVICE_MIN_ENERGY)
[self deactivateCloakingDevice];
}
else
{
if (energy < maxEnergy)
{
energy += (float)delta_t * CLOAKING_DEVICE_ENERGY_RATE;
if (energy > maxEnergy)
energy = maxEnergy;
}
}
}
Why does the disabled cloak add CLOACKING_DEVICE_ENERGY_RATE to the energy? I believe that's a big bug and that the else clause should simply be cut out of the code?!?
Screet, still on the look for the annoying "BANG, you're dead" bug...
29 reads and no comments...does this mean that you all prefer the cloak to work as an extra energy unit???
The code does define
#define CLOAKING_DEVICE_ENERGY_RATE 12.8f
Thus the cloak, when inactive, adds 12.8 to the energy each time the energy is updated! That's much more than a good ship with naval energy unit does get on each update!
It is the same code that has been there since 1.65. For this reason, and although I personally agree that it should be changed as Screet mentions, I think a little bit more investigation is required to try and see if there was a particular reason behind this.
It is the same code that has been there since 1.65. For this reason, and although I personally agree that it should be changed as Screet mentions, I think a little bit more investigation is required to try and see if there was a particular reason behind this.
My only guess would be that the idea behind this is to give NPCs an extremely higher recharge if they have the cloak so that they would not be too easy to shoot down once the cloak uses up all their energy.
Probably a copy&paste mistake from NPC to player...
I have commented out in the trunk (but not deleted yet) the code that charges up the energy banks upon switching the device off. If anyone can provide a reason why this behaviour should remain, please do so and we can bring it back.
Anyone know what happened in elite? maybe its just an oddity from the original?
I don't really remember, but I am pretty sure that I first saw the ultra-rapid recharging of energy banks in Oolite.
With the old behaviour of the cloak working as an energy unit, completely depleted banks did reload so quickly that it was almost no time delay to re-enable the cloak from full banks again...I'm sure that the modification of removing the energy unit behaviour for player ships is good and won't harm the game as it stays as an energy unit for NPCs. Still NPCs would benefit from the addition of shields...as then they could deplete their banks without losing all defensive ability.