Working support for non-traditional engines
Darinth opened this issue ยท 1 comments
The most recent part of a mod that I'm working on is called an inertial shunt. For the most part it functions as a space-magic tractor beam that follows newton's laws. In one of it's modes of operation, it basically functions as a traditional engine, pushing/pulling off of other vessels or the surface of a celestial body. The problem is that because it runs on massless propellant, it can't actually be modeled (as far as I'm aware) on moduleEngines or I'd probably just dynamically add/remove a moduleEngines module as needed.
Fuel flow simulation which, as far as I can tell looking through the code here, is responsible for calculating a craft's maximum thrust via the fuelnodes does so be looking for moduleengines. Is there anything that I can do to get mechjeb to at least recognize the thrust capabilities of the shunt in order to be able to execute manuever nodes properly? Due to how the fuel calculations work (falling off after a certain distance from something it can transfer momentum to) I've probably got no hope of ever getting mechjeb to recognize it's delta-V in any meaningful way, but even just maneuver node execution would be a huge benefit.
I'm going to close this one as a "probably not gonna happen" rather than a "no". If you sorted out what needed to happen in FuelFlowSimulation and submitted a patch that'd probably be okay. There's a bunch more pressing issues with FuelFlowSimulation though (I'd like to just see RCS fuel, and to better map onto logical stages rather than KSP stages and support events like centercore engine throttle down, etc). I think we still have some triple-fuel/non-ISP fuel effects going on as well, and the code in there is mildly terrifying. Plus I just can't think of what to do in order to solve this problem, particularly if you have any kind of non-constant thrust curve. If you have a constant thrust you might be able to fake out a constant thrust moduleEngine with infinite ISP for the massless propellant. Then it would just be a matter of fixing up NaN + Infinity issues in the FuelFlowSimulation.