Jump to content

[WIP] Transfer Window Planner


TriggerAu

Recommended Posts

Transfer Window Planner - An in game implementation of Launch Window Planner

or Mmmmm Porkchops in-game


Now that I have ironed out some coding bugs and also taught myself a bunch of Maths I thought it was probably time to share what I have been plugging away on for a few weeks.

I've always been a fan of Alexmun's Launch Window Planner WebApp (forum thread) to give you a really good visualisation of the "best" time to launch interplanetary missions. With the Alarm Clock mod though it has always been a bit of a chore to create the alarms from the webapp (especially with my typo heavy fingers).

Anyway - I know people prefer pretty pics, so heres me fiddling with the latest build I have - yelow markers around the porkchop indicate values for the selected transfer (the DV one is broken in this video)

https://www.youtube.com/watch?v=7mEpuVmK5bI

Alex was kind enough to help out (a lot) by providing the heavy lifting part of the code in C# so I could then get out the info portions of the transfer and wrap it in an interface so it can be in-game. The current plans I have are:

  • Complete at least the Ballistic transfer model
  • Runs entirely on background threads so should have a small impact in game and not cause a UI lockup
  • Ensure it works for non-Standard Universes - RSS is the big one here and so far all good
  • Some way to put the transfer details on the clipboard for easy access in other plugins/apps
  • Fiddle with the colors/layout/symbols

And my stretch goal is an API connection to KAC - if I ever get off my backside and finish v3 - well TBH if I can stop getting distracted by new ideas :)

I see this mod being pretty straightforward in doing one purpose only, and theres a bunch of tweaks and tidying I need to do, but I'm really interested in peoples feedback of:

  • the layout, which parts are where, size of chart, etc
  • What Scenes it would be useful in - I was thinking of simply using the APPLauncher if I can (with toolbar options) - so KSC, Flight, Map - although if its useful in TS then let me know
  • Anything else?

Link to comment
Share on other sites

I'm certainly already in love with this new coming add-on, and by heritage with your previous ones, I expect another masterpiece :).

Up to now, everything shown seems nice and valid, my feedback would be you're on the right track so please keep it that way.

However, one feature that certainly would be great to have, is to link the transfer orbit parameters to the current orbit of a vessel, and directly bring the required burn vector as a new maneuver node in KSP.

The above feature is actually already provided by another excellent tool, KSP TOT by Arrowstar, though that one is an external app running in a Matlab runtime instance and linked to KSP for the required data exchanges.

Link to comment
Share on other sites

This looks awesome! I don't know that you'd need to see the window anywhere but the flight screen and the map screen. Maybe have an option, after selecting a transfer, to make the window compact: just showing the characteristics you'd need to set up a maneuver node.

It would be nice to also have API hooks for other mods, for example:


if (TransferPlanner.SelectedTransfer != null)
{
if (TransferPlanner.SelectedTransfer.Prograde > 0)
{
// blah blah blah
}
}

Link to comment
Share on other sites

This looks awesome! I don't know that you'd need to see the window anywhere but the flight screen and the map screen.

Respectfully, I disagree. It's useful to have it in the Space Center view and the VAB, because the porkchop plot gives you the Delta-V needed, and you can then go into the VAB and design the craft for the mission at hand. A potential useful scenario:

It's Day 43, and I have a ship stuck in Duna orbit with 6 kerbals and only X days of TAC-Life Support remaining. I pull up the tool and check the porkchop plot - 9.5kps results in a transit time where all my kerbals are dead before resupply gets there, but 11kps gets me there a week before everything runs out. Now I can go into the VAB and design a rocket (with Engineer or VOID or another tool which tells me my rocket delta-V) according to the Delta-V needs of the mission.

Otherwise, I'd need to put a capsule on the launchpad and go into flight mode to get a plot.

TriggerAu - this is an awesome idea! No more Alt-tabbing between the game and my browser! Looking forward to the eventual release.

Link to comment
Share on other sites

Wow, amazing that this was just posted today!

++ That you are building it such that it works with RSS, that is where I truely can't plan a transfer if my life depends on it! Might have something to do with the planet inclinations, Earth equator offset, etc.

It would be amazing if this could also help plot flyby (and return!) missions for manned space flight in RSS, but I am not sure if the original was able to help with that.

It would also be amazing if it can generate a Maneuver Node from the data.

I will keep a close eye on this thread, as it will really help me up my RSS game!

Link to comment
Share on other sites

To Answer a few questions:

  • Custom Orbits/Planets/etc - All the calcs in the tool are done from the gameobjects when you click plot - so you could hyperedit a planet and it should change as you'd expect. I have tested RSS and can see the very different charts for transfers and durations, but I havent test flown any missions yet. The results do align with other tools out there for RSS and Stock games though so I am fairly confident they are right.
  • API Visibility of Data - Sounds like a cool idea and should be simple - consider it on the list
  • Visibility of App - From the few response here I am leaning towards making it available wherever people want it. So that probably means all scenes via AppLauncher and Toolbar (although that does mean that in the current AppLauncher setup you wont see it in TS without Toolbar)
  • App Form Factor - Good point re the Details/VAB etc, some form of summary view once you select a transfer sounds a good idea, will see how easy that is to do for a first release

and now the more difficult ones:

  • Visit and Return Plot - I'm sure thats possible, but I will need to get in my head how to present the options and what you'll need to configure - eg, departure date - duration of stay and how to aggregate the info
  • Using Vessel Orbit and creating Man Node - This one I'm not sure about, as the math is probably above my level to work out, but I'll note it down and see if its possible to either do or lean on someone else to help with

Keep the comments/questions coming

Link to comment
Share on other sites

Looking awesome. :)

The math for creating the maneuver node shouldn't be too bad; you can use MJ's code to plot where (aka when) on the orbit your ejection angle matches the required one, and then just use trig to calculate the components based on the inclination-angle and magnitude of the ejection kick the plotter already gives you.

Link to comment
Share on other sites

Looking awesome. :)

The math for creating the maneuver node shouldn't be too bad; you can use MJ's code to plot where (aka when) on the orbit your ejection angle matches the required one, and then just use trig to calculate the components based on the inclination-angle and magnitude of the ejection kick the plotter already gives you.

I think I have that bit in my head... now that you typed it out for me :). The bit that I'm struggling with is if the orbit is not near circular the output plot could be substantially different to a circular one depending on where the Pe/Ap is in the orbit in relation to the Ejection angle. Eg if the vessel has a highly elliptical orbit and the ejection point is at the Ap of the DV required will be massive compared to a circle. I'm sort of stuck wondering whether it should plot something based on the semimajoraxis as an estimate and warn people of their foibles, although not sure really.

I think I'm gonna need to go back to my pencil and paper to try and sort it out in my head - and probably just run a bunch of plots to see what it does, but I probably should try and finish the fundamental first hey :wink:

Thanks heaps for the explanation there. Really helpful

Link to comment
Share on other sites

I thought alexmun's calculator assumed a near-circular orbit?

If you're opening this up to elliptical orbits, then boy howdy are you in for a world of hurt :D

Still possible, but....

Oh, and you're most welcome, though sounds like you already basically had it :)

Link to comment
Share on other sites

I agree with Krasimir on this. I'd say you should stick with (relatively) circular orbits for now, and then put out a release, then start with elliptical stuff. Not many people try to go interplanetary from an orbit more than a 100km or so off circular. As long as it works with varying inclinations, it should be great.

Link to comment
Share on other sites

I thought alexmun's calculator assumed a near-circular orbit?

If you're opening this up to elliptical orbits, then boy howdy are you in for a world of hurt :D

Still possible, but....

Oh, and you're most welcome, though sounds like you already basically had it :)

Alex Moon's calculator assumes an initial orbit with zero eccentricity and zero inclination (relative to the origin planet's equator? to the ecliptic?) The final orbit around the destination will also have zero eccentricity, but could be inclined. I'd say if you were to output maneuver nodes, you'd use the sma of the current orbit, determine the correct ejection angle to within half an orbit, and add the node assuming that the orbit is circular and un-inclined. Or maybe just have the maneuver node placer disabled if the orbit is too elliptic or too inclined.

Note also, that with the API hooks, this feature could be created/updated/improved by another modder.

Link to comment
Share on other sites

Hey Trigger I love this idea and look forward to this mod being released! Like others have said best to build it in increments. Another thought for waaay in the future is a mod that allows full mission planning so could maybe build something like Ascent Komputron into this mod

Link to comment
Share on other sites

add the node assuming that the orbit is circular and un-inclined. Or maybe just have the manoeuvre node placer disabled if the orbit is too elliptic or too inclined.

While I agree with the rest of your post, I think inclination should be included, as IIRC the reason the the web based calculator didn't have inclination was for simplicity's sake, in that the user would have to input large amounts of data that's not accessible without MJ/KER. Unless you were referring to relative inclination, in which a mechjeb-esque warning would probably do.

Link to comment
Share on other sites

Wow, going a whole mission planning thing is definitely more than I could take on I think, but I'll focus on getting the fundamentals out for now. Just working on toolbar stuff and a final screen layout at the mo

Hey yep would be a BIG project, was thinking this mod could be the starting point for a bigger collaborative project in the future, maybe I'm just getting carried away here and that wouldn't be the first time..... ahem

Whatever be absolutely fantastic to be able to plan transfer windows properly in game, online tools are great but in game tools are in even better. :D

Actually I keep meaning to learn Unity & C# and have a bash at modding myself just been kept so busy with other programming stuff I never managed to get round to it......

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