Retracting solar panels causes electric charge to drain.
TheDirtyRag opened this issue ยท 4 comments
Steps to reproduce:
-
Using the latest released version of KSPIE, simply build a craft that contains any retractable solar panel.
-
Extend solar panel, then retract the solar panel.
-
Electric charge should be draining at rate nearly equal to the stock charging rate. The Megajoules power management window will report a value that should be 1000x the value of the max power supply of the solar panel. Extending the solar panel will reduce this 0 gradually, but doesn't use any power. Timewarping causes the power requested to divided by the timewarp factor.
-
If a solar panel has no means to generating electric charge (due to nightfall, obstruction, but not destruction), then it can be retracted without any power being requested. Futhermore, destroyed panels still cause power to be requested.
Investigation.
My first initial thought was a radiator causing power drain, this was quickly removed from consideration due to the fact that even the smallest retractable solar-panels cause this bug. Removing the Solar-Panel.cfg from the patches folder does stop the solar panels from requesting power, indicating that there may be something to due to with their modules.
My second guess was that the surface area that the resource-manger would use to calculate effective solar power, somehow turns negative during the retraction instead of turning to zero. On a glance of the plugin, I wasn't able to find anything that would directly cause solar-panels to exhibit the bug's behavior.
My third option would be to restore the resource manager before this bug was reported and test to see if this would solve the problem.
Alright, I figured the problem is caused by some stock issue where outputResource.currentRequest isn't reset to 0 after it get retracted. I added an additional check which compensates. I fixed it with 6f77dcd
Addendum: It seems I was missing PatchManager, I and I have switch the module manager packaged with this repository 4.0.3. I have eliminated PhotonSalior as possible explanation as it was not in my gamedata folder.
Upon more testing, it seems to a pseudo-capacitor like function. The power-draw increases while the solar panel is retracted, now well passing the 1000x max power. Time-warp slightly affects the increase in the draw and was able to reach around 40 MWs from a single gigantor solar panel. What is more interesting is that Megajoules are now being "properly" used up for this energy draw, but electric charge is still not used.
Perhaps a module is linked up to a capcitator function and is being hooked on to the part, so when retracting there is an power draw being called. I will have to further examine this.
Using the latest repository version, the power draw still occurs. I will try to build the plugin, but I am currently running into errors with tweakscale preventing from building the main plugin.
EDIT: Silly me, forgot to add Tweakscale as a reference.