Knuckle Cracker

Knuckle Cracker => Support => Topic started by: TECHNO 1 on July 25, 2017, 10:56:41 AM

Title: (BUG) Reactors ignore disabled energy tanks
Post by: TECHNO 1 on July 25, 2017, 10:56:41 AM
(Unnecessary bit) How i found the problem
When i was trying to find the EXACT power generated by the Reactor module, i decided i would do this
1 - Go to the Mission editor and make a new map, then enter that map
2 - Make 2 ships with energy tanks, give 1 ship a reactor and the other an energy mine with 1.495 energy production
3 - Get the ship with energy mine down to 50 energy (by damaging it) and turn off its tanks, wait for other ship to get to 50 energy aswell
4 - They should increase at the same rate
And that's how this bug was discovered

The glitch
It's simple, even if a ship has energy tanks disabled, reactors still generate power. Not too much of a problem because who turns off energy tanks, but still, it's there.
Title: Re: (BUG) Reactors ignore disabled energy tanks
Post by: Keeper Decagon on July 25, 2017, 11:25:51 AM
I guess this goes hand in hand with the fact that disabled energy tanks can still expend energy to power the ship. I would say, to regard an energy tank "disabled" is to regard it "cut off from energy mines", yet within the ship it still functions normally.
Title: Re: (BUG) Reactors ignore disabled energy tanks
Post by: Dark Ambition on July 25, 2017, 12:20:30 PM
Perhaps it would be best with two settings. I often turn off my energy tanks to stop them from receiving energy, but if they still have energy in them (and are on a ship with a relay) i use it to give what's left to other ships so as to not dig myself into more of an energy problem.

One setting to cut off from energy mines, but still function normally.
One setting to completely turn it off.
Title: Re: (BUG) Reactors ignore disabled energy tanks
Post by: TECHNO 1 on July 25, 2017, 12:28:01 PM
Quote from: Dark Ambition on July 25, 2017, 12:20:30 PM
Perhaps it would be best with two settings. I often turn off my energy tanks to stop them from receiving energy, but if they still have energy in them (and are on a ship with a relay) i use it to give what's left to other ships so as to not dig myself into more of an energy problem.

One setting to cut off from energy mines, but still function normally.
One setting to completely turn it off.
That's actually a pretty good idea, but i wish there was an option to turn off energy from mines, even if there is no energy tanks
Title: Re: (BUG) Reactors ignore disabled energy tanks
Post by: GoodMorning on July 25, 2017, 06:13:02 PM
As far as I can tell, this is intended behaviour.

Turning off tanks prevents the ship from requesting energy to fill them. There is no vanilla case in which having more energy is bad, however, so the free energy from reactors is continually applied.

ship.energy += CONST_REACTORAMOUNT*reactors; //1.5eps, give or take rounding.
ship.energy = min(ship.energy, ship.energycap);

A ship-wide disconnect or "charge" and "fixed" modes for tanks would be nice, but it would complicate the request algorithm and UI further. Unlikely to happen.

Essentially, tanks just raise the cap for energy that can be stored in the ship. A lot. Turning them off just stops the ship from requesting external power.

For a more genuine bug, reactors seem to start operating before they are entirely built. Whether or not at reduced efficiency, I can't tell. But the "hull building" effect plays constantly when a ship with only a reactor module ghost and a CM (plus the aforementioned unbuilt hull) sits without a packet supply, and the ship eventually completes.