Jump to content

[0.25] Engine Ignitor (Workaround for some bugs V3.4.1: Aug.31)


HoneyFox

Recommended Posts

Originally diagnosed on 23 engines and ~140 fuel tanks (6.4x Kerbin, career mode, only 1.25m parts, etc, etc), amply replicated with the above barrel of 77 tanks and 20 engines (LV-909 with an FL-T800 above 19 LV-T30s fed by 4-5 FL-T800s).

It seems to scale on both fuel tanks and engines*, though you do need a respectable number of fuel tanks: it also disappears entirely if your engines cease to exist (say, you forgot to turn indestructible buildings off, and your test rocket decided to collapse the launchpad).

*Tested quadrupling the fuel tanks on 19 LV-T30s + 19 FL-T800s: it slowed down. Tested adding 30 radial engines to 28 fuel tanks + 7 LV-T30s: it slowed down.

Wow... 20+ engines and 100+ fuel tanks... that's quite a lot... I don't feel strange then...

Each engine will need to check all fuel tanks it's connected to (directly and indirectly) and check the fuel state/boil-off rate per frame... so that's nearly an O(M*N)... which means if you have 20 engines and 100 tanks, the computation will be 20*100 times bigger than the amount if you only have 1 engine and 1 fuel tank... (this is assuming you are using SSTO design, if your rocket is multi-staged, the computation should be much less than 20*100).

I really recommend you reducing engine/fuel tank count per stage. Even if playing under RSS + RF + RO, you do not need that many engines & tanks to achieve orbit, unless you want to achieve some goal that is too big with just the starting technologies...

Edited by HoneyFox
Link to comment
Share on other sites

Wow... 20+ engines and 100+ fuel tanks... that's quite a lot... I don't feel strange then...

Each engine will need to check all fuel tanks it's connected to (directly and indirectly) and check the fuel state/boil-off rate per frame... so that's nearly an O(M*N)... which means if you have 20 engines and 100 tanks, the computation will be 20*100 times bigger than the amount if you only have 1 engine and 1 fuel tank... (this is assuming you are using SSTO design, if your rocket is multi-staged, the computation should be much less than 20*100).

I really recommend you reducing engine/fuel tank count per stage. Even if playing under RSS + RF + RO, you do not need that many engines & tanks to achieve orbit, unless you want to achieve some goal that is too big with just the starting technologies...

Given your description, I think the issue is that, for RF, it might be O(M*N*F), including F fuel types to check for. It would very adequately explain why it only happens when RealFuels is installed. Also, given the raw speed of modern CPUs, the game should hardly even notice 23*140 operations/tick; even assuming 100 cycles are needed for each operation and there are 50 ticks/second, that should be only 16 million cycles/second spent on Engine Ignitor.

I think the rocket I first found the problem on was my first manned Minmus mission*: because I didn't have the Mainsail yet, I was running clusters of LV-T30s on my bottom stage, which was what was responsible for most of the engines. I also had limited fuel tank size to work with: I think I was limited to the half-Jumbo tanks. Regardless, 20 engines and 100 fuel tanks should be within the realm of sanity for large rockets.

*Rocket size also ballooned by taking the delta-V map at its word and engineering a healthy excess onto the rocket: I think my (launched later, completed sooner) Mun mission came back with 1.2 km/s delta-V at the Kerbin reentry.

EDIT: If I've got some time over Thanksgiving break, I'll take a look at the source code and see if I get any bright ideas about how to optimize it. The possibility that springs to mind is, on physics load, staging, and docking, generate an array of tanks for each engine to check, so each engine only checks the tanks it's connected to. Would probably need to catch the C# equivalent of NullPointerExceptions (I'm a Java programmer, mostly) for situations like "fuel tank destroyed by bad decoupler physics and heavy SRBs".

Edited by Starman4308
Link to comment
Share on other sites

Originally diagnosed on 23 engines and ~140 fuel tanks (6.4x Kerbin, career mode, only 1.25m parts, etc, etc), amply replicated with the above barrel of 77 tanks and 20 engines (LV-909 with an FL-T800 above 19 LV-T30s fed by 4-5 FL-T800s).

It seems to scale on both fuel tanks and engines*, though you do need a respectable number of fuel tanks: it also disappears entirely if your engines cease to exist (say, you forgot to turn indestructible buildings off, and your test rocket decided to collapse the launchpad).

*Tested quadrupling the fuel tanks on 19 LV-T30s + 19 FL-T800s: it slowed down. Tested adding 30 radial engines to 28 fuel tanks + 7 LV-T30s: it slowed down.

You have to admit that is ridiculously overbuilt for the mission. This game is pretty un-optimized and only uses one core for all the calculations so a rocket with 40 parts for the lower stage alone will definitely slow down most computers!

If the problem persists with smaller part counts then I would say this is a problem but I never had a problem so far. My minmus lander had like 40 parts total and half those would be shed off after the first stage.

Link to comment
Share on other sites

You have to admit that is ridiculously overbuilt for the mission. This game is pretty un-optimized and only uses one core for all the calculations so a rocket with 40 parts for the lower stage alone will definitely slow down most computers!

If the problem persists with smaller part counts then I would say this is a problem but I never had a problem so far. My minmus lander had like 40 parts total and half those would be shed off after the first stage.

Were you using stock (dinky) planets, though?

The delta-V requirements for 6.4x Kerbin are brutal, the delta-V map I use tends to overestimate how much you need, I engineered a healthy safety margin on top of that overestimate, and I was limited to half-Jumbo tanks, the Skipper, and 1.25m engines. Regardless of whether I should have used fewer parts, the deal is that, at least when I have RealFuels going, Engine Ignitor is what is limiting the size of my craft. A single mod should not so badly crimp what you can do in KSP.

EDIT: For perspective, in stock, one can engineer a Minmus round-trip mission on ~6.2-6.5 km/s (slightly uncertain on how much dV is required to go from Minmus orbit to Kerbin reentry). In 6.4x Kerbin, even with FAR to remove the souposphere, you need 7.4-7.6 km/s just to reach orbit. I think I built in 14.3 km/s to that mission (calculated 13.5 km/s from the map, added 0.8 km/s safety margin). In theory, that's a rocket 9.67x larger for the same mission (assuming average Isp of 350s). I also double-checked: while my second stage used highly efficient (Isp = 440) hydrogen-liquid oxygen engines, everything else was at 320 Isp (there are problems with LH2: it's not very dense, so the tanks are colossal, and it's subject to boil-off, reducing its utility for engines not used for ascent or initial transfer).

Edited by Starman4308
Link to comment
Share on other sites

Perhaps it's because EI uses .NET Reflection too frequently to acquire some data from RF about tank types.

I still don't understand why that will cause 100% CPU usage, shouldn't be that expensive...

Anyway I will see if I can do any optimization on my side but I cannot guarantee anything.

You can cache all the GetProperty("xxx") like I do for the mjfarext (https://github.com/sarbian/MechJebFARExt/blob/master/MechJebFARExt.cs#L150)

Link to comment
Share on other sites

  • 2 weeks later...

HoneyFox, is it possible to define more than one ignitor type for an engine in RSS/RO? I'm trying to code an LR-87 analogue, which was configured for A50/NTO, LH2/LOX, and Kerolox duty during it's long life. Each of which will have different EI requirements, of course.

Playing with realism overhaul. Did i miss a manual somewhere? I CANT get my upperstages to ignite!! How can I make it easier/remove the ullage simulation? (prefferably just figure it out)

Thanks!

Change your upper stages to NTO/Hydrazine (MMH, UDMH, Aerozine50) type engines with Service Module type tanks until you get the hang of it. When using unpressurized (anything non-hypergolic) fuels, you need to ignite your upper stages shortly after burnout of the first stage or use ullage motors or RCS to ullage the fuel to the bottom of the stage. Using the SM type tanks with NTO/Hydrazine engines will allow you to follow whatever ascent path you wish, including large drifts between MECO and SEI (Main Engine Cutoff and Second Engine Ignition).

Ultimately, your best shot at playing RO with Engine Ignitor is to learn to design rockets that will fly along a proper gravity turn which will allow you to ignite your second stage shortly after MECO (within 5 seconds). Upper stages with starting TWRs of 0.7-1 are easiest, but it is possible in RO to use upper stages with starting TWRs of less than .2 (Atlas-Centaur comes to mind). Burning above or below prograde to control time to apogee is the trick here - below for high TWR upper stages and above for low TWR stages.

For examples of rockets which use ullage systems, observe the Saturn V, Falcon 9, and Centaur. The SV used small solid rocket engines strapped to the side of the third stage for ullage as they would only be used for one reignition before the stage was spent. Procedural SRBs or sepatrons with the trust limited for longer burns will work for this in RO. Remember to experiment - a longer, lower thrust SRB burn is usually better. For rockets like the Centaur, a hydrolox upper stage employed on several rockets, a pressurized reaction control system is used to provide a small forward acceleration to ullage the fuels. In RO, RCS quads around the fore and aft of your upper stage will work on lighter stages and can usually be augmented by verniers or linear RCS ports spread on the base of the stage around the main engine if you need more acceleration (hold that H key!). In either case pull up the info window on the engine to be started and watch the ignition stability, waiting for it to indicate that the fuel is stable. Until this happens, leave your throttle at 0 or you will just waste ignitions. Once it does, immediately throttle up and the engines should ignite. Make sure you're ready and know exactly how you're going to burn, because once you shut them down you're done unless you have more ignitions and/or ullage fuel or are quick enough to get in on the auto-ignition before the engine cools down.

Hope this helps!

Edited by SRFirefox
Link to comment
Share on other sites

SRFirefox: that's actually a Real Fuels question, and the answer is yes. You can add a different engine ignitor config to each ModuleEngineConfgs CONFIG node. See the Realism Overhaul or the RftS engine configs for examples. Oh, and I already have an LR-87-LH2 in the COM mod, using Lack's very awesome new model and a texture I threw together. I assumed that variant would have a higher area ratio nozzle, since it was a J-2 competitor.

Coffeeman: you will need to do two things.

First, if the engine is pressure-fed (mouse over it in the VAB, you'll get a tooltip telling you) it needs to be connected to a ServiceModule-type tank (any RCS tank will do, or the Proc Parts tank switched from Default to ServiceModule type).

Second, whether pressure-fed or not, you will need to settle the propellants before ignition. SRFirefox is right about how to ullage your stage: you need to either take advantage of the existing acceleration of the lower stage by igniting and decoupling your upper stage while the lower one is still running ("hot staging" -- this is why Russian LVs have mesh interstages, because that's what they do), or you must provide some acceleration via solid or liquid (RCS) ullage motors. Note that it should only take a few seconds RCS burn to start the settling; it may take a little while for the propellants to settle, but they should keep doing so after you release H...

SRFirefox (again :) ): While your post is very helpful, I do have to correct a bit of what you're saying. In particular, an engine being pressure-fed has nothing to do with whether it runs off hypergolics or not. While it's true that most pressure-fed engines have used hypergolic propellants, that's not true of all pressure-fed engines, and it's certainly the case that there are many prominent pump-fed (rather than pressure-fed) engines that run off hypergolic propellants; heck, the LR-87 itself is an example! (As is the LR-91, and all the engine Glushko designed for Proton, UR-700, etc.)

Second, as I implied above, pressure-fed engines still need to have settled propellants. (Apollo did a 2-second RCS burn to settle propellants before engaging SPS, for example.) The issue is that only RCS tanks are small enough to have a membrane between the pressurant and the propellant (and thus avoid the necessity of ullaging); for the large tanks pressure-fed engines use, you will still have to settle propellants first since the pressurant will mix freely with the propellant.

Oh, and a minor point: verniers are small liquid engines used for attitude

control during main engine burns (when there's only one main engine, say,

so you need >=1 vernier for roll control) and for fine velocity

adjustment after MECO. Even if they don't run off the same fuel tanks as the main engine, it will likely be the same set of propellants. For this reason (attitude control) they have quite large gimbal ranges.

The part that Squad calls a Vernor (note: not vernier) has literally nothing to do with verniers, other than being comparatively low thrust.

Link to comment
Share on other sites

Given your description, I think the issue is that, for RF, it might be O(M*N*F), including F fuel types to check for. It would very adequately explain why it only happens when RealFuels is installed. Also, given the raw speed of modern CPUs, the game should hardly even notice 23*140 operations/tick; even assuming 100 cycles are needed for each operation and there are 50 ticks/second, that should be only 16 million cycles/second spent on Engine Ignitor.

I think the rocket I first found the problem on was my first manned Minmus mission*: because I didn't have the Mainsail yet, I was running clusters of LV-T30s on my bottom stage, which was what was responsible for most of the engines. I also had limited fuel tank size to work with: I think I was limited to the half-Jumbo tanks. Regardless, 20 engines and 100 fuel tanks should be within the realm of sanity for large rockets.

*Rocket size also ballooned by taking the delta-V map at its word and engineering a healthy excess onto the rocket: I think my (launched later, completed sooner) Mun mission came back with 1.2 km/s delta-V at the Kerbin reentry.

EDIT: If I've got some time over Thanksgiving break, I'll take a look at the source code and see if I get any bright ideas about how to optimize it. The possibility that springs to mind is, on physics load, staging, and docking, generate an array of tanks for each engine to check, so each engine only checks the tanks it's connected to. Would probably need to catch the C# equivalent of NullPointerExceptions (I'm a Java programmer, mostly) for situations like "fuel tank destroyed by bad decoupler physics and heavy SRBs".

Currently it's already only checking tanks that are connected via KSP stock interface.

But yes, it will be more optimal if I cache the tanks connected (and also their tank types because they are immutable during flight) and I just check if it still exists and is on the same vessel as the engine before other logic runs.

Link to comment
Share on other sites

Were you using stock (dinky) planets, though?

The delta-V requirements for 6.4x Kerbin are brutal, the delta-V map I use tends to overestimate how much you need, I engineered a healthy safety margin on top of that overestimate, and I was limited to half-Jumbo tanks, the Skipper, and 1.25m engines. Regardless of whether I should have used fewer parts, the deal is that, at least when I have RealFuels going, Engine Ignitor is what is limiting the size of my craft. A single mod should not so badly crimp what you can do in KSP.

EDIT: For perspective, in stock, one can engineer a Minmus round-trip mission on ~6.2-6.5 km/s (slightly uncertain on how much dV is required to go from Minmus orbit to Kerbin reentry). In 6.4x Kerbin, even with FAR to remove the souposphere, you need 7.4-7.6 km/s just to reach orbit. I think I built in 14.3 km/s to that mission (calculated 13.5 km/s from the map, added 0.8 km/s safety margin). In theory, that's a rocket 9.67x larger for the same mission (assuming average Isp of 350s). I also double-checked: while my second stage used highly efficient (Isp = 440) hydrogen-liquid oxygen engines, everything else was at 320 Isp (there are problems with LH2: it's not very dense, so the tanks are colossal, and it's subject to boil-off, reducing its utility for engines not used for ascent or initial transfer).

I use EI with RSS and that requires even more dV to achieve orbit (~9000m/s) or to go to Mun(12000m/s for Mun flyby, 15000m/s for Mun landing and 18000m/s for Mun return), even so I've found that it's very rare that I need that many fuel tanks considering that I use Procedural Parts plugin which can provide fuel tanks of adjustable diameter (10m or even larger) and adjustable height (30m or even higher).

Really recommend you to use it. It's super awesome. :)

Edited by HoneyFox
Link to comment
Share on other sites

  • 2 weeks later...

I do not know what I'm doing wrong, but this thing just does not work.

Or it ignites only one engine of the two and rocket spins to death.

Do you really want to say that the real engines have only a 10-20% chance to ignite?

I think, nobody would fly to space with chances in 10-20%.

Also need a button that will minimize power without shutting down the engine.

Because if I just press "X", I need to ignite engine again.

And maybe need some settings.

For example, I wanted to play with this mod, if the ignition would always worked, but required resources and was limited to the number of runs.

Link to comment
Share on other sites

I do not know what I'm doing wrong, but this thing just does not work.

Or it ignites only one engine of the two and rocket spins to death.

Do you really want to say that the real engines have only a 10-20% chance to ignite?

I think, nobody would fly to space with chances in 10-20%.

Also need a button that will minimize power without shutting down the engine.

Because if I just press "X", I need to ignite engine again.

And maybe need some settings.

For example, I wanted to play with this mod, if the ignition would always worked, but required resources and was limited to the number of runs.

Normally, all engines have 100% ignition success rate if all conditions are met: fuel stability, ignitor count & ignitor resources.

if stability is not high enough or ignitor resources are insufficient, you do get possibility that ignition will fail, and the lower the stability/the fewer ignitor resources you have for an engine, the higher possibility.

Link to comment
Share on other sites

I do not know what I'm doing wrong, but this thing just does not work.

Or it ignites only one engine of the two and rocket spins to death.

Do you really want to say that the real engines have only a 10-20% chance to ignite?

I think, nobody would fly to space with chances in 10-20%.

There are engines that always ignite. These are: solid rockets and RCS thrusters. Regular engines, such as the ones fueled with kerosene or liquid hydrogen, have problem starting in weightlessness. If you start them right after the previous stage finished burning, you should have no problems. If you however drift in space for a while before starting them, the fuel will become unstable, and you will need something to give you some "push" so that the fuel flows properly towards the engine again before you can have a successful ignition. The same is true of pressure-fed engines (which require the "service module" procedural tank setting to work), but these require much less of a "push", making them easier to ignite in space.

There are two usual methods: small solid rocket boosters staged to fire right before engine ignition, called "ullage boosters", about the size of "separatrons", or RCS. RCS often turns out to have too weak thrust in relation to the engine we want to fire, so I wouldn't rely on that too much. In desperate situations you can try using RCS to spin your rocket fast (turn off SAS to avoid wasting RCS fuel), although that is risky for obvious reasons. This creates centripetal force, a sort of artificial gravity, which, if you let it spin for a while, should stabilize your fuel. Happy flying!

[edit:] Edited for correction, was not aware of changes. Thanks NathanKell!

Edited by Hattivat
Link to comment
Share on other sites

While that used to be true of all pressure-fed engines, it is now only true of RCS. Pressure-fed large engines still need stable propellants; use RCS to ullage a bit before ignition (as the Apollo CSM did).

Note that it will take a long time for propellants to settle after an RCS burst, but (as I understand it) even 3-5 seconds of prograde RCS should be enough to start the process, give it another minute or so for the propellants to settle.

Link to comment
Share on other sites

  • 2 weeks later...

I understand.

Just useUllageSimulation = false for all engines, and all works stable.

I want to remind you that perhaps plugin will be more popular if it is just an option to limit the ignition of the engines, without excessive simulation.

Now this can be achieved only by intervening in the recording manually.

Tell me another thing please.

These engines were scaled.

But one engine kept amount of the fuel, and another - no.

It was fantastically "pleasant" surprise in space.

And, I could not repeat the correct engine then, I had to just copy it. Although I suspect this can be achieved by using symmetry.

Has anyone experienced this?

From my point of view, if reduction of size of the engine reduces its fuel capacity, it must also decrease the amount of fuel required for ignition. Or the amount of fuel has to remain.

That is the number of possible ignitions has to remain.

HFT_zpsda267017.jpg~original

Link to comment
Share on other sites

I understand.

Just useUllageSimulation = false for all engines, and all works stable.

I want to remind you that perhaps plugin will be more popular if it is just an option to limit the ignition of the engines, without excessive simulation.

Now this can be achieved only by intervening in the recording manually.

Tell me another thing please.

These engines were scaled.

But one engine kept amount of the fuel, and another - no.

It was fantastically "pleasant" surprise in space.

And, I could not repeat the correct engine then, I had to just copy it. Although I suspect this can be achieved by using symmetry.

Has anyone experienced this?

From my point of view, if reduction of size of the engine reduces its fuel capacity, it must also decrease the amount of fuel required for ignition. Or the amount of fuel has to remain.

That is the number of possible ignitions has to remain.

http://i29.photobucket.com/albums/c291/Lesser2/screen/KSP/HFT_zpsda267017.jpg~original

Are you using TweakScale on these engines?

Link to comment
Share on other sites

Are you using TweakScale on these engines?

logically yes, if they were scaled :P

Thank you for your attention, this is not a problem anymore, I figured out how to solve it.

Suggestion to make only Engineers able to reload the ignitor magazine for the 0.90 update.

It is good idea and will make professions more important.

Cause the crew to pick up more closely.

Link to comment
Share on other sites

  • 2 weeks later...

I'd second the idea of ditching ullage by default. It's really something I feel is better suited to mods like Realism Overhaul. Perhaps make it toggleable.

Is there a way to manually disable this part of the mod currently? If not, could somebody fill me in on the basics?

EDIT: Regardless of whether or not it can be disabled, someone explaining the Fuel-Flow state (Very Stable, Very Unstable, others???) and the Auto-Ignite value (out of 800) would be greatly appreciated.

EDIT II: And maybe the different types of ignitors? The Mainsail appears to have 2 external ignitors, but I cannot get it to ignite on the pad, despite adding hypergolic fluid tanks to the ship.

Edited by Jodo42
Link to comment
Share on other sites

Looks like this still wasn't answered.

No fuel tank is ever 100% full of fuel, but it's always 100% full of something. Indeed, since engines are either pump-fed or pressure-fed, it's very important there not be vacuum within the tank, so pressurant (helium, nitrogen, etc) is used. However, when in microgravity (and not under acceleration) the fuel mixes with the pressurant. If the pipe feeding the engine has too much pressurant and not enough fuel in it, or if the area around the pipe head in the tank (i.e. what *will* shortly be in the pipe), the engine will not start, because it can't run on pressurant, just fuel and oxidizer (or fuel alone, for monopropellant engines). This means that before you ignite an engine, you must "settle" the propellants by providing some small bit of acceleration from a source immune to ullage issues (i.e. solids, or RCS with tiny bladder tank that actually has a bladder wall between propellant and pressurant).

You also need one of two things to be true to ignite an engine that does not have unlimited ignitions: you have an ignition left, or it's hot enough the propellant and oxidizer will start to react even without the benefit of an ignitor.

Link to comment
Share on other sites

I'd second the idea of ditching ullage by default. It's really something I feel is better suited to mods like Realism Overhaul. Perhaps make it toggleable.

Is there a way to manually disable this part of the mod currently? If not, could somebody fill me in on the basics?

EDIT: Regardless of whether or not it can be disabled, someone explaining the Fuel-Flow state (Very Stable, Very Unstable, others???) and the Auto-Ignite value (out of 800) would be greatly appreciated.

EDIT II: And maybe the different types of ignitors? The Mainsail appears to have 2 external ignitors, but I cannot get it to ignite on the pad, despite adding hypergolic fluid tanks to the ship.

You can toggle it, if you edit the GameData\EngineIgnitor\Plugins\PluginData\EngineIgnitor\config.xml file. There's a line there: <bool name="SimulateUllage">1</bool>, just change the 1 to a 0 and the fuel will always be stable.

@NathanKell, I can't figure out something, maybe you can help me. From how I understand the physics behind ullage, the more you stay at zero G, the more the fuel mixes with the ullage gas. But for some reason, sometimes the fuel seems to stabilize itself while in orbit. It seems that the orientation of the vessel relative to the planet has an effect on fuel stability. Why? Shouldn't G forces be zero at any part of the orbit (regardless if circular or eccentric)? I'm guessing that the mod uses orbital speed variation (not G), and that it's also affected by the fact that vessels "rotate" while in orbit. Half of the orbit I end up with fuels destabilizing, the other half it stabilizes itself. If i keep retrograde and just use physics acceleration, as I descend to Pe it stabilizes, then towards AP it destabilizes. Kind'of breaks up the point of natural diffusion, doesn't it? Am I missing something here?

Edited by karamazovnew
Link to comment
Share on other sites

How should I install this mod correctly, if I'm playing with stock game (i.e. without real fuels). I tried to extract Ignitors Config.zip and not to extract pressurizedFT.zip but still every stock fuel tank is unpressurized and that makes the game quite hard. Am I supposed to disable Fuel-Flow state as described above or is there any better solution?

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...