KSP Interstellar Extended

KSP Interstellar Extended

1M Downloads

Engines do not connect properly to reactors.

vdubikhin opened this issue ยท 3 comments

commented

In crafts with multiple reactors/thermal nozzles engines do not properly connect to reactors and request power from multiple sources, but consume power only from one of them. This leads to overconsumption of reactor fuel and craft overheating.

Example craft consists of two AM reactors with thermal turbojets.

  1. Only rear engine is working. All power produced by the reactor is consumed by the engine.
    https://imgur.com/0PKtwzt
  2. Only bottom engine is working. Both reactors are producing power, but engine consumes power only from one of them.
    https://imgur.com/PJTzyrk
  3. Both engines are turned on. One of the reactors produces power, requested by both engines, while the other only produces power for one of the engines. Engines consume power only from the first reactor.
    https://imgur.com/49pagy8
  4. Only one AM reactor is present with two nozzles. Power from the reactor is fully consumed in any configuration: only rear engine, only bottom engine or both engines.
    https://imgur.com/yS9JGnK
commented

I need input on this matter, as there are multiple ways to fix this:

  1. Should one engine connect to multiple reactors?
  2. Should one reactor supply multiple engines?
  3. What should happen in systems with multiple engines and reactors? Should engines be equally distributed between reactors or all reactors can power all engines?
commented

I have a rough understanding of what is causing the problem.

When bottom engine is on and rear engine is off:

  1. Engine requests power.
  2. ResourceManager logs resource demand.
  3. Rear reactor first asks attached engine if it needs power(getNeededPowerSupplyPerSecondWithMinimumRatio). Rear engine is not working so power demand is 0. Reactor then asks RM if any power needs to be supplied(managedProvidedPowerSupplyPerSecondMinimumRatio). RM tells the reactor that there is resource demand from bottom engine. Reactor starts producing power, however, it can not be consumed by the bottom engine as it is not connected to the reactor.
  4. Bottom reactor does the same, but this time its power can be consumed by the bottom engine.

If bottom engine is off and rear engine is on:

  1. Engine requests power.
  2. ResourceManager logs resource demand.
  3. Rear reactor receives the same power request from the engine and the RM and fulfills it.
  4. Bottom reactor does not get power request from the engine and global power demand has been fulfilled by the rear reactor. So, RM(GetCurrentUnfilledResourceDemand) reports no power demand.

So this whole issue is related not to engines not connecting properly to reactors, but RM telling reactor about power demand, when it can not fulfill it, because it requires physical connection to the part. I do not know how to fix it without breaking everything apart. Ideas?

commented

First let me answer your questions:
1 No an engine can only connect to a single reactor
2 A reactor can provide power to multiple engines, which can turned off and vary in trust level
3 Engines should always connect to the nearest reactor, following deterministic path finding rules