Jump to content

[WIN/MAC/LINUX] KSP Trajectory Optimization Tool v1.6.9 [New MATLAB Version!]


Arrowstar
 Share

Recommended Posts

On 6/16/2022 at 8:31 PM, EpicSpaceTroll139 said:

First off, I want to say thank you Arrowstar for being so quick to fix the bugs I found!  

 

Secondly, while using LVD, I had an idea for a (hopefully) simple feature that I think anyone using LVD regularly would find useful.  No pressure on adding it (this is already an amazing tool that you're providing free of charge lol), just wanted to share the idea.

 

Context:

Using LVD, I've realized that a significant amount of my setup time for each mission is spent looking back and forth between KSP (or the wiki, or part config files), a calculator, and LVD just entering in isp and thrust profiles for engines on each stage (fortunately nothing I've done has needed the throttle modifier profile yet).  At the same time, I find I'm often using the same 4-5 engines, just in different clusters* and staging orders for each mission.

 

Idea:

Import and export of (or perhaps some kind of "favorites" bar for) engines with saved specifications.

A user could go through the various settings found in the "edit engine" window to create an engine to the specs of, for example, a Raptor 2.0.  The user could then optionally click a button to save the engine configuration for later use outside the current mission.  Later, setting up another mission, when the user is in the "edit engines" window, there would be an option (perhaps as a dropdown when hovering the mouse over the "add engine" button) to select one of the saved engines to add, and then to enter a number for how many of it to add,** what stage to put it in, and a name.  Upon hitting confirm, an engine with the desired name would be added to the stage with the same throttle limit, isp profile, and throttle modifier profile settings as the saved engine, and with the same thrust profile and EC charge/drain settings, but scaled by the number the user entered.

*I'm aware of the duplicate engine button, but usually I model a cluster of engines as a single big one in LVD, so I don't have to activate/deactivate them individually.

**I presume nobody wants to actually deal with adding 33 individual raptors for a Superheavy and editing their corresponding events  :confused:

 

Thanks for reading, and again, no pressure on adding this.  I just wanted to kind of throw it out there.

Edit:  I might actually be willing to try helping out with coding it if you think it's a decent idea, as I do have MATLAB installed and have experience with it.  Not guarantees on timeliness or it working tho lol.  I've never used the app designer before.

Hey!  Thanks for the suggestion.  Some of this sort of exists already.  You can import an engine from the KSP engine config file by right clicking the engine listbox and selecting the import menu item.  You then browse for an engine CFG file (such as "<ksp_root>\GameData\Squad\Parts\Engine\liquidEngineLV-909_v2\liquidEngineLV-909_v2.cfg") and it imports it into LVD.  You can then assign it to the correct stage and copy it to your heart's content.

That said, it's better to have fewer LVD "engines" that represent clusters of multiple of the same KSP engine, because it takes less CPU time to iterate over them when computing thrust.  You can just multiply the thrust values by the number of engines and keep the ISP the same.

Does this sort of satisfy what you were hoping to see?

Link to comment
Share on other sites

3 hours ago, Arrowstar said:

Hey!  Thanks for the suggestion.  Some of this sort of exists already.  You can import an engine from the KSP engine config file by right clicking the engine listbox and selecting the import menu item.  You then browse for an engine CFG file (such as "<ksp_root>\GameData\Squad\Parts\Engine\liquidEngineLV-909_v2\liquidEngineLV-909_v2.cfg") and it imports it into LVD.  You can then assign it to the correct stage and copy it to your heart's content.

That said, it's better to have fewer LVD "engines" that represent clusters of multiple of the same KSP engine, because it takes less CPU time to iterate over them when computing thrust.  You can just multiply the thrust values by the number of engines and keep the ISP the same.

Does this sort of satisfy what you were hoping to see?

Ah nice!  LVD has so many features I should have guessed there was something similar what I was describing already, just someplace I hadn't found yet.

 

Engine listbox... Is that different than the one that pops up when you click "edit engines" in the vehicle configuration window?  All I get when I right click that is "Create Copy of Selected Engine." :confused:

Edited by EpicSpaceTroll139
Link to comment
Share on other sites

8 hours ago, EpicSpaceTroll139 said:

Engine listbox... Is that different than the one that pops up when you click "edit engines" in the vehicle configuration window?  All I get when I right click that is "Create Copy of Selected Engine." :confused:

I'm so sorry!  I was describing this from memory and got it wrong.  You have to create an engine first and then, if you right click on the Edit Thrust Profile button (or a few other places), you'll get the menu I described earlier.  Sorry about the confusion!

Link to comment
Share on other sites

1 hour ago, Arrowstar said:

I'm so sorry!  I was describing this from memory and got it wrong.  You have to create an engine first and then, if you right click on the Edit Thrust Profile button (or a few other places), you'll get the menu I described earlier.  Sorry about the confusion!

No worries.  Got it now, thanks! :)

Link to comment
Share on other sites

I am trying to run this on linux (manjaro) and I'm getting an error:

error while loading shared libraries: libmwlaunchermain.so: cannot open shared object file: No such file or directory

I changed the default MATLAB directory to /usr/local/MATLAB/R2022a/ so now I have bin, appdata, runtime, etc inside /usr/local/MATLAB/R2022a/v912/. Is this correct?

Link to comment
Share on other sites

13 hours ago, mateusviccari said:

I am trying to run this on linux (manjaro) and I'm getting an error:

error while loading shared libraries: libmwlaunchermain.so: cannot open shared object file: No such file or directory

I changed the default MATLAB directory to /usr/local/MATLAB/R2022a/ so now I have bin, appdata, runtime, etc inside /usr/local/MATLAB/R2022a/v912/. Is this correct?

I am having the exact same results on Linux Mint. 

Link to comment
Share on other sites

On 6/19/2022 at 7:07 AM, mateusviccari said:

I am trying to run this on linux (manjaro) and I'm getting an error:

error while loading shared libraries: libmwlaunchermain.so: cannot open shared object file: No such file or directory

I changed the default MATLAB directory to /usr/local/MATLAB/R2022a/ so now I have bin, appdata, runtime, etc inside /usr/local/MATLAB/R2022a/v912/. Is this correct?

On 6/19/2022 at 8:48 PM, Eleven said:

I am having the exact same results on Linux Mint. 

Hey guys, thanks for the reports.  I'll try to look into this over the next day or so.  Can you please walk me through what you've tried to do to solve the problem beyond just renaming the directory?

Link to comment
Share on other sites

15 hours ago, Arrowstar said:

Hey guys, thanks for the reports.  I'll try to look into this over the next day or so.  Can you please walk me through what you've tried to do to solve the problem beyond just renaming the directory?

Installing it into /usr/local/MATLAB/R2022a/ leaves you with an install located at /usr/local/MATLAB/R2022a/v912.

I tried doing a symbolic link from the v912 dir to the R2022a directory but still get the same error. That file exists, but for some reason the program is not finding it in the directory structure.

Could it be as simple as just moving the contents of the v912 directory to the R2022a directory?

Link to comment
Share on other sites

Just now, Eleven said:

Installing it into /usr/local/MATLAB/R2022a/ leaves you with an install located at /usr/local/MATLAB/R2022a/v912.

I tried doing a symbolic link from the v912 dir to the R2022a directory but still get the same error. That file exists, but for some reason the program is not finding it in the directory structure.

Could it be as simple as just moving the contents of the v912 directory to the R2022a directory?

Oh yeah, it needs to be in /usr/local/MATLAB/v912, not .../R2022a/v912.  Perhaps try that?

Link to comment
Share on other sites

19 minutes ago, Arrowstar said:

Oh yeah, it needs to be in /usr/local/MATLAB/v912, not .../R2022a/v912.  Perhaps try that?

That is EXACTLY what the prob was! Thanks for clearing that up. 

BEadZ1h.png

On 6/19/2022 at 8:07 AM, mateusviccari said:

I am trying to run this on linux (manjaro) and I'm getting an error:

error while loading shared libraries: libmwlaunchermain.so: cannot open shared object file: No such file or directory

I changed the default MATLAB directory to /usr/local/MATLAB/R2022a/ so now I have bin, appdata, runtime, etc inside /usr/local/MATLAB/R2022a/v912/. Is this correct?

Hope Mateusviccari sees this as well. 

Link to comment
Share on other sites

That was it, got it working. I also had to install two additional libraries: lib32-gtk2 and libxcrypt-compat

Also I had to delete the file libfreetype.so.6 from /usr/local/MATLAB/v912/bin/glnxa64/ because of an error while starting some MATLAB components (I googled it and found the solution on a reddit post).

Thanks guys. Now I just have to learn how to use the tool. I'll check out the kerbin > duna tutorial later and I'll try to apply it to RSS. Are there more advanced tutorials for the good stuff, like multiple flybys?

Link to comment
Share on other sites

1 hour ago, mateusviccari said:

Are there more advanced tutorials for the good stuff, like multiple flybys?

None for LVD that I'm aware of but if you check the tutorial folder from the download, there's a 4yr old mission architect tutorial of an OPM multiple planet mission - "2) Solar System Edge".

I used it a while ago as the basis for planning a couple of RSS double fly-by missions (Earth->Jupiter->Saturn) and (Earth -> Jupiter -> Uranus). Although I haven't worked up to a Voyager 2 style grand tour yet, I did also plan out but didn't fly a New Horizon style mission.

You can also view it on GitHub: https://github.com/Arrowstar/ksptot/tree/master/tutorials/Mission Architect/2) Solar System Edge

Link to comment
Share on other sites

1 hour ago, Eleven said:

LVD is crashing on me, I'm getting this error: "Switching to hardware OpenGL rendering at runtime on unix is not supported."

Is there a work-around for this on Linux? I have an Nvidia M870 in my laptop. 

Thanks for the report.  Can you walk me through the steps to reproduce this?

Link to comment
Share on other sites

14 minutes ago, Arrowstar said:

Thanks for the report.  Can you walk me through the steps to reproduce this?

The logfile is sparse. Nothing more than the message I posted. I simply fire up TOT, and try to start LVD and the window pops up, but crashes shortly after. I have a quick video of it if that might help?

 

Link to comment
Share on other sites

1 hour ago, Eleven said:

The logfile is sparse. Nothing more than the message I posted. I simply fire up TOT, and try to start LVD and the window pops up, but crashes shortly after. I have a quick video of it if that might help?

 

Thanks for the video, that was super helpful.  I've implemented what I'm hoping is a fix.  Can you go ahead and redownload the Linux build from the first post and tell me if the bug persists?

Link to comment
Share on other sites

13 minutes ago, Arrowstar said:

Thanks for the video, that was super helpful.  I've implemented what I'm hoping is a fix.  Can you go ahead and redownload the Linux build from the first post and tell me if the bug persists?

That did it. LVD fired up successfully. Thank you once again for the quick replies and fixes!

Link to comment
Share on other sites

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