post-kerbin-mining-corporation / NearFuturePropulsion

Adds advanced electric propulsion systems to Kerbal Space Program
35 stars 30 forks source link

VASIMR engines remember their Power Level, but not their thrust or fuel flow rate #2

Closed jgottula closed 9 years ago

jgottula commented 10 years ago

Suppose you build a craft with a VASIMR engine in the VAB and set the Power Level tweakable to 50%. Then you launch the vehicle. When you activate the engine, the Power Level will be at 50%, as you left it, but the dynamically calculated thrust and fuel-flow values will be as if the Power Level was set to 0%. However, if you then modify the Power Level at flight time, the thrust and fuel-flow will correct themselves. (i.e. change to 55% and then back to 50%, and then the values are as they should be for 50%.)

The fix for this might be to make VariableIspEngine.CurIsp and/or VariableIspEngine.CurThrust persistent. Alternatively, it could just be that the VariableIspEngine code misses some step when initializing at flight time where it should be adjusting values based on VariableIspEngine.CurThrustSetting but isn't.


I wanted to write and test a patch myself, but for some reason, when I use the NearFuturePropulsion.dll that I compiled, I get a bunch of FormatException errors at runtime, complaining about "S2" not being a valid format string (and these exceptions make it so the right-click menu on the engine won't come up at flight time). So it sounds like KSPAPIExtensions isn't enabling its fancy string formatting things for some reason, but only when I build the project. I have no idea why that would be; so for the time being, it looks like I can't really test fixes for this.

ChrisAdderley commented 10 years ago

Will look into this.

ChrisAdderley commented 10 years ago

Actually, cannot seem to repro this. Went into the VAB, put an engine on a tank, set the power level to 50%, launched, reported Isp and thrust seem to update correctly once the engine is activated. This is confirmed via the module's UI fields and KER's output.

This is with a newly-built version and KSP 0.25.

jgottula commented 10 years ago

Okay. This was with NFP 0.2.3 on KSP 0.24.2. I'll have another look and see if the problem fixed itself.