You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi! I plan to develop an addon for KSP for maneuver planning and execution as my term paper in the university (I'm a software engineer student). Overall, it will enable users to plan their maneuvers by simply entering their desired orbital parameters, and then execute them automatically (like MechJeb does). Under the hood I plan on using differential corrector (like in NASA's GMAT tool) for finite burn maneuver targeting, and some analog of Space Shuttle's PEG for execution. While it is pretty straightforward to implement in a vanilla game using stock KSP API, there are some problems with this magnificent addon, Principia.
Proposition
Since under the hood Principia uses it's own maneuver planner and completely overrides game's physics, a lot of stock API functions become useless (i.e. Planetarium.right returns anything but the solar prime vector).
As I understood from #2144 there were already plans to open up maneuver planner for external addons, but they never came to fruition.
So, in order to support external plugins like mine to do their work, I propose some additional API methods, which, as I understand, either already had somewhat been implemented before, or are used internally by Principia's C# connector.
Design
Here I list some API methods which I propose to be implemented on Principia's side, along with their signatures. Now, as I understand, some of them could be resource heavy, but I hope we can discuss what are possible workarounds and solutions to this problem.
Reference frames
Since stock KSP reference system is basically gibberish, I think it would be best for all API methods to work in J2000eq reference frame, or, which is even better, to support a list of different reference systems via some kind of enum as a method parameter maybe?
General
//returns SolarPrimeVector of the solar system in KSP's stock reference frame (purely for conversion purposes).XYZSolarPrimeVectorGet()
Vessels
//same as XYZ but holds two vectors, instead of one, see furtherpublicstructStateVector{publicXYZposition;publicXYZvelocity;}
//struct containing maneuver informationpublicstructManeuver{publicdoublebeginTime;//TOIpublicdoublebeginMass;//Mass of the vessel before ignitionpublicdoubleduration;//Duration of the burnpublicdoubletotalThrust;//Total thrust of all the engines participating in the burn, in NpublicdoubletotalIsp;//Total ISP of all the engines participating in the burn, in spublicXYZburnVector;//Burn vector}
//replaces VesselGetPosition and returns position and velocity of the given vessel at UT timeStateVectorVesselGetState(stringvessel_guid,doubletime)
//same for celestialsStateVectorCelestialGetState(stringcelestial_guid,doubletime)
//Same as GetState, but take into account all maneuvers in the queue//I don't know if this is even possible given how Principia works under the hood, but it sure will be very good to have.StateVectorVesselPropagateState(stringvessel_guid,doubletime)
Maneuver planner
//get number of maneuvers int he queueintManeuverGetNumber()
//get maneuver by its number in the queueManeuverManeuverGet(intnumber)
//append maneuver to the end of the queuevoidManeuverAppend(Maneuvermaneuver)
//remove last maneuver from the queuevoidManeuverRemove()
I'm very much open to a discussion on how to best implement these methods and/or change them according to your preferences and limitations.
Consideration
I understand that, to most people, KSP is, first and foremost, the game, and while developing Principia you have made sure that it stays a game. And this proposition, in pair with my addon, will remove probably one of the biggest and most important mechanics from it. While this is true, I also believe that some people find the beauty of this game in something else entirely. I personally spent countless hours playing KSP with RSS/RO installed, developing kOS plugins and libraries to support my missions, calculate maneuvers and execute them the way I want. It improved my coding skills, teached me about orbital mechanics way deeper than the vanilla game, and I very much enjoyed it. And i believe i'm not alone. So to some people, like me, this proposition will help to make KSP even better, especially for kOS players.
Postscriptum
My apologies for any grammatical mistakes, English is not my primary language.
The text was updated successfully, but these errors were encountered:
Introduction
Hi! I plan to develop an addon for KSP for maneuver planning and execution as my term paper in the university (I'm a software engineer student). Overall, it will enable users to plan their maneuvers by simply entering their desired orbital parameters, and then execute them automatically (like MechJeb does). Under the hood I plan on using differential corrector (like in NASA's GMAT tool) for finite burn maneuver targeting, and some analog of Space Shuttle's PEG for execution. While it is pretty straightforward to implement in a vanilla game using stock KSP API, there are some problems with this magnificent addon, Principia.
Proposition
Since under the hood Principia uses it's own maneuver planner and completely overrides game's physics, a lot of stock API functions become useless (i.e. Planetarium.right returns anything but the solar prime vector).
As I understood from #2144 there were already plans to open up maneuver planner for external addons, but they never came to fruition.
So, in order to support external plugins like mine to do their work, I propose some additional API methods, which, as I understand, either already had somewhat been implemented before, or are used internally by Principia's C# connector.
Design
Here I list some API methods which I propose to be implemented on Principia's side, along with their signatures. Now, as I understand, some of them could be resource heavy, but I hope we can discuss what are possible workarounds and solutions to this problem.
Reference frames
Since stock KSP reference system is basically gibberish, I think it would be best for all API methods to work in J2000eq reference frame, or, which is even better, to support a list of different reference systems via some kind of enum as a method parameter maybe?
General
Vessels
Maneuver planner
I'm very much open to a discussion on how to best implement these methods and/or change them according to your preferences and limitations.
Consideration
I understand that, to most people, KSP is, first and foremost, the game, and while developing Principia you have made sure that it stays a game. And this proposition, in pair with my addon, will remove probably one of the biggest and most important mechanics from it. While this is true, I also believe that some people find the beauty of this game in something else entirely. I personally spent countless hours playing KSP with RSS/RO installed, developing kOS plugins and libraries to support my missions, calculate maneuvers and execute them the way I want. It improved my coding skills, teached me about orbital mechanics way deeper than the vanilla game, and I very much enjoyed it. And i believe i'm not alone. So to some people, like me, this proposition will help to make KSP even better, especially for kOS players.
Postscriptum
My apologies for any grammatical mistakes, English is not my primary language.
The text was updated successfully, but these errors were encountered: