-
-
Notifications
You must be signed in to change notification settings - Fork 13
Graphing Techniques in Mission Architect
If you want to provide visual analysis for your missions the Graphic Analysis tool can be the very useful obvious choice, but you can also get a lot of value out of the plot in the main MA window as well as from the Mission Animator tool. I've made many visualizations for my Kerbal Space Agency roleplay, and I'm going to take several examples and break down how they were made to help give others an idea of what they can do. We'll start simple.
This graph was created with the Graphical Analysis tool in two passes. Although it wasn't by design, if you happen to leave open the figure window that the tool creates at the end of a plot and tell it to create another graph, it will be plotted atop the original. This works even if you load a new project - the Graphical Analysis tool will always output to the Figure 1 window. If that window has already been created, any additional plots will go over it.
Now, if you do this with two different types of plots (first speed and then altitude, for example) that can have wildly different x/y values you won't end up with a nice combination of the two (for that you need to tell the Graphical Analysis tool to plot them together but separately using the Subplots option). However if you plot distance twice but just change the reference spacecraft or body, you'll end up with a graph shown above. Don't forget you need to manually change the line colors if you want them to vary.
The text labels were added with Paint.NET.
Here's a more complicated example based on the above concept. Here we are using the Subplot feature to have the Graphical Analysis tool output two plots per run and each time it is run we change the Reference Spacecraft and line color. Looking at both distance from our current craft and line of sight, we can determine which communications satellites will be the last to talk to us from 500km and 2,500km omni antenna ranges. Every output window has the option to show a legend, and if you unselect all cursor tools (clicking on a selected tool button will unselect it) you can double-click to edit the name of the various lines that were plotted. You can also right-click to edit the box's position and properties.
Here is an example using all the previous techniques in addition to the Marker Lines option that lets you place a horizontal or vertical reference line on the plot. If you are stacking plots note that you only have to remember to draw this reference line once, but you can draw it multiple times without issue. As of right now the reference line color cannot be changed. This plot is showing the results of finding an orbit that will place a third communications satellite as close to optimally-spaced between two others already in orbit.
Be careful when re-running the Graphic Analysis tool after it has been closed. It will re-open with default settings. If you make a plot in Mission Elapsed Time and then a second plot atop that in normal Time, your x-axis will get completely screwed up. Stacked plots need to be direct comparisons from a single point of reference. Since this isn't an actual feature, there's no support to Undo a plot if you mess up.
Mission Architect gives you a small plot window to show you trajectories, but if that's not big enough for you then you can click the Pop Out Orbit Display button below it and get a separate figure window that can be resized, scaling the figure within it as well. This lets you put a lot into a single figure and be able to make it large enough for it not to look jumbled.
The above image was created from SFS states that were saved after every time the craft was loaded in the game. Looking at the Mission Architect event window you would basically see Set State -> Coast -> Set State -> Coast -> Set State -> Coast etc, etc. The lines from similar state coasts were colored the same. Because there wasn't just one line per state, the built-in legend box showed every line rendered and thus was not usable and one was created in Paint.NET instead.
If you are meticulous is saving your game states, you can show the actual spacecraft trajectory as in the above image rather than the planned trajectory you may have originally created in Mission Architect. There's no built-in support for showing actual trajectories however so you need to manually load and coast through all the states. I find it easiest to load all the states from SFS files first, then start at the bottom and work up adding in the Coast to UT states in between, using the UT copied from the next Set State.
These orbits all represent a single object, in this case a captured asteroid around Kerbin that was caught by Mun and is still influenced by its presence every so often when they pass close enough for the asteroid to enter its SOI. I ignored showing any plot of the SOI passing and instead focused on the orbits the asteroid would have afterwards. Each orbit then is as a separate spacecraft with the Show Other Spacecraft Orbits option enabled. The options for line color and variation are limited, but I managed to add one more orbit, the thick pink one, by setting that as the orbit for the mission vehicle. Because each orbit was a single line I could use the figure legend box and just change the names. I rendered Mun's orbit also as another spacecraft so I didn't have to toggle on the Show Children of Central Body option and have the view rendered from beyond Minmus orbit. I traced it out with a thicker line in Paint.NET to make sure it was atop the other orbits and more visible.
This image doesn't seem all that significant until you realize I'm showing the actual positions of spacecraft, which Mission Architect cannot do. It can show you the orbits of other spacecraft, but not their positions relative to each other at a given time. For this, we turn to the Mission Animator tool, which gives you the option to render other spacecraft and includes position markers for them as well as their orbits. We can set both the Camera Source and Camera Target to Central Body, the Az. Offset to 90 and the El. Offset to 89 and have the same top-down view as selecting Go to X-Y view when right-clicking on the Mission Architect figure window. Now you just need an image editor like Paint.NET to layer a screenshot of the Mission Animator atop a screenshot of the trajectory figure (re-sizing the former as needed) and mark it.
You might think this is a composite of two images, one showing the planets at their starting position and a second showing them positioned a week later. Actually Mission Architect does this on its own when you insert a Coast event - it shows you body positions at the start and end of the event. I simply made the mission craft's orbit inside the sun so it wouldn't show up in the figure. Then I used the Recolor tool in Paint.NET to color the orbital lines between the body positions. Distances traveled were computed via the Graphical Analysis tool using the planet plotting tip.
Using the same planet-plotting technique I created this infographic. Each line color was a separate Coast to UT event that allowed me to differentiate between milestones. The only noteworthy thing about the whole image is the fact that it's black. KSPTOT can't yet create a black background for its trajectory figures in the same way it can for its graph plots. For better contrast and to remove the grid I colored the background black and re-did the line hues. To create the relative motions of the remaining outer planets I plotted their orbits similar to the previous image to get their start/end positions, then resized the figure to be very small, traced it out in Paint.NET to have a thicker line and then recolored it along the change in motion.
That's all I have so far for unique techniques. Everything else I've done has been variations on the above themes. If anyone else has cool plots they want to share, you're welcome to add them here.