MuMech / MechJeb2

MechJeb2 - KSP mod
Other
1k stars 251 forks source link

"FuelFlowSimulation hit max steps" exception spam, disabling Delta-V stats and hence many other functions #1905

Open manygoatsmessi opened 2 months ago

manygoatsmessi commented 2 months ago

With the most recent dev version on KSP 1.12.5 and RSS/RO, it appears that certain parts cause the following exception to be spammed in the log, causing the "Delta-V stats" window to display no data (see images at bottom), and subsequently rendering other MJ functions such as Ascent Guidance (I'm using PVG) to not work.

[LOG 18:38:12.421] [MechJeb2] Exception in MechJebLib.FuelFlowSimulation.FuelFlowSimulation: System.AggregateException: One or more errors occurred. ---> System.Exception: FuelFlowSimulation hit max steps of 100 steps
  at MechJebLib.FuelFlowSimulation.FuelFlowSimulation.SimulateStage (MechJebLib.FuelFlowSimulation.SimVessel vessel) [0x000f9] in <8c9de4af76304acf8c814262478f6f55>:0 
  at MechJebLib.FuelFlowSimulation.FuelFlowSimulation.Run (System.Object o) [0x00043] in <8c9de4af76304acf8c814262478f6f55>:0 
  at System.Threading.Tasks.Task`1[TResult].InnerInvoke () [0x0002b] in <9577ac7a62ef43179789031239ba8798>:0 
  at System.Threading.Tasks.Task.Execute () [0x00010] in <9577ac7a62ef43179789031239ba8798>:0 
   --- End of inner exception stack trace ---
---> (Inner Exception #0) System.Exception: FuelFlowSimulation hit max steps of 100 steps
  at MechJebLib.FuelFlowSimulation.FuelFlowSimulation.SimulateStage (MechJebLib.FuelFlowSimulation.SimVessel vessel) [0x000f9] in <8c9de4af76304acf8c814262478f6f55>:0 
  at MechJebLib.FuelFlowSimulation.FuelFlowSimulation.Run (System.Object o) [0x00043] in <8c9de4af76304acf8c814262478f6f55>:0 
  at System.Threading.Tasks.Task`1[TResult].InnerInvoke () [0x0002b] in <9577ac7a62ef43179789031239ba8798>:0 
  at System.Threading.Tasks.Task.Execute () [0x00010] in <9577ac7a62ef43179789031239ba8798>:0 <---

As I stated on the MJ forum, I have seen this occur with specifically the Artemis Construction Kit's auxiliary thrusters. The issue also occurs with BDB's Saturn V, although I have not attempted to find the exact part responsible in that case. It seems that several others have experienced the same issue:

https://forum.kerbalspaceprogram.com/topic/154834-112x-anatid-robotics-mumech-mechjeb-autopilot-2143-4th-march-2023/?do=findComment&comment=4412925 https://forum.kerbalspaceprogram.com/topic/154834-112x-anatid-robotics-mumech-mechjeb-autopilot-2143-4th-march-2023/?do=findComment&comment=4421610 https://forum.kerbalspaceprogram.com/topic/154834-112x-anatid-robotics-mumech-mechjeb-autopilot-2143-4th-march-2023/?do=findComment&comment=4421630 [https://forum.kerbalspaceprogram.com/topic/154834-112x-anatid-robotics-mumech-mechjeb-autopilot-2143-4th-march-2023/?do=findComment&comment=4421864](https://forum.kerbalspaceprogram.com/topic/154834-112x-anatid-robotics-mumech-mechjeb-autopilot-2143-4th-march-2023/?do=findComment&comment=4421864 (this was my own post))

According to the first of the above posts, the dev release #1253 is the last release that did not have this issue (assuming that it is the same issue, of course), reverting to that version did fix it for me, although I haven't tested any other versions yet.

Additionally, on the RSS/RO discord this problem has been reported previously (this was after the #1253 release), and was said to have been fixed (here: https://github.com/MuMech/MechJeb2/pull/1742), however, this is evidently not the case.

IMAGES (not much to see, except the console and empty delta-v stats readout) mechjebissue mechjebissuefull

JacobB094 commented 1 month ago

I have this happening reliably when merging any BDB rocket, or part of one, into another .craft file. It doesn't seem to be tied to any specific part in such case. There is definitely something wrong with the dV simulation.

For the record, the release version doesn't have this problem, I can merge just fine.

JacobB094 commented 1 month ago

Additional info: I found that the Centaur Engine Mounting Plate from BDB causes the issue, but weirdly, not on its own. If a decoupler with staging enabled is attached to it, the bug is triggered. When staging is disabled, the bug goes away. With the mounting plate removed, the bug no longer triggers. The part in question is inside a SAF fairing, which might be affecting it (I'll check that later and let you know).

lamont-granquist commented 1 month ago

Can you drop a minimal craft file in a gist or something similar? I'm quite busy right now (and I was out of the country and largely AFK for about a month).

JacobB094 commented 1 month ago

MJ Test Case.craft.txt Here you go. This should show the bug when loaded, but if you make certain modifications (remove the fairing, disable decoupler staging, remove the engine mount), it'll work again. 100% reliable on my end. Quite a few other mods installed, but none that should mess with fuel flow.