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

5 minutes ago, FullMetalMachinist said:

Happy to help! I'm actually really surprised that it was (seemingly, I have no coding experience) easy enough of an idea to implement so quickly. 

Yes, it was actually pretty simple to do.  Mainly because it only needs information that the mod already has in hand, and pretty much the only calculation it has to do is "divide by two," which turns out not to be super complicated to code.  ;)

This was one of those rare cases where the code was simple, and the idea was the main missing ingredient (which is why I was so eager to jump on it).

Of course, I kinda copped out by leaving out the countdown for time-to-impact, for complex reasons that basically boil down to "because it's hard."  It would be pretty easy for me to do a kinda-sorta, half-assed implementation, but that's really not good enough when we're talking suicide burns; get it wrong by a second or two, and folks are gonna be seriously cheesed off when their ships get scattered all over the Munscape.  I figure it's better not to provide any answer at all, than to provide one that's plausible but (lethally) not quite correct.

I'd like to add that feature, but I won't do it until and unless I can find a solution that satisfies all of the following criteria:

  • Is accurate enough that it won't cause fiery death for a significant fraction of users (now there's a snappy slogan, I really should go into advertising)
  • Doesn't require weeks of coding, or turn BBT into something as complex as MechJeb

Anyone care to start a pool for how long it'll be before someone is posting here about the "bug" that there's no countdown indicator for suicide burns? :)

Link to comment
Share on other sites

This mod has been around for a little bit now, but it's the first I've encountered it so I'm just stopping by to say well done.

The burn timer has always bugged me, to the point where I would use mechjeb just to get an accurate reading and then fly through the node myself, and I've never been great at landings precisely because I wasn't sure how much time I had left. You've solved both handily, small but badly needed changes are some of the best mods and this is a great example.

Edit: also props for supporting spacedock, that's how I saw this!

Edited by Starbuckminsterfullerton
Link to comment
Share on other sites

4 hours ago, smjjames said:

Just a thought, could you add a space between the m and the numbers for seconds for a bit easier readability?

I'd prefer not to, since I myself happen to like it without the space, which is why I coded it that way.  ;)

However, you do raise an excellent point that not everybody prefers the same format.  One thing I could do, which would be pretty easy, would be to add a configuration option for the time formatting.

In other words, the config file could have a field like "MinutesSecondsFormat" with a default value that's the current format (i.e. minutes, "m", seconds, "s"), and anyone who wants to could just edit that format string to make it say whatever they want.  If you wanted it to say "Yea verily 34 seconds upon 8 minutes" or whatever, instead of "8m34s", you could.

Thanks for the suggestion-- I'll think about rolling this in when I do my next version update.

Edited by Snark
Link to comment
Share on other sites

1 hour ago, Snark said:

I'd prefer not to, since I myself happen to like it without the space, which is why I coded it that way.  ;)

However, you do raise an excellent point that not everybody prefers the same format.  One thing I could do, which would be pretty easy, would be to add a configuration option for the time formatting.

In other words, the config file could have a field like "MinutesSecondsFormat" with a default value that's the current format (i.e. minutes, "m", seconds, "s"), and anyone who wants to could just edit that format string to make it say whatever they want.  If you wanted it to say "Yea verily 34 seconds upon 8 minutes" or whatever, instead of "8m34s", you could.

Thanks for the suggestion-- I'll think about rolling this in when I do my next version update.

Now we'll just have to see what "Yea verily" looks like in Kerbish. "Oteric ed, ís"

Thanks for continuing to extend the capability & flexibility here. This is a real treat.

Link to comment
Share on other sites

This is magnificent. The new burn timer works perfectly - and not only that, but looks like it really belongs where it is.

There are two suggestions I'd make now. 

First: the dots are really small. Might it be possible to print them in bold text - or otherwise, something to make them just ever so slightly easier to spot (and count) against a non-black background?

Second: as far as counting goes, it might be nice if the dots were red within 3 seconds and yellow within 30 seconds or maybe 1 minute - something to quickly differentiate 'time warp', 'probably time to return to normal speed', and 'finger over max throttle'.

In other words, the timer works wonderfully - already in the 'how did I ever play without this?' category - but, it would be helpful if it conveyed the information it does a little more quickly.

Thank you for this. I'm in the 'learning to pilot without MechJeb' phase, and this has made one part of that much, much more intuitive.

Edited by Gen. Jack D. Ripper
Link to comment
Share on other sites

12 hours ago, Gen. Jack D. Ripper said:

First: the dots are really small. Might it be possible to print them in bold text - or otherwise, something to make them just ever so slightly easier to spot (and count) against a non-black background?

Second: as far as counting goes, it might be nice if the dots were red within 3 seconds and yellow within 30 seconds or maybe 1 minute - something to quickly differentiate 'time warp', 'probably time to return to normal speed', and 'finger over max throttle'.

In other words, the timer works wonderfully - already in the 'how did I ever play without this?' category - but, it would be helpful if it conveyed the information it does a little more quickly.

Hmm.  Another interesting problem.  Two issues here:

  • Once again, it's the different-strokes-for-different-folks problem.  I'm ultra-leery of UI clutter, I myself like a really unadorned UI and am very paranoid about something that has a "loud" visual presence.  On the other hand, other folks really want to use this timer and would like to have it be nicely visible.
  • I really don't want to use color for conveying vital information.  Lots of folks out there are color-blind.

...So it seems to me that the answer, once again, is configurability.  Give it some "reasonable" behavior by default, and add a configuration setting that users can tweak.

How about if I did like this:  Instead of having a boolean "ShowCountdown" setting like I do now, I instead have a "CountdownText" setting, where you can put in anything you like.  The text is parsed as some number of "words" (non-whitespace contiguous sequences) separated by whitespace.  When the mod needs to display the countdown, it just displays the text you supply, truncated to the appropriate number of "words" based on how much time remains.

So for example, I could make the default value of this setting be something like this, to give that sense of escalating urgency you describe:

<string name="CountdownText">● ● ● • • • • · · · · ·</string>

If you want it BIG AND LOUD, you could do something like,

<string name="CountdownText">■ ■ ■  ■  ■  ■  ■    ■    ■    ■</string>

If you want a shorter countdown, just provide fewertokens in the string:

<string name="CountdownText">Eeny Meeny Miny Moe</string>

...the above would show nothing until you get to 5 seconds.

If you want to totally disable the countdown timer, you'd just set the option to an empty string.

Here are some samples (against various backgrounds) of how it would look, using the first example string I gave above:

wi7Ok2S.png4HXAxXH.pnglhvYPo5.png

The timing for the countdown increments would be revised:  1, 2, 3, 5, 10, 15 seconds, then doubling thereafter (30s, 1m, 2m, 4m, 8m) up to however many dots are configured.

 

Thoughts?

Edited by Snark
Link to comment
Share on other sites

The thing that immediately came to mind is a start signal for a drag race - or the old arcade game "pole position" -- a 3-2-1-0 countdown with lights & sounds: "Boop. Boop. Boop. BEEEP!"

Would adding (optional) audio cues be out of the question?

Simple sound clicks or beeps could reenforce the visual countdown, yet still seem out of the way and de-cluttered. It would be spot-on for configurability to just drop in whatever audio clip is desired for the lead-in and final sounds (or even a spoken countdown?) and it provides yet more ease-of-use and accessibility, eliminating the "problem" of the dots being too small.

Link to comment
Share on other sites

13 minutes ago, Beetlecat said:

Would adding (optional) audio cues be out of the question?

Simple sound clicks or beeps could reenforce the visual countdown, yet still seem out of the way and de-cluttered. It would be spot-on for configurability to just drop in whatever audio clip is desired for the lead-in and final sounds (or even a spoken countdown?) and it provides yet more ease-of-use and accessibility, eliminating the "problem" of the dots being too small.

That's not a bad idea, but I think audio's not gonna happen, at least for a while... mainly 'coz that would require me to actually learn how to put sounds in the thing.  :)  I'll take it under advisement for possible future tweaks.

Edited by Snark
Link to comment
Share on other sites

Just now, Snark said:

Yeah, I think audio's not gonna happen, at least for a while... mainly 'coz that would require me to actually learn how to put sounds in the thing.  :)  I'll take it under advisement for possible future tweaks.

Ha! Well it was just an idle thought after seeing the countdown dots. Plus daydreaming about putting silly sound effects in for the countdown. ;)

Link to comment
Share on other sites

Two (well, one might not actually be a bug) bugs that I've noticed, one is a stock thing and the other is a mod interaction.

1. When on EVA, the timer shows as n/a. I guess this might be intentional as it doesn't read RCS engines.

2. I'm using Strategia and have the Pilot Focus III active which increases the engine ISP by 2% or so when a pilot is onboard, the bug here is that the estimated time seems to be based on the engine when it doesn't have the bonus. Seems like BBT should be able to see the change because MJ is able to see it in the deltaV readout and you said that it goes by thrust or something. I'm also not sure how well it works with tweakscaled engines. Still, since the ISP number is right there to read, it shouldn't be too hard to take it into account.

Link to comment
Share on other sites

21 minutes ago, smjjames said:

1. When on EVA, the timer shows as n/a. I guess this might be intentional as it doesn't read RCS engines.

Didn't even realize you could have a maneuver node on EVA.  I guess that's new with the 1.0.5 EVA navball?  Thanks for the heads-up, will take a look.

21 minutes ago, smjjames said:

2. I'm using Strategia and have the Pilot Focus III active which increases the engine ISP by 2% or so when a pilot is onboard, the bug here is that the estimated time seems to be based on the engine when it doesn't have the bonus. Seems like BBT should be able to see the change because MJ is able to see it in the deltaV readout and you said that it goes by thrust or something. I'm also not sure how well it works with tweakscaled engines. Still, since the ISP number is right there to read, it shouldn't be too hard to take it into account.

Hmm.  No idea what's going on there.  BBT doesn't do anything fancy there, it just asks the engine "what's your Isp" and goes from there.  If the Strategia mod simply updates the Isp, then this ought to "just work" with no special code in BBT.  On the other hand, if it doesn't do that, not sure how MJ would see it.

Here's the BetterBurnTime code where it happens.  It's simply pulling the engine's Isp.  This gets called on every physics update, so any run-time changes to the engine's Isp ought to get immediately picked up and reflected in the display.

...rummage rummage... find Strategia thread... (a request to the Gentle Reader, if you ever refer to a mod, could you please link it? would save me archaeology) ... okay, there it is... find the source code link...

Okay, looks like this code is where Stategia tinkers with Isp.  Hmm, interesting... it's not touching the base engine Isp at all, it's just adjusting the atmosphere curve to give a different value for vacuum.

Hmm.  Okay, I guess that makes a certain amount of sense.  I assume that it works for Strategia because when the game is actually draining fuel out of engines, it must always go to the pressure curve for the Isp, rather than using the base Isp directly.  So something that tinkers with the atmosphere curve for vacuum wouldn't get picked up by my mod.  I'll need to look into this, but it sounds like it ought to be fixable-- I just need to make BBT get the Isp from the curve rather than from the base Isp of the engine.

Edited by Snark
Link to comment
Share on other sites

You'd have to ask nightingale about it since I don't know how the bonus is applied. It's being applied in a way that MJ is able to see it (MJ does it's own calculations for maneuver node times) but BBT isn't able to.

On the EVA thing, I didn't make a maneuver node (haven't tried to actually), I was just flying around. It might have been because the 'time to impact' countdown was going.

Link to comment
Share on other sites

24 minutes ago, smjjames said:

You'd have to ask nightingale about it since I don't know how the bonus is applied. It's being applied in a way that MJ is able to see it (MJ does it's own calculations for maneuver node times) but BBT isn't able to.

On the EVA thing, I didn't make a maneuver node (haven't tried to actually), I was just flying around. It might have been because the 'time to impact' countdown was going.

Ah, gotcha.

With regard to Strategia, I strongly suspect that the above issue is it.  It's a one-line fix in BBT, I just need to say "engine.atmosphereCurve.Evaluate(0)" rather than "engine.realIsp" when I want to get the vacuum Isp for the engine.

For the EVA-kerbal thing, it didn't even occur to me when writing BetterBurnTime that it would end up getting displayed for EVA.  That won't be a one-line fix, but I expect it should be pretty straightforward-- basically, I should just put a check in there somewhere "are you a kerbal" and simply turn off all burn-time estimation in that case, while leaving time-to-impact or time-to-closest-approach in place.

I'll put the Isp fix in with my next version update.  I'll save the EVA-kerbal thing for a bit later, since I have some changes in mind for improving BBT compatibility (or at least, reducing incompatibility) with mods like Nuclear Rockets and Real Fuels, and the logic will be similar; those fixes will dovetail nicely together.

Link to comment
Share on other sites

16 minutes ago, Starbuckminsterfullerton said:

I like the bigger indices, and more customization is always good. I like that you set it up to use however many indices are present. Does the spacing matter, can I do like so?

<string name="CountdownText"> | | | | |||||</string>

The answer is "basically, yes," you can do that, and it will respect your whitespace choices. :)

However, the specific example you give would need a little tweaking, if I'm correctly divining your intent.  My idea is that the countdown "parser" would interpret a consecutive series of non-whitespace characters as a single "token", and you haven't included any whitespace in those last several |'s, so if you literally used the above string, here's what you'd get as it counts down:

  1. | | | | |||||
  2. | | | |
  3. | | |
  4. | |
  5. |

...where the ||||| drops out all at once at the 10-second mark.  I assume that that's not what you want, but rather, for one | at a time to drop out, starting at 2 minutes (or more, if you include more |'s).

So to get what I assume you're aiming for, you would do something like this:

<string name="CountdownText">|   |   |   |   |  | | | |</string>

(note that there's at least one space between every item)

Bearing in mind that it'll look a little different on-screen, since it's drawn in proportional-width font, not fixed-width such as the "code" examples above.  So on the screen, the example I've given would look something like this:

|   |   |   |   |  | | | |

Does that capture the flavor of what you want?

(If you're wondering "why do I have to have whitespace?" ... that allows folks to have multi-character tokens, if they're so inclined.  Also, my on-screen experiments tended to show that putting things right next to each other without any space at all tends to be unreadable anyway.)

 

Link to comment
Share on other sites

Thanks for the detailed response! That's exactly what I meant, and now I fully understand how you're parsing the pip strings. 

Because the system you've implemented allows for multi-character marks, you could even conceivably use the actual numbers:

1 2 3 5 10 etc. Which would be stupid, because you already have an eta written out right below it. But it's cool that you can!

Maybe I'll make the last one say "FLOOR IT" or something...:D

Edited by Starbuckminsterfullerton
Link to comment
Share on other sites

3 hours ago, lajoswinkler said:

Thanks to spacedock.info for informing me about this mod. I had no idea it existed and I have no clue why the stock game constantly refuses to show proper values. It's a simple thing being neglected for ages. Good work.

Thanks!

I agree that the stock navball indicator could really use some love (it's why I set out to write this mod in the first place!), and it's been that way for ages.  However, I'm not inclined to ding Squad too much for it-- I think the current state of affairs is fairly understandable.

As I discovered after I got into writing BetterBurnTime... improving the burn time display is actually not such a simple thing.  There's a lot of complexity under the hood, behind that simple indicator.  The post I just linked to lists some of the complexity I ran into right away, even when I was first writing it; and various other problematic edge cases have come up since then.  And there are still cases (notably, mods that do significantly "interesting" things to the way engines work) that give my mod the collywobbles, to the point that the experience is significantly worse than the stock indicator.

If Squad were going to put a solution into the stock game, they'd have to operate under constraints that I, as a mod author, don't have to deal with.  They have to make sure it works in every case.  They have to hold it to a higher QA standard than I do.  There are whole classes of problems which I (as a mod author) have the freedom to blow off by saying "if you don't like it, don't use my mod", which stock features can't do.

To take just one example:  I don't have to worry too much about inter-mod compatibility.  Yes, I would like everyone to be able to use my mod.  Yes, if there's some significant, popular mod that gives BetterBurnTime indigestion (e.g. Real Fuels, or Nuclear Rockets), I'd love (if possible) to make my mod more robust and be able to handle them.  But I don't have to.  My focus is "give a better experience for most users," not all users.  (Actually, if I'm being totally honest, my real focus is "give a better experience for me", and if other folks can also benefit thereby, so much the better.)  ;)   When I'm designing my mod, I can design for the majority use case without sweating too much about "is there a chance that it may be incompatible with some other mods".  That's a huge load off my back.  It means I have the freedom to make a deliberate tradeoff:  add power and usefulness to my mod, at the possible expense of making it less robust at dealing with the unexpected (such as interactions with other mods).

The stock indicator is certainly simple, and crude, and less powerful than mine... but it's also nearly goof-proof.  Its very simplemindedness makes it virtually immune to the vagaries of modding, and it works with practically everything.  And that's a feature that the stock game has to care a lot about, I think.

So yeah, I'd love to see the stock indicator get better, but I don't blame Squad too much for it.  What they have is a simple thing that works basically OK, if not ideally perfect; and it's very very reliable under practically any conditions, and requires very little in the way of QA testing.  And making it better would require a large investment of engineer time.  And they're a tiny company with lots to do in KSP.  If I were working at Squad myself, and I had to decide on that tradeoff-- "do I spend a lot of engineer time to make a small incremental improvement on something that mostly works and is reliable, or do I go and add <other big feature that everybody has been screaming for>", I expect I'd probably choose the latter.  Better burn time would be great, but "reentry heat" or "better aero" or "Unity 5" (not to mention a slew of others) are more urgent, IMHO.

 

Link to comment
Share on other sites

Hi all,

Just a note that I've released version 1.3.1, with the following changes:

  • Customizable time format strings
  • Customizable countdown indicator (as discussed above)
  • Changed the default appearance of the countdown indicator (thanks to @Gen. Jack D. Ripper for the usability suggestions)
  • Fixed the Strategia Isp bug that @smjjames pointed out

The new face of the countdown indicator:
drUkSRR.png

Enjoy!

Edited by Snark
Link to comment
Share on other sites

46 minutes ago, smjjames said:

Still borked for Strategia when Pilot Focus III is active, then again, @nightingale said that the ISP bonus thing is broken and not working the way it should (way OP) right now anyway.

I started the burn at around -1min 30sec.

In that case I'd suggest waiting until the dust settles at Strategia and it's a known stable situation before trying to chase down further issues in BBT-- need to be sure whether it's a Strategia bug or a BetterBurnTime bug.

I looked at the screenshot, but there's so much data there that my head kinda exploded and I don't know what I'm looking at.  A useful "bug report" for me would be something like this, with all the blanks filled in:

"I have a ship of initial mass __ tons (before my burn) that gets __ kN thrust with an Isp of __ s.  I set a maneuver node that is __ m/s.  BetterBurnTime tells me that the burn should take __ seconds, but actually it is taking __ seconds."

Edited by Snark
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...