Jump to content

[1.12.x] BetterBurnTime v1.10: Provides extra burn-time indicators on the navball for suicide burns & target rendezvous.


Snark

Recommended Posts

21 hours ago, Black-Talon said:

As I suspected. Makes sense, uses the right numbers.

If my craft is messing up those numbers, perhaps by having the engines crooked, impeded thrust, or perhaps even other bugs that create wasted thrust, my estimate will of course be wrong.

If I see it again I'll try to figure out what's going on for real. Thanks!

As Kerbart says, the mod doesn't do any history tracking.  It just does the math based on the current state of the engines.  By the way, if you do have the engines on crooked, the mod will take that into account-- e.g. if you have two engines pointing down at a 45 degree angle instead of straight down, you'll only get 70.7% of the forward thrust due to cosine losses.  This mod will take that into account for its estimate.  (But then again, the stock burn-time indicator would work for that, too, since it just looks at how fast your ship actually accelerates and then remembers that for the remainder of the flight session.)

As to why your burns end up taking longer than expected-- no idea.  Do you get that flakiness with my mod installed, or is that only when you're using the stock indicator?  If it shows up only in stock, then it sounds like a bug, happily addressed by my mod.  :)  If it shows up even when you're using my mod, then it means there's something odd going on with your engines (e.g. their performance is degrading over time for some reason).  Normal engines never degrade over time, unless you've got some sort of mod going that does that.  Two other ideas that occur to me are running out of electricity when you have an ion engine, or trying to do a very long burn when you're deep in a gravity well (a 3-minute burn in LKO is going to give you grief).

That's just speculation, though-- if you'd like to delve into that in more detail, suggest taking it to the Gameplay Questions forum?

Link to comment
Share on other sites

Posted v1.1.1.  This is a minor update which fixes a bug in which burn time was incorrectly calculated for engines with multiple nozzles, such as the Mammoth and Rapier.

Took me almost a month to notice it myself because it's a situation that rarely comes up in my own games-- I'm usually using Mammoth as a liftoff engine (and therefore don't usually use it with a maneuver node), and I hardly ever use Rapiers at all (since I'm not a spaceplane guy.)  :blush:

Didn't realize the problem until I ran across it in my own game. Kinda surprised that nobody noticed it and pointed it out-- it's had over 4000 downloads in the last month.  Oh well... I'll skip the "please log bugs" rant;)

Haven't heard any response to v1.1, posted a week ago, which added the "time to impact" indicator with burn time for that.  I wonder if anybody other than me finds it useful?

<sound of crickets chirping>

Link to comment
Share on other sites

Genius! You just solved so many problems that I frequently encounter! I always run into that annoying N/A error whenever I'm trying to plan things that depend on burn time. lol

And while I'm able to land on moons well enough to build and connect refueling bases, my descent speeds are always really clumsy and slow, and probably waste fuel.. So hopefully this mod will allow me to be more precise in my landings.. I wonder, could this mod be used to assist in suicide burns? I've always wanted to try that, but never got around to it.. due to not wanting to crash, and knowing more reliable methods.. lol

Can't wait to get in the game and check this out, just installed it! ;D

Link to comment
Share on other sites

13 hours ago, Snark said:

Posted v1.1.1.  This is a minor update which fixes a bug in which burn time was incorrectly calculated for engines with multiple nozzles, such as the Mammoth and Rapier.

Took me almost a month to notice it myself because it's a situation that rarely comes up in my own games-- I'm usually using Mammoth as a liftoff engine (and therefore don't usually use it with a maneuver node), and I hardly ever use Rapiers at all (since I'm not a spaceplane guy.)  :blush:

Didn't realize the problem until I ran across it in my own game. Kinda surprised that nobody noticed it and pointed it out-- it's had over 4000 downloads in the last month.  Oh well... I'll skip the "please log bugs" rant;)

Haven't heard any response to v1.1, posted a week ago, which added the "time to impact" indicator with burn time for that.  I wonder if anybody other than me finds it useful?

<sound of crickets chirping>

Just noticed the update. Thanks for this, was a pita for me. I was always writing down burn times because of the NaN thing. Then getting them confused with others

 

I wouldnt have noticed it either as the same applies to me.

Link to comment
Share on other sites

13 hours ago, Snark said:

Didn't realize the problem until I ran across it in my own game. Kinda surprised that nobody noticed it and pointed it out-- it's had over 4000 downloads in the last month.  Oh well... I'll skip the "please log bugs" rant;)

Haven't heard any response to v1.1, posted a week ago, which added the "time to impact" indicator with burn time for that.  I wonder if anybody other than me finds it useful?

I haven't used your mod yet, Snark, and I am considering finishing my time with KSP 1.0.5 unmodded, but it is on my list for when KSP 1.1 hits.

It certainly removes one UI annoyance that seems to be around all the time, and in my case and my Fantastic Contraptions in Space(tm), Mammoths in orbit are more common than I care to admit :blush:. So both your mod in general and this bug fix are preemptively appreciated.

 

Link to comment
Share on other sites

The time until impact is my favorite thing about this mod. Its so goddamn useful. Oh my god, story time.

 

I was going to Moho for the first ever the other day. With a probe lander. And i decided to just deorbit, and use the time until impact. I had the feeling the number was wrong, i mean i was comming down too fast (i was landing near the poles, they have rough terrain, so i dont blame it.) but i decided to rely on the number anyway. held my breath and didnt start burning until the Time until Impact and Burn time numbers were equal. It was the best freaking landing ever. It slowed down just enough, and hit a slope at the correct angle. The engine blew up, but the landing legs prevailed. It made a 360 spin after the explosion, and landed on the legs. It was awesome. I regret i didnt have any footage.

Edited by abowl
Link to comment
Share on other sites

8 hours ago, NikoKun said:

I wonder, could this mod be used to assist in suicide burns? I've always wanted to try that, but never got around to it.. due to not wanting to crash, and knowing more reliable methods.. lol

Yes.  :)  That's exactly what I intended the "time to impact" feature to be used for.

You actually don't need this feature for suicide burns; there's a simple technique you can use (even in stock) for them, using a maneuver node, which I've put in a spoiler section here for the sake of visual brevity:

Spoiler

Easy suicide-burn technique without any mods (as long as you have maneuver nodes unlocked):

  1. Put yourself on a suborbital trajectory.
  2. Drop a maneuver node right at the point where your projected path hits the surface.
  3. Drag the maneuver node's retrograde handle.  Hold it until your projected post-node trajectory collapses down to a point and the maneuver node's prograde/retrograde markers start flipping back and forth.
  4. Go back to your ship, put the navball into Surface mode, and choose "hold retrograde" if you've got it.
  5. When the time-until-maneuver equals the estimated burn time, slam on the throttle.
  6. Brake to a halt right at ground level.  Change shorts.  High-fives all 'round.

(Actually, for math reasons I won't go into here, in step #5 you actually want to wait a bit past the point where time-until-maneuver equals estimated burn time.  The exact amount depends on your TWR and your angle of approach to the surface.  Higher TWR = shorter time.  More vertical approach = shorter time.  The shortest possible time is 50% of the estimated burn time, in the case where you're descending vertically and your TWR is very high.  In practice, I usually aim for about 70%, that seems to work well and gives a reasonable safety margin.)

Advantages to this approach:

  • Works in stock, doesn't need any mods.
  • Reliable.
  • Quick and easy to do.

Disadvantages:

  • Depends on the stock "estimated burn time" indicator, and is therefore subject to the limitations thereof which are what led me to write BetterBurnTime in the first place.  ;)
  • It gets really tedious after the Nth landing using the technique (for me, anyway).
  • I find it annoying and immersion-breaking.

The maneuver-node technique described above is reliable, but (for me) annoying.  So I added this feature to provide essentially the exact same functionality without the need to muck around with maneuver nodes.  Using this feature, a suicide burn is as simple as "wait until estimated burn time equals time to impact, then hit the gas."  Actually, you want to wait a bit later than that.  (Figuring out "how much later" is part of the fun, and I didn't want to take that away from myself or others.  In practice, I find that 70% is a good rule of thumb, i.e. I hit the gas when time-to-impact is about 70% of the estimated burn time.)

 

Link to comment
Share on other sites

3 hours ago, Apollo13 said:

I still see "N/A"  frequently.

Really?  Huh, it's not supposed to do that.  I don't experience that myself, but admittedly my testing isn't super exhaustive and you may have hit upon a use case that I don't, simply due to differing play style.

The intent is that you should only be seeing "N/A" if you actually can't thrust at all (i.e. have no active engines, or you're completely out of fuel).  If you're seeing it at any other time, there may be a bug in the mod, which I'd like to fix if possible.

Do you have a reliably reproducible case where "N/A" shows in a situation where it shouldn't?

2 hours ago, abowl said:

The time until impact is my favorite thing about this mod. Its so goddamn useful. Oh my god, story time.

I was going to Moho for the first ever the other day. With a probe lander. And i decided to just deorbit, and use the time until impact. I had the feeling the number was wrong, i mean i was comming down too fast (i was landing near the poles, they have rough terrain, so i dont blame it.) but i decided to rely on the number anyway. held my breath and didnt start burning until the Time until Impact and Burn time numbers were equal. It was the best freaking landing ever. It slowed down just enough, and hit a slope at the correct angle. The engine blew up, but the landing legs prevailed. It made a 360 spin after the explosion, and landed on the legs. It was awesome. I regret i didnt have any footage.

lol, thank you for sharing that!  It's exactly stories like that which make it feel good to share a mod with folks.  :)

In all fairness, it sounds like you lucked out-- normally, hitting the gas at exactly the point where "time to impact" equals "estimated burn time" would be a bit early.  If it worked out as being precisely right, that's more an accident of the rough terrain than anything else, and I can't claim credit (much as I'd love to).

Great story, though!

Link to comment
Share on other sites

1 hour ago, abowl said:

You get N/A if the engine isnt activated. Engines wont activate if you decouple manually. Maybe thats the problem.

If that's the problem, then it's by design.  The mod tells you how long it will take based on the current state of your engines.  An engine that's not activated can't move you.

Several circumstances could disqualify an engine from being counted:

  • If the engine isn't activated.
  • If you're completely out of fuel for the engine.
  • If the engine's thrust limiter is set to zero.
  • If the engine is fuel-deprived (i.e. you just tried to thrust and the engine choked because it can't get fuel flow, even if there exists fuel on the ship somewhere)

The main thing is that @Apollo13 mentioned getting N/A "frequently," but didn't say anything about the circumstances-- I just want to make sure whether the circumstances are "legitimate" ones, or a bug.

Link to comment
Share on other sites

@Snark

Now that I've been using this for a couple of weeks, I have to say, this is one of the very best mods to come out since oh, probably RCS Build Aid.  Like the latler, that this mod is absolutely necessary should shame Squad.  That this mod is so excellent at what it does should make Squad bring you aboard as they have other modders.  It's inexcusable that the basic game lacks such a fundamental, vital function as displaying how long to do a burn UNDER ANY CIRCUMSTANCES.  This has always been one of my chief annoyances with KSP.  Thanks muchos for fixing this critical problem with the game.

As you probably know, my thing is doing flotillas.  Because they make you switch frequently between ships, and because the stock game forgets what your TWR is when you leave a ship so displays N/A when you come back to it, without this mod you have to bump the throttles briefly to get a burn time to display.  Which of course hoses up the maneuvrer node for the transfer burn you carefully set up some time before.  And its the same for every other burn en route to final orbit for all the ships.  But with this mod, it's no longer necessary to bump the throttles---the correct burn time always displays as soon as I switch to the ship in question.  And the displayed time works for by manual burns and having MJ do them (MJ doesn't figure burn times itself so is as screwed as the player by the N/A).  So a thousand thank-yous for this.

This mod really needs more publicity.

Link to comment
Share on other sites

On 12/24/2015 at 8:45 PM, Geschosskopf said:

<fulsome praise>

As you probably know, my thing is doing flotillas.  Because they make you switch frequently between ships, and because the stock game forgets what your TWR is when you leave a ship so displays N/A when you come back to it, without this mod you have to bump the throttles briefly to get a burn time to display.  Which of course hoses up the maneuvrer node for the transfer burn you carefully set up some time before.  And its the same for every other burn en route to final orbit for all the ships.  But with this mod, it's no longer necessary to bump the throttles---the correct burn time always displays as soon as I switch to the ship in question.  And the displayed time works for by manual burns and having MJ do them (MJ doesn't figure burn times itself so is as screwed as the player by the N/A).  So a thousand thank-yous for this.

:blush: Thank you!  Glad you like it, it's great to know that it's really helping people.

Have you ever tried Burn Together?  I've never tried it myself, but it sounds like something that would be right up your alley.  It's marked as 0.90 on the hosting site, but posts on the forum thread seem to indicate that it still works post-1.0.

Link to comment
Share on other sites

On 12/24/2015 at 8:45 PM, Geschosskopf said:

This mod really needs more publicity.

Well, it seems to be doing okay... I'm getting on the order of 200 downloads per day.  Compare that with only about one-third that rate for another mod of mine, BetterCrewAssignment, which got the nicest publicity possible when Squad put it up for last week's Modding Monday (I'm still giddy from that).

So I guess the moral of the story is "build something that people like, and they will come get it."  :)

But by all means, shout it from the rooftops, I'd love for folks to know about the mod.  ;)

 

 

Link to comment
Share on other sites

On 12/24/2015 at 9:58 PM, Snark said:

:blush: Thank you!  Glad you like it, it's great to know that it's really helping people.

Have you ever tried Burn Together?  I've never tried it myself, but it sounds like something that would be right up your alley.  It's marked as 0.90 on the hosting site, but posts on the forum thread seem to indicate that it still works post-1.0.

Burn Together, while cool for certain purposes, doesn't work well for me.  First off, I usually don't have identical ships so they all need to do their burns differently.  Also, you want the ships of a flotilla spaced out at least an hour or so apart so you can deal with one before having to deal with the next.

Link to comment
Share on other sites

2 hours ago, Geschosskopf said:

This mod really needs more publicity.

Well, what this mod really needs is to become stock! It's not like it's rocket science (ooh... wait...) but really, the math involved is similar to what goes on in maneuver nodes (probably even simpler) so it wouldn't violate the LOLZ GUESTIMATE KERBALZ LOLZ rule in stock either, I'd think.

Link to comment
Share on other sites

16 hours ago, 5thHorseman said:

I somehow missed this mod for 1.5 months. Very cool looking. Can't wait to try it out!

I usually take a bit of umbrage at mods using the term "Better" for what is frequently actually just "different." I do not have such feelings in this case :)

Heh, thanks!

Though "better" wasn't a super high bar in this particular case. ;)

Link to comment
Share on other sites

21 hours ago, Kerbart said:

Well, what this mod really needs is to become stock! It's not like it's rocket science (ooh... wait...) but really, the math involved is similar to what goes on in maneuver nodes (probably even simpler) so it wouldn't violate the LOLZ GUESTIMATE KERBALZ LOLZ rule in stock either, I'd think.

Thanks, would love to see this sort of behavior in stock myself.  (I like to write little, minimalist mods that just tweak the behavior of the game to what I would want the default game to be.)

What I found interesting about writing BetterBurnTime was that by far the majority of the logic had nothing to do with the actual math of calculating the burn time.  You're right, the math is very simple-- once you know the craft's thrust, calculating the actual burn time is only a line or two of code.

Rather, the hard part is in calculating the thrust-- in particular, dealing with all of the many, many edge cases that can affect it.  "Put engine on rocket, rocket make thrust" is the sort of thing we tend to take for granted (at least, I know I do), but once you start delving into all the possible ways it could get mucked up, it turns out to be surprisingly complex.  (What if an engine's not active?  What if the thrust limiter is on?  What if there are different engines with different Isp values?  What if all the engines aren't pointing in the same direction?  What if an engine is starved of propellant?  What if there's no propellant available on the ship?  What if the engine needs multiple propellants, and they're all present, but there's a shortage of one relative to the others? Or different engines which need some of the same propellants but differ in others (like running an LV-N and LFO engines together)?  What if one or more of the needed propellants are something renewable, like electricity?  What if the "infinite fuel" cheat is turned on?  What if there's some fuel, but not enough for the whole burn, how do you calculate and what number to show then?  What if an engine has multiple nozzles?  Or multiple modes?  And on and on...)  I'd say that over 90% of the code (and the development time) for this mod is devoted to handling all of those edge cases.  And doing so in a way that doesn't hammer the CPU.

It doesn't necessarily have to solve every conceivable use case under the sun, but I'd like it never to show a number that's egregiously wrong (or, more to the point, worse than what the default indicator would show), and I'd like it to cover all the likely cases that KSP players normally run up against.  That's "good enough," as far as I'm concerned-- there's a reason I called it BetterBurnTime and not BestBurnTime.  :)  But just aiming for that bar required a surprising amount of code.

Writing the mod was quite a journey of discovery for me (this was only the third mod I ever wrote, and the previous two were much simpler), and gave me an appreciation for the magnitude of the task Squad takes on when they implement a major feature, if something as simple as a reliable burn-time indicator took this much work.

Edited by Snark
Link to comment
Share on other sites

Hi all,

So someone has reached out to me with a bug report-- NullReferenceException cropping up, apparently.  I have a description of the error, and the location, but not a repro case for demonstrating the bug (which I've never run into myself, so I don't know what circumstances trigger it).

I'm going to be working on a fix for the actual code. expect a minor update soonish; but I'd feel better about it if I knew how to reproduce the problem in-game, both to verify the fix and to learn "what wrong assumption did I make that caused this" so that I can watch for it in the future.

So, a call to action:  has anyone been getting NullReferenceException in BetterBurnTime?  Any bug reports much appreciated!

Edited by Snark
Link to comment
Share on other sites

Released v1.1.2.  This is a minor bugfix update to avoid an occasional crash-with-NullReferenceException that has been reported.

I'm guessing it's a rare event, since I haven't run into it myself, so you don't need to go to the trouble of updating unless you've been getting NullReferenceException errors in the mod.

Link to comment
Share on other sites

  • 2 weeks later...
On 11/21/2015 at 5:28 PM, Snark said:
  • When the ship is in vacuum and on a collision course with the ground, it will automatically show time-to-impact, and the estimated burn time to kill your velocity at ground level.

Thank you for a very pleasant surprise! I installed this mod without reading the whole OP simply to get the "N/A" to go away, and suddenly a helpful little suicide burn indicator popped up! It took some guessing to figure out which mod was even adding it. KER? No. NavHUD? No...

Also agreed with your appreciation of NavBallDockingIndicator. Its competitor's higher download count might have something to do with there being tutorials that explain how to use all the pieces of it as if it was an independent minigame; the simpler one requires a bit more experience and understanding of what docking is about, I think.

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