Jump to content

Rework Intake Air logic


Recommended Posts

Inspired by Kasuha's analysis of intake air in his Fuel Flow thread and the discussion here, I suggest that the way intake air is calculated and allocated should be reworked.

Currently, the order in which intakes and air-breathing engines are placed when constructing a craft has a large effect on how the engines receive intake air. That means that two craft with the same parts in the same locations can behave very differently depending on how they were built.

Furthermore, the current behavior makes the use of symmetry in craft construction less useful. Air-breathing engines should never be placed by themselves using symmetry, because the intake air supply to each will be very different.

The way it works now is a bit counterintuitive and non-obvious, and it complicates both construction of air-breathing ships and troubleshooting asymmetric flameout problems.

So my suggestion is that rather than calculating intake air production and consumption part by part based on the order in the .craft description, instead calculate the sum of intake air produced and divide it among all the active air-breathing engines. Perhaps allocated in proportion to each engine's requirements (this would accomodate different types of engines or engines with output restricted via tweakables).

Link to comment
Share on other sites

The current behavior is clearly an artifact of implementation which was not meant for running engines starving for air - but it is actually very common state for all spaceplanes designed to reach orbit. So I definitely agree.

I would also propose that similar, yet maybe more sophisticated method should be applied to electricity.

In that case, also all electricity production should be calculated first, then the consumption should be distributed based on part priority - probe cores going first, then reaction wheels, then ion engines, then everything else. And if there is not enough electricity to match needs of the whole group (e.g. all ion engines) then neither gets any and the leftover is stored in batteries.

Link to comment
Share on other sites

The current behavior is clearly an artifact of implementation which was not meant for running engines starving for air - but it is actually very common state for all spaceplanes designed to reach orbit. So I definitely agree.

Agreed, the current implementation has somewhat of a "quick and dirty" feel to it. Though there may be underlying performance reasons for the way it is, I don't know enough about the internals of KSP to really say.

I would also propose that similar, yet maybe more sophisticated method should be applied to electricity.

In that case, also all electricity production should be calculated first, then the consumption should be distributed based on part priority - probe cores going first, then reaction wheels, then ion engines, then everything else. And if there is not enough electricity to match needs of the whole group (e.g. all ion engines) then neither gets any and the leftover is stored in batteries.

That's an excellent idea, probably worthy of its own thread. I particularly like prioritizing probe cores and reaction wheels, makes it less likely that poor solar panel orientation will render a ship useless.

Link to comment
Share on other sites

What RIC has proposed above is way better than what is currently implemented, and as Kashua indicates, could be applicable to other resources.

I feel like the whole issue could actually be side-stepped if the players were able to set the priorities for resource usage. E.g. all engines that were assigned to "IntakeAir Priority 1" would get all air distributed amongst them. The same could be done for fuel tanks, setting some fuel tanks to be drained first, or all fuel tanks with the same priority to be drained at the same time. In these cases, all the fuel duct would do (and, IMO, all it should do) is act as a part to create a "fuel crossfeed" link between two parts. If the players can set the usage priorities, all this goofy flow logic just disappears.

The game would just look at all the parts that are crosslinked and draw from the ones with the highest priority first, and send that resource to the highest priority engine/consumer. If those needs are met, then it flows to the next highest, and so on.

Link to comment
Share on other sites

And if there is not enough electricity to match needs of the whole group (e.g. all ion engines) then neither gets any and the leftover is stored in batteries.

I think that it would be better to set it up so that ion engines could continue to operate if the total electric charge requirements are not being met, but at a reduced power level (all ion engines would operate at the same level of course. Otherwise we just have the same problem that we have now with jet engines).

Link to comment
Share on other sites

I think that it would be better to set it up so that ion engines could continue to operate if the total electric charge requirements are not being met, but at a reduced power level (all ion engines would operate at the same level of course. Otherwise we just have the same problem that we have now with jet engines).

We do have the same problem with Ion engines as with jets. My idea is that they either all thrust, or are all off due to insufficient charge. With storing the leftover to battery it may mean that they will thrust every other frame, but they will still thrust all at once, not just a few of them which are first in the craft file.

Link to comment
Share on other sites

Simpler solution: Parts which are part of the same symmetry group generate and deplete resources as a group.

I.e., if you have a 3-fold cluster of engines, they all pull 3x the resources of a single engine as a single resource pull, and then divide whatever they get evenly between them.

Link to comment
Share on other sites

Simpler solution: Parts which are part of the same symmetry group generate and deplete resources as a group.

I'm not sure it would be any easier to implement (maybe, maybe not) and with current bugs related to symmetric parts placed in symmetry once again it may lead to some rather nasty problems.

Link to comment
Share on other sites

I feel like the whole issue could actually be side-stepped if the players were able to set the priorities for resource usage. E.g. all engines that were assigned to "IntakeAir Priority 1" would get all air distributed amongst them. The same could be done for fuel tanks, setting some fuel tanks to be drained first, or all fuel tanks with the same priority to be drained at the same time. In these cases, all the fuel duct would do (and, IMO, all it should do) is act as a part to create a "fuel crossfeed" link between two parts. If the players can set the usage priorities, all this goofy flow logic just disappears.

The game would just look at all the parts that are crosslinked and draw from the ones with the highest priority first, and send that resource to the highest priority engine/consumer. If those needs are met, then it flows to the next highest, and so on.

That's not a bad idea at all. It would need some revised default logic for when new players don't know to set priorities, but otherwise I think this would add some flexibility to the resource system by allowing more complex drain arrangements. How were you thinking the interface would work? Through tweakables or something new?

Now you mention it, so do many things in KSP somehow...

Insert obligatory "It's in alpha response" here. Seriously though, the game still has many rough edges that I expect will be refined once the scope is complete.

Link to comment
Share on other sites

We do have the same problem with Ion engines as with jets. My idea is that they either all thrust, or are all off due to insufficient charge. With storing the leftover to battery it may mean that they will thrust every other frame, but they will still thrust all at once, not just a few of them which are first in the craft file.

Sounds like you hate epileptic people (all those flashing engines...).:) I think that it would be better to just limit the thrust of all engines, that way people can say "all right, I am getting exactly 75% thrust. I need 133% of the electricity that I have now for full thrust." It's a more elegant solution, one that's already partially implemented (ion engines will currently limit thrust if there is not enough electric charge, they just limit it unevenly), and takes some of the guesswork out of construction.

EDIT:

I feel like the whole issue could actually be side-stepped if the players were able to set the priorities for resource usage.

Yeah that's a good idea too. It would get kind of frustrating remembering which engine you set to what priority, though. Maybe the current fuel lines should stay, but there is also the fuel link that you suggested.

Edited by Vaporo
Link to comment
Share on other sites

Sounds like you hate epileptic people (all those flashing engines...).:)

Sounds like you ran out of reasonable arguments.

I'm pretty sure epileptic people are sane enough to switch off any disturbing light sources they have under control. Also, we're discussing ion engines. The have no flame and produce no sound. And nobody forces you to look at them from below during burns.

Besides, it will be still up to developers to decide whether and how they will implement it. Pulling such arguments on me is pointless. I'm not the one who will be making decisions.

Link to comment
Share on other sites

Sounds like you ran out of reasonable arguments.

As someone that is susceptible (though not exactly mainstream epileptic), you're right that I'm going to take whatever steps I feel necessary to avoid the situation, and I don't think I'm susceptible enough to have issues from ion engines. However, until you can show at least some advantage to doing it this way, it feels like you can't be bothered to consider my situation.

If you know that you don't have enough electricity to run at the user-set thrust level, you probably know how short you are and could run the engines at a percentage of that level, similar to how a single engine jet works when resource starved. I'll confess that it would take more work than the current system (probably two passes through the parts as mentioned above, one to collect resources, one to consume them, though if that's too processor intensive, remembering how much they wanted to consume last tick might work but you'd have to cover corner cases), but so would the all or nothing method.

That said, I'm in favor of the proposal. Intake air has the advantage that without mods, jet engines are the only things that consume intake air, so the process would be simpler for intake air than for electricity. For the difference, you'd want some kind of priority system, either a fixed one or one that the user can alter as discussed.

Link to comment
Share on other sites

That's not a bad idea at all. It would need some revised default logic for when new players don't know to set priorities, but otherwise I think this would add some flexibility to the resource system by allowing more complex drain arrangements. How were you thinking the interface would work? Through tweakables or something new?

Yarp, just tweakables. Each part that stores or consumes a resource can get assigned a "priority group" (separately for storage and consumption) in the VAB. For example, right clicking on a LF/Ox tank would show the current tweakable interface (a row for each LF & Ox) and the "stop/go" toggle, plus something like a:

[up arrow] [Value] [Down arrow]

click the "up" arrow to make it a "higher" priority source/consumer, contra for the "down" arrow. The Value displays the 'priority' group.

The "default" logic would just be everything in same group. Maybe it would do the same "top to bottom" logic it uses now /shrug. It's a minor detail.

Edited by LethalDose
Link to comment
Share on other sites

Sounds like you ran out of reasonable arguments.

I was joking.

I just think that "flashing" ion engines would seem more artificial and unrealistic than ion engines that are automatically thrust limited to meet fuel limitations, almost like the game is breaking rather than the fuel flow. It comes down to personal preference, I guess.

EDIT: Maybe xenon fuel flow could remain the same for electric charge starved ion engines, as realistically they still have propellant, just not enough power to propel it at maximum velocity. Just a thought.

Edited by Vaporo
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...