Jump to content

[1.12.x] Kerbal SlingShotter Reslung - Visualize ship and all planet/moon positions at a selected time


linuxgurugamer

Recommended Posts

Well, after getting past the nullref issues, I ran into the performance impact in the tracking station that's been discussed earlier in the thread, and it motivated me to finally install Visual Studio to take a shot at fixing it.  :)  I've submitted a merge request with some refactoring in SlingshotCore that resolves the performance problems.

BTW @linuxgurugamer, I noticed that in the mod's update for 1.4.1, the textures were moved from SlingShotter/Textures into SlingShotter/PluginData/Textures, but SlingshotCore.Start() still tries to load "SlingShotter/Textures/body", which doesn't exist anymore.  The result is that the green circles for planet/moon positions don't appear anymore.  I didn't address that in my merge request, partly because it's unrelated to the performance fix, and partly because I'm not sure what the correct fix is.  (Changing the code to load "SlingShotter/PluginData/Textures/body" didn't work when I tried it; I think PluginData is special somehow but I don't know the details.  Moving the texture out of PluginData works, but presumably you had a reason for putting it there.)

Link to comment
Share on other sites

9 minutes ago, Wyzard said:

Well, after getting past the nullref issues, I ran into the performance impact in the tracking station that's been discussed earlier in the thread, and it motivated me to finally install Visual Studio to take a shot at fixing it.  :)  I've submitted a merge request with some refactoring in SlingshotCore that resolves the performance problems.

BTW @linuxgurugamer, I noticed that in the mod's update for 1.4.1, the textures were moved from SlingShotter/Textures into SlingShotter/PluginData/Textures, but SlingshotCore.Start() still tries to load "SlingShotter/Textures/body", which doesn't exist anymore.  The result is that the green circles for planet/moon positions don't appear anymore.  I didn't address that in my merge request, partly because it's unrelated to the performance fix, and partly because I'm not sure what the correct fix is.  (Changing the code to load "SlingShotter/PluginData/Textures/body" didn't work when I tried it; I think PluginData is special somehow but I don't know the details.  Moving the texture out of PluginData works, but presumably you had a reason for putting it there.)

Ok, thanks.

I'll fix the textures thing, the issue is that the way Unity is loading images, it tries to compress them and fails.  Apparently I missed one place, I'll get it fixed.

Edit:  I'm replacing the GameDatabase.Instance.GetTexture call with ToolbarControl.LoadImageFromFile, which doesn't mess with compression

Edited by linuxgurugamer
Link to comment
Share on other sites

33 minutes ago, Wyzard said:

Well, after getting past the nullref issues, I ran into the performance impact in the tracking station that's been discussed earlier in the thread, and it motivated me to finally install Visual Studio to take a shot at fixing it.  :)  I've submitted a merge request with some refactoring in SlingshotCore that resolves the performance problems.

BTW @linuxgurugamer, I noticed that in the mod's update for 1.4.1, the textures were moved from SlingShotter/Textures into SlingShotter/PluginData/Textures, but SlingshotCore.Start() still tries to load "SlingShotter/Textures/body", which doesn't exist anymore.  The result is that the green circles for planet/moon positions don't appear anymore.  I didn't address that in my merge request, partly because it's unrelated to the performance fix, and partly because I'm not sure what the correct fix is.  (Changing the code to load "SlingShotter/PluginData/Textures/body" didn't work when I tried it; I think PluginData is special somehow but I don't know the details.  Moving the texture out of PluginData works, but presumably you had a reason for putting it there.)

Thanks for the update, but I found that while testing, the earlier bug which happened in the tracking station when no vessel was selected  spammed the log with NullRefs.  Looks like you removed my check for a null vessel 

Looks like there were a few places where you added the CurrentVessel() and didn't add the check for a null vessel

Edited by linuxgurugamer
Link to comment
Share on other sites

  • 1 month later...

I have a feature request, kinda: 

 

I'd like to have a display that shows the distance between the target and the vessel at the given time. 

This display would be useful for setting up an intercept. With it, you can tweak a maneuver node to make the distance smaller until you have an intercept. 

I actually wrote some code that does this: https://github.com/alismatales/KerbalSlingshotter/commit/f14685d6616121e36a1b5de6ac0ebbf539d03109

 

Looks like this: 

Distance 46 million km:

9sFMp1b.jpg

Down to 9 million: 

JuLioJ3.jpg

 

826.000 km: 

 

 

kUmQgr0.jpg

 

And 171 km: 

 

xn4szdY.jpg

 

The last one at a flyby distance of 171km should show and intercept or closest approach marker, but KSP doesnt for some reason. Actually, i think that will crash into the surface of eeloo since its got a 210km radius.. Cant get much closer than that. 

It might be useful for other kinds of missions as well, since KSPs closest approach and intercept markers are flaky sometimes. 

Another advantage is that it allows to you set when the flyby will be precisely by playing around with the desired time. 

 

 

 

 

Link to comment
Share on other sites

  • 3 weeks later...
  • 11 months later...
  • 1 month later...

Greetings and thanks for all the work you do to make KSP even more fun to play.

 

I added this mod to a new 1.7.2 career and found it only partially working because I could not see the movements of the planets when using the time slider.

I looked into it and found the mod is still looking for the body texture inside the PluginData directory and so wasn't displaying planet positions.

I copied Textures back to PluginData and the mod worked correctly.

Thank you.

Link to comment
Share on other sites

5 hours ago, Starburst said:

Greetings and thanks for all the work you do to make KSP even more fun to play.

 

I added this mod to a new 1.7.2 career and found it only partially working because I could not see the movements of the planets when using the time slider.

I looked into it and found the mod is still looking for the body texture inside the PluginData directory and so wasn't displaying planet positions.

I copied Textures back to PluginData and the mod worked correctly.

Thank you.

Oh, nuts.  Thanks for finding that, I’ll  get it fixed

Link to comment
Share on other sites

  • 1 month later...
  • 2 months later...
  • 3 months later...
  • 4 weeks later...
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...