Jump to content

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


HoneyFox

Recommended Posts

Well honestly I would, but unfortunately I don't use any of those part packs so I wouldn't really even know where to begin with assigning numbers to those engines.

Alright, i'm just trying to avoid reduntant/duplicated work. it would be a little bit waste of time if several people create different configs for one same mod pack. (there's one exception: they provide configs of various difficulties for people to choose)

Link to comment
Share on other sites

Hey again, so I was thinking about it and I decided that with my Configs using an additional resource, there should probably be a way to store extra of that resource... So I went ahead and re-textured the Radial Xenon tank and gave it some HypergolicFluid! In addition to that I also doubled the density of the HypergolicFluid because previously it was only half as dense as LiquidFuel, which didn't make much sense.

So anyways here's version 3 of my Configs, plus the HypergolicFluid storage part: - Link Removed (Check Post #96 on Page 10 of this thread) -

Edited by CoriW
Link to comment
Share on other sites

Hey again, so I was thinking about it and I decided that with my Configs using an additional resource, there should probably be a way to store extra of that resource... So I went ahead and re-textured the Radial Xenon tank and gave it some HypergolicFluid! In addition to that I also doubled the density of the HypergolicFluid because previously it was only half as dense as LiquidFuel, which didn't make much sense.

So anyways here's version 3 of my Configs, plus the HypergolicFluid storage part: EngineIgnitorConfigs (v3 + part)

I've just written NP/KW/KOSMOS/AIES's configs... need some time to tweak them... And then publish that onto this thread. :)

Also, I used your config and changed something, like NERVA not needing any resource to ignite, and almost all engines have device limitation (depreciation) so that even if you have sufficient HypergolicFluid, the engine cannot ignite unless you use the IgnitorUnit to replace/reload it.

The idea of a HypergolicFluid radial tank is good. I'm planning to modify one of the AIES's RCS tank for this, too. That tank is a tiny sphere tank, quite suitable for such job.

Edited by HoneyFox
Link to comment
Share on other sites

Alright so based on what you've said, I decided to go ahead and change my config to include what you've said. NERVA no longer required HypergolicFluid, and all engines now have a limited number of ignitions. I also went ahead and changed the ignitorType's from "type0" and "type1" to something more readable, "External", "Internal_Small", "Internal_Medium", "Internal_Large", and "Electric".

I've gone back and updated my original post with v4. (Post #96 on Page 10)

Edited by CoriW
Link to comment
Share on other sites

Since it's been a day with no posts I'm going to assume it's alright for me to post here again rather than edit my last post.

I noticed a bug? At least what I think is a bug. Which is that if I have 20 ignitions available, but only enough HypergolicFluid for 15 ignitions, once the HypergolicFluid runs out and I try to throttle up again, it immediately consumes the last 5 ignitions available.

Another bug I've seen that I believe is more of a KSP bug than a mod bug, is that if you have no HypergolicFluid, and you start to throttle up and it cuts your engine, there is still a visible flame / smoketrail behind the rocket.

Link to comment
Share on other sites

Since it's been a day with no posts I'm going to assume it's alright for me to post here again rather than edit my last post.

I noticed a bug? At least what I think is a bug. Which is that if I have 20 ignitions available, but only enough HypergolicFluid for 15 ignitions, once the HypergolicFluid runs out and I try to throttle up again, it immediately consumes the last 5 ignitions available.

Another bug I've seen that I believe is more of a KSP bug than a mod bug, is that if you have no HypergolicFluid, and you start to throttle up and it cuts your engine, there is still a visible flame / smoketrail behind the rocket.

I've published my config pack onto OP. the pack also contains your stock config with some small edits.

For the first bug, i need to check it. I remember that i have some codes to deal with it, but it seems to be broken again.

For the second bug, well that should be one of KSP bugs.

Link to comment
Share on other sites

Since it's been a day with no posts I'm going to assume it's alright for me to post here again rather than edit my last post.

I noticed a bug? At least what I think is a bug. Which is that if I have 20 ignitions available, but only enough HypergolicFluid for 15 ignitions, once the HypergolicFluid runs out and I try to throttle up again, it immediately consumes the last 5 ignitions available.

Another bug I've seen that I believe is more of a KSP bug than a mod bug, is that if you have no HypergolicFluid, and you start to throttle up and it cuts your engine, there is still a visible flame / smoketrail behind the rocket.

It's kind of weird... by design, once the plugin detects that the engine is short of ignitor resources, it will reduce ignitor by 1 and then shutdown the engine. Can you reproduce the bug and see if the engine is still activated by right clicking on the engine and see if there is "Activate Engine" or "Shutdown Engine" button in the context menu? or perhaps your engine cannot shutdown once ignited like solid booster?

Link to comment
Share on other sites

Alright so here's the code for the LV-T45 engine, which is the one I chose to replicate the bug on.


// LV-T45 Engine
@PART[liquidEngine2]
{
RESOURCE
{
name = HypergolicFluid
amount = 6
maxAmount = 6
}
MODULE
{
name = ModuleEngineIgnitor
ignitionsAvailable = 20
autoIgnitionTemperature = 800
ignitorType = Internal_Medium
IGNITOR_RESOURCE
{
name = HypergolicFluid
amount = 0.4
// 15 Ignitions (Using HypergolicFluid)
}
}
}

And here is a video illustrating the bug. (Also showing the KSP bug of the engine still being visually active while the engine is not.)

As you can see, once all the HypergolicFluid is used, and I try to throttle up, it immediately depletes all remaining ignitions available.

Edited by CoriW
Link to comment
Share on other sites

Alright so here's the code for the LV-T45 engine, which is the one I chose to replicate the bug on.


// LV-T45 Engine
@PART[liquidEngine2]
{
RESOURCE
{
name = HypergolicFluid
amount = 6
maxAmount = 6
}
MODULE
{
name = ModuleEngineIgnitor
ignitionsAvailable = 20
autoIgnitionTemperature = 800
ignitorType = Internal_Medium
IGNITOR_RESOURCE
{
name = HypergolicFluid
amount = 0.4
// 15 Ignitions (Using HypergolicFluid)
}
}
}

And here is a video illustrating the bug. (Also showing the KSP bug of the engine still being visually active while the engine is not.)

As you can see, once all the HypergolicFluid is used, and I try to throttle up, it immediately depletes all remaining ignitions available.

Good video. I can even see the ignition count decreasing one by one during the final ignition (which should fail) is commencing.

A strange thing i noticed in this video is: the Active Engine button replaced the Shutdown Engine button, which indicates the engine should have been shutdown already. That's correct, it should be shutdown by plugin. but for the ignition count decreasing, the logic should only run when the engine is activated... That is very strange, i even wonder that this bug has some relationship with the KSP bug.

Could you try another test in which you push your throttle more (like 25%) instead of just a little, and check if both bugs disappear. I cannot access my home computer right now, so my local tests have to be postponed for several hours.

Edited by HoneyFox
Link to comment
Share on other sites

Alright so as per your request I've re-done the test, this time throttling up to 100% before cutting the engine each time. Here is the test video.

As you can see, both bugs still persist.

Thanks for the new test video. I'll try to fix this bug once i get back to my home computer.

Link to comment
Share on other sites

Ok... I did some tests and reproduced the bug also.

By some further debugging, it seems to be quite related to KSP bug though:

The plugin will detect if we have sufficient resources to ignite the engine, and it will then call "Shutdown Engine" event of the engine if we don't, just like if you click it in the context menu / via predefined action group.

However, the engine's "engineShutdown" parameter is still false, leading my plugin to judge that the user is still trying to ignite the engine, thus it keeps checking and decreases the ignition count repeatedly.

I may need to find another way to judge whether the engine is activated or not, probably by judging the Activate Engine/Shutdown Engine events themselves... which one of them is visible while the other one is not...

Hope that this solution can solve the issue.

EDIT: OK. finally got it fixed. The solution of checking whether shutdown event is active or not finally works.

And head back to ullage simulation, I've got some issue of collecting vessel.acceleration, it seems like it will frequently return (0,0,0) to me instead of correct values, and the correct values jump frequently as well. I guess i need to add some simple logic to interlope/filter the noise to get some steady reading of the acceleration.

EDIT2: Ok, turn out that i didn't consider other vessels near the KSC, that's why i get (0,0,0) reading because they are stationary. Now the ullage simulation is under way and looking good.

Edited by HoneyFox
Link to comment
Share on other sites

Alright cool, will be watching this thread for updates, let me know if you need help with anything else.

Well talking about that bug, the plugin logic is now working but the engine's fx is still out there due to KSP bugs. I don't know how to disable that though... It will really confuse people a lot. :(

Link to comment
Share on other sites

Well talking about that bug, the plugin logic is now working but the engine's fx is still out there due to KSP bugs. I don't know how to disable that though... It will really confuse people a lot. :(

Yeah well, I've seen that issue with another plugin too, (can't remember which one) and unfortunately there doesn't seem to be any easy fix (if any) for it. Personally I would just recommend stating in the OP that it's a known bug, and that it's caused by KSP and not the plugin.

Link to comment
Share on other sites

Ok, I'd like to give some update info in case any of you are expecting...

The ullage simulation is under way, right now the vessel can read acceleration correctly in its local transform's space. it can also handle time-warp correctly now when landed/splashed or coasting on orbits.

The simulation is nearly finished, and some parameters are being tweaked. The fuel flow will become stable when we have sufficient acceleration while it will go bad when you roll the rocket too much or after you coast the rocket for quite a while.

I'm still finding a way to show the fuel flow stability to players... probably i will show it also on the engine's context menu so players can watch that during ullage motor burning and judge if the main engine can be started.

For the ullage motor, there are several ideas:

1. just use the small solid "separatron" boosters, but it can be used only once, which may only be suitable for LKO/KTO/TMO rocket's upper stage. The upper stage can use the first stage's acceleration to start its first burn to complete the circularization and the separatron ullage motor can be used to start the GTO/TMO transfer burn. The GEO or MOI burn will then be executed by the payload's own engines...

2. use a small engine to consume the propellant (same as the main engine) and exhaust with a low thrust & low Isp to simulate venting boiled propellant, may only suitable for light payload, otherwise the thrust may not be enough to generate sufficient acceleration, but it consume the same propellant which means no extra resource tanks are needed.

3. use a small engine which uses MonoPropellant or HypergolicFluid as propellant with higher thrust & medium Isp, suitable for heavier payload, but has limited times of burn due to limited resource. (it can actually be replaced by some specialized linear RCS ports, but it may be quite uncomfortable to control these ullage motors with RCS controls, right? or maybe not?)

Edited by HoneyFox
Link to comment
Share on other sites

How about making prop venting work by just opening the throttle with engine off? That would provide a nice emergency measure at the cost of a large amount of fuel. It should probably only work well with cryogenic fuel, as other types expand much less. You could try it with other types as long as the ship isn't too heavy (and you're not facing drag), but fuel loses would be much higher.

Link to comment
Share on other sites

stack separators may not be enough... it only gives a push when separating, can push most of fuel to the bottom of the tank, but may not be enough to remove gas bubbles in the fuel completely i guess...

spin on pitch/yaw axis already works. And is usually used as an emergency procedure. (I've just done that once yesterday night when my craft had been coasting towards Mun for several hours, and i forgot that the ullage would fail the lander engine ignition... oh that was a real busy moment, luckily i made it by pitching quickly (i didn't bring RCS so that's the last resort) and successfully ignited the engine before it's been too late.

Link to comment
Share on other sites

This sounds great!

HoneyFox, when you're checking acceleration, are you doing special handling for when landed and under G? (and when flying free and under G but not under local acceleration, the opposite corner case)

The vessel.acceleration's magnitude will be nearly 0 when the rocket is landed, and will be 9.8 when orbiting, so all i need to get the correct reading is to use vessel.acceleration - FlightGlobals.getGeeAtPosition(vessel.GetWorldPos()). Note that the getGeeAtPosition will get a negative direction so i need to reverse it. After that it will be converted into engine's local transform. This will work for all situations except 5x+ time-warping.

For 5x+ time-warping, the vessel.acceleration reading is quite strange, so i changed to use either 0 when orbiting or -FlightGlobals.getGeeAtPosition(...) when landed/splashed.

Link to comment
Share on other sites

How about making prop venting work by just opening the throttle with engine off? That would provide a nice emergency measure at the cost of a large amount of fuel. It should probably only work well with cryogenic fuel, as other types expand much less. You could try it with other types as long as the ship isn't too heavy (and you're not facing drag), but fuel loses would be much higher.

It is doable by:

1. Create a small engine which doesn't simulate ullage to emulate a venting device. (I may need to add an option for this later, by default the option will enable the ullage simulation)

2. Install several of them around the main engine, You'd better use an action group to toggle both the venting devices and the main engine.

3. Setup staging so that they will be activated before the main engine.

4. Increase throttle to execute venting for several seconds.

5. Use action group to shutdown the venting devices and starting the main engine at the same time.

6. If we need to re-ignite later, simply use that action group to shutdown main engine and activate venting devices, and then go back to Step 4.

EDIT: Ah, i read your post again... you want a module installed in engine to be able to generate small thrust even when the engine is not activated right? Well...that maybe doable, but IMHO it's not very necessary if we can take the measure above. but... i will think about it later.

Edited by HoneyFox
Link to comment
Share on other sites

Engine Ignitor V3.0 has just been published! :)

See OP for full introduction and download links.

Change-log:

1. ModuleExternalIgnitor can have IgnitionsAvailable & IGNITOR_RESOURCE limitations too, similar to ModuleEngineIgnitor.

2. Simple ullage simulation implemented. You need to take care of this before you want to ignite your engine especially after you have coasted for quite a while or you have adjusted attitude of vessel a lot. Several measures can be taken to solve the ullage issue. Fuel flow state will be displayed in the engine's context menu.

3. Several bug-fixes. Including the engine flame keeping displayed after a failed ignition, ignitor count quickly decrease to zero when IGNITOR_RESOURCE are depleted, etc...

Link to comment
Share on other sites

Engine Ignitor V3.0 has just been published! :)

See OP for full introduction and download links.

Change-log:

1. ModuleExternalIgnitor can have IgnitionsAvailable & IGNITOR_RESOURCE limitations too, similar to ModuleEngineIgnitor.

2. Simple ullage simulation implemented. You need to take care of this before you want to ignite your engine especially after you have coasted for quite a while or you have adjusted attitude of vessel a lot. Several measures can be taken to solve the ullage issue. Fuel flow state will be displayed in the engine's context menu.

3. Several bug-fixes. Including the engine flame keeping displayed after a failed ignition, ignitor count quickly decrease to zero when IGNITOR_RESOURCE are depleted, etc...

How'd you fix the Engine FX showing after a failed ignition?

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