Jump to content

[DISCONTINUED] DropAManeuverNode [v0.2]


Superfluous J
 Share

Recommended Posts

I have decided to discontinue this mod - as great as its name is - due to the far superior DMagic Modlet Maneuver Node Evolved. This should still work at least during the 1.2.x cycle, but I won't be updating it. It's open source, so if anybody wants to they can take over the mod.

damn_1_2.jpg

 

 

Buttons to drop a maneuver node at orbital milestones

DOWNLOAD:

SOURCE:
https://github.com/5thHorseman/DropAManeuverNode

LICENSE:
MIT

ATTRIBUTION:
This project uses Stock Toolbar integration code from KSPCasher https://github.com/armazac/kspcasher

CHANGELOG:

  • 0.2:
    • UI "overhaul" so it's not quite so ugly. More to come.
      • Buttons grouped in 3 sections
      • Window locked in place near Toolbar button (actually, where the mouse was) to simulate it being a menu.
    • An/Dn placement (Thanks DMagic, Kerbal Engineer, and random Reddit dude), both absolute and relative to target.
  • 0.1.2: Bugfix. There were multiple toolbar buttons that kept growing, and only the last worked.
  • 0.1.1: Bugfix. I had some "==" where I should have had "!=" :o
  • 0.1: Initial build.
    • Stock Toolbar support.
    • Buttons to add a maneuver node at certain orbital milestones.

BUGS:

  • You can use this mod to drop maneuver nodes even when you have no CommNet connection to Kerbin. You still can't edit those nodes, so I don't think it's that critical of a bug. Also, I have no idea how to fix it :D

TO DO:

  • Save/load settings, if necessary.
  • Blizzy's Toolbar support.
  • Detect when things are not available (like no Ap due to escape) and disable the appropriate button.
  • Detect when a maneuver node is already present at a location (Within a few seconds?) and disable the appropriate button.
  • Detect encounters with targets. Not sure how to handle this, because you generally don't want the node AT the encounter. Maybe X (settable) minutes before it?
  • Better UI
  • "Modify Current Node" button or mode.
  • Look forward past SOI changes, allow to set nodes on future trajectories.
  • Look forward past other Maneuver nodes, allow to set nodes on future projected paths.
  • Allow both of the above at the same time.
  • Basic thrust options like "circularize" or "match tilt" or "kill velocity"
  • "Undo" (may be difficult or impossible)
  • Automation options, like "place a circularization burn at Ap whenever you leave atmosphere."

DONATIONS

I do not need donations, but if you want to contribute, please donate to SpaceDock:

patreonSD.png

Edited by 5thHorseman
Discontinuing Mod
Link to comment
Share on other sites

4 minutes ago, Trann said:

Here's hoping this helps me drop a node on the current path when the current cursor-driven method wants it on the projected path next to it!

That (And when the game won't let you put one down at all) was actually the impetus for this mod. I don't know for a fact that it'll work, but I think it will.

The other stuff just kinda started flowing into my brain as I coded this. :)

Edited by 5thHorseman
Link to comment
Share on other sites

20 minutes ago, panarchist said:

Brilliant!  One suggestion, is it possible to add links to drop a maneuver node at Ascending Node and Descending Node?

That's high on my want list, but I'm not sure if the game just gives those to you. I was kinda hoping they were Transition1 and Transition2 but I've not had time to test those. Those might be SOI transitions, which isn't bad (Many people like to tweak approaches just after an SOI change) but I'd prefer them to be An/Dn. I'll be actually testing that tonight.

I'm not averse to calculating them, but I barely got this working in its current state. It may be a while :)

Link to comment
Share on other sites

Build 1523.  A new tool bar button is generated each time I switch ships.  After switching back and forth a few times to confirm the circumstances of this, I had four:

b5F0B2g.png

At each switch, only the lowest (freshest?) toolbar button worked; the rest did nothing.

Link to comment
Share on other sites

Hmmmm.

44 minutes ago, Trann said:

Build 1523.  A new tool bar button is generated each time I switch ships.  After switching back and forth a few times to confirm the circumstances of this, I had four:

b5F0B2g.png

At each switch, only the lowest (freshest?) toolbar button worked; the rest did nothing.

Hmmmm. I saw that when I was playing around with trying to get it working in the tracking station (wouldn't that be cool) but not since, and I'm fairly certain that didn't make it into the main build. But hm. Thanks for the report. Not sure what's going on there but I'm sure it's my fault :D

Link to comment
Share on other sites

7 hours ago, 5thHorseman said:

Hmmmm.

Hmmmm. I saw that when I was playing around with trying to get it working in the tracking station (wouldn't that be cool) but not since, and I'm fairly certain that didn't make it into the main build. But hm. Thanks for the report. Not sure what's going on there but I'm sure it's my fault :D

To get it working in the tracking station, amend the line I gave you to start it in flight (will give you full code later, on my phone atm)

Not sure if you can add nodes there though

Edited by severedsolo
Link to comment
Share on other sites

12 hours ago, 5thHorseman said:

That's high on my want list, but I'm not sure if the game just gives those to you. I was kinda hoping they were Transition1 and Transition2 but I've not had time to test those. Those might be SOI transitions, which isn't bad (Many people like to tweak approaches just after an SOI change) but I'd prefer them to be An/Dn. I'll be actually testing that tonight.

I'm not averse to calculating them, but I barely got this working in its current state. It may be a while :)

When in doubt, look to Engineer. :sticktongue:

But since KER is a little round-about in some of its calculations:

		Vector3d nodeAsc = Vector3d.Cross(TargetOrbit.GetOrbitNormal(), ShipOrbit.GetOrbitNormal());

		double anomalyAsc = ShipOrbit.GetTrueAnomalyOfZupVector(nodeAsc) * Mathf.Rad2Deg;

		double timeAsc = ShipOrbit.GetDTforTrueAnomaly(anomalyAsc * Mathf.Deg2Rad, ShipOrbit.period);

To get the descending node just switch the OrbitNormals in the first calculation. Also note that the time might be negative, so you would have to add the orbital period to get the next node instead of the last node.

Link to comment
Share on other sites

Now that I've gotten to play around with this a bit, I have to say this is totally awesome - Fiddling with the node to set it right on Apoapsis or Periapsis has always been a real annoyance, and this makes it ridiculously easy to just plop a node down, tweak the Delta-V, and move on.  Seems rock solid, the only issue I noticed was the duplication bug, thanks for fixing that.

Link to comment
Share on other sites

12 hours ago, DMagic said:

When in doubt, look to Engineer. :sticktongue:

But since KER is a little round-about in some of its calculations:

		Vector3d nodeAsc = Vector3d.Cross(TargetOrbit.GetOrbitNormal(), ShipOrbit.GetOrbitNormal());

		double anomalyAsc = ShipOrbit.GetTrueAnomalyOfZupVector(nodeAsc) * Mathf.Rad2Deg;

		double timeAsc = ShipOrbit.GetDTforTrueAnomaly(anomalyAsc * Mathf.Deg2Rad, ShipOrbit.period);

To get the descending node just switch the OrbitNormals in the first calculation. Also note that the time might be negative, so you would have to add the orbital period to get the next node instead of the last node.

Thanks for these, but I actually found calculations on Reddit last night and "DAMN-ized" them into this:

        public double timeToAN(Orbit orbit)
        {
            double time = orbit.GetDTforTrueAnomaly((360.0 - orbit.argumentOfPeriapsis) * UnityEngine.Mathf.Deg2Rad, orbit.period);
            return time < 0.0 ? time + orbit.period : time;
        }

        public double timeToDN(Orbit orbit)
        {
            double time = orbit.GetDTforTrueAnomaly((180.0 - orbit.argumentOfPeriapsis) * UnityEngine.Mathf.Deg2Rad, orbit.period);
            return time < 0.0 ? time + orbit.period : time;
        }

And they work great, for absolute An/Dn. They do not though tell me though what most of us want, which is An/Dn between the current vessel and a target vessel. Though I suppose you could use it on both to get both Equatorial :D

From what I'm reading this is (relatively) easy to do, I'm just way too far removed from orbital calculations (not to mention college in general) to wrap my brain around it. Anybody either just have the code (or can find it in KER, which as DMagic alludes to is a bit roundabout in its structure) or understand the concepts enough to dummy it down, I'm all eyes :)

WAIT. A. SECOND. I may have misunderstood you (As I said, I'm rusty at math). I'm'a try what you got right now.

Edited by 5thHorseman
Link to comment
Share on other sites

0.2 is out!

  • 0.2:
    • UI "overhaul" so it's not quite so ugly. More to come.
      • Buttons grouped in 3 sections
      • Window locked in place near Toolbar button (actually, where the mouse was) to simulate it being a menu.
    • An/Dn placement (Thanks DMagic, Kerbal Engineer, and random Reddit dude), both absolute and relative to target.

Link to comment
Share on other sites

27 minutes ago, Rodger said:

Nice, looks like this will become a standard mod for me!

But am I missing something obvious, or is there not a compiled version of 0.2 available for download?

 

19 minutes ago, Trann said:

Github shows only source code, not GameData zip offered?

Ooops my newbie is showing. I forgot to upload it. :-}

It's there now.

Link to comment
Share on other sites

Some suggestions for features:

  • The ability to add a maneuver node after an existing maneuver node (e.g. if I have one maneuver node that raises my apoapsis then I just click a button to add a maneuver node where the new apoapsis will be).
  • The ability to add a maneuver node at the periapsis after an SoI change (e.g. I'm on my way around the sun towards a Duna encounter; I click a button to put a maneuver at my Duna periapsis).
  • The combination of the two above (e.g. I'm still in orbit of Kerbin with a maneuver to send me to a Duna intercept;  I click a button to put a maneuver at my Duna periapsis).

For the second you'll probably need to iterate through the list of encounters to build out the menu dynamically (for when there are multiple encounters).

Also, I've done support for Blizzy's Toolbar before, so I can put together a pull request for you once 1.2 is out.

Link to comment
Share on other sites

2 minutes ago, nathan1 said:

Some suggestions for features:

  • The ability to add a maneuver node after an existing maneuver node (e.g. if I have one maneuver node that raises my apoapsis then I just click a button to add a maneuver node where the new apoapsis will be).
  • The ability to add a maneuver node at the periapsis after an SoI change (e.g. I'm on my way around the sun towards a Duna encounter; I click a button to put a maneuver at my Duna periapsis).
  • The combination of the two above (e.g. I'm still in orbit of Kerbin with a maneuver to send me to a Duna intercept;  I click a button to put a maneuver at my Duna periapsis).

For the second you'll probably need to iterate through the list of encounters to build out the menu dynamically (for when there are multiple encounters).

Also, I've done support for Blizzy's Toolbar before, so I can put together a pull request for you once 1.2 is out.

  • That first will have to wait until after a UI change. It may require its own UI change in fact. I like the idea though.
  • The second should be possible, and I too would like it. It may also require some UI tweaking. It may be better in a "move the current node" section. Place it on the Pe, then move it to the next Pe. Or if you say Pe and the next one IS that one, it could just do it.
  • That third one is just crazy. I'll see what I can do, but I personally wouldn't us it as I find multiple nodes (especially those across SOI boundaries far away) to be just too finicky. You end up having to re-do them anyway.

Oooh my first pull request. I will happily take the help, though I may need help on merging it as I've never actually done that before :D

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.

 Share

×
×
  • Create New...