Jump to content

MechJeb for KSP2


kithylin

Recommended Posts

24 minutes ago, IgorZ said:

This is one of my favorite mods. However, based on what I've seen in the early access version, we need to be patient until MechJeb is made. And I mean, we need a hell of a lot of patience.

Yes I agree. But this thread did not exist yet as a formal request and so I decided to create it as I think it needs to be here. So now it is here. :)

Link to comment
Share on other sites

It seems that you interpret a 1 word joke a bit too seriously.

There will not be a MechJeb for KSP for a while for the simple fact that we have no official modding support. The current modding tools we have 24h after the release works to do quick hack of some of the game structure but are not (currently) usable to write something like MJ. And the current game performance and bugs make does not motivate me to work on mods for now.

So no, not MechJeb for now.

 

Link to comment
Share on other sites

13 minutes ago, sarbian said:

It seems that you interpret a 1 word joke a bit too seriously.

There will not be a MechJeb for KSP for a while for the simple fact that we have no official modding support. The current modding tools we have 24h after the release works to do quick hack of some of the game structure but are not (currently) usable to write something like MJ. And the current game performance and bugs make does not motivate me to work on mods for now.

So no, not MechJeb for now.

 

Not only that, but someone at Intercept said that only part mods will be supported in the first wave of mod support. No word on plugin support, which MJ3 (Assuming it will be MJ3) would rely on. 

Link to comment
Share on other sites

I'm somewhat unconvinced that MJ is the right way to go.  It attempts to do everything and does most of it badly.

The work I've done (nearly merged now) on extracting a lot of the code that I wrote into a more permissively licensed library IS really geared towards letting people copy battle tested code out of MJ and build mods.  There's obviously a high level of demand for KSP2 mods that do what MJ does for KSP1.

My thoughts though are that I'd rather build something so that WASM code built in other languages could run against KSP2 (kind of kRPC without the socket communication) along with a set of library code (lambert solvers, PIDs, optimization algorithms from alglib, etc) could be available to that framework "free of charge" along with sane right-handed vector/matrix/quaternion objects.  Then I'd like to build a much better transfer planner/flyby finder/maneuver editor/executor, but focusing on expert use cases rather than novice.  Other people could build MJ-like simple launchers on top of that (in languages other than C#).

But I don't even own KSP2 right now and I'm in watch and wait mode.  And if Sarbs tries to build MJ for KSP2 then I might jump in and help since I certainly would want to see it not fail.

Link to comment
Share on other sites

I'm really looking forward to MechJeb for KSP 2.
When I play without Smart A.S.S., it makes me feel really uncomfortable. As if I was flying without one hand. Its the best utility of the whole mod. 2nd place - maneuver planner. I don't want to create a 1000th maneuver to transfer to Mun or Duna or to rendezvous with a station on LKO. I'm tired of that.

Thank you Sarbian for your great work. We'll wait patiently.

Link to comment
Share on other sites

1 hour ago, Jim DiGriz said:

My thoughts though are that I'd rather build something so that WASM code built in other languages could run against KSP2 (kind of kRPC without the socket communication)

That ties neatly into my mod idea - namely, using https://github.com/bytecodealliance/wasmtime-dotnet to simulate an embedded computer in-game (kind of like kOS, but without having to write my own VM).

Would give a nice basis for in-game automation, make ist possible to use existing real world code (which is not possible with kOS), and provide a nice set of tweakables to provide different computing choices, because wasmtime-dotnet makes pretty easy to tie the simulated CPU speed to in-game time, i.e. we can have simulated processors with different CPU speeds as well as different RAM size (that's already inherent in any WASM runtime because the host always has to provide the "memory" and can choose its size).

Link to comment
Share on other sites

Yeah that's what I'd like to do, but I'm not interested in making it "gamey" at all.  I would definitely encourage you to produce that, since I'm more interested in focusing on just making it easier to do optimization and control theory, which is hard enough, and intend it to maximally embrace whatever 'cheats' users would like to write.

Link to comment
Share on other sites

9 hours ago, Jim DiGriz said:

I would definitely encourage you to produce that

First I have to get KSP2 to run on my rig at all (or buy a new rig). And then I'll probably wait until I have at least a rough idea on how I have to structure the code so that the official modding system will load it, and what game interfaces are (or will be) supported by the official modding system.

9 hours ago, Jim DiGriz said:

I'm more interested in focusing on just making it easier to do optimization and control theory

I think we should at least try to come up with a common host interface for both, so that the same WASM code that powers a e.g. "cheaty" ascent guidance can be run on the "gamey" version as well (provided the simulated computer in the "gamey" version is powerful enough).

And I think we can even share a lot of the implementation - after all, if you're going to run WASM in a dotnet environment and want to have it portable across operating systems, you pretty much have to use wasmtime-dotnet (or do you know of any other portable dotnet embedded WASM runtime?). Which means the main difference between the "gamey" and the "cheaty" version is that the first ties WASM execution speed to in-game time and sets an artificial limit on WASM instructions per in-game second, while the second runs WASM asynchronously as fast as the real CPU allows. The rest (WASM memory, program size, in-game resource consumption, ...) are just artificial limits in the "gamey" version (well, apart from WASM memory - the "cheaty" version is limited to whatever leftovers of real RAM KSP2 doesn't gobble up).

9 hours ago, Jim DiGriz said:

I'm more interested in focusing on just making it easier to do optimization and control theory

I'm actually very interested in that as well, ever since I read a paper on a closed-loop generic atmospheric ascent guidance algorithm based on optimal control that claimed to be "implementable on a simple embedded system". Tried to implement it in kOS, even, but gave up after I realized I would have to a) port all the math libraries from matrix multiplication on up and b) the kOS VM is at least and order of magnitude slower than a "simple embedded system" anyway.

PS: Maybe we should take that discussion to a different thread as it isn't about MechJeb per se?

Edited by RKunze
Link to comment
Share on other sites

On 2/25/2023 at 7:09 AM, GoldForest said:

Not only that, but someone at Intercept said that only part mods will be supported in the first wave of mod support. No word on plugin support, which MJ3 (Assuming it will be MJ3) would rely on. 

Disclaimer- I am not a coder.

That said... Interestingly, if you check the Spacedock page, only plugins are showing up due to the fact that BepInEx and the SpaceWarp modloaders are focused around allowing C# code to be run.

So could someone convert the MechJeb code (or at least parts?) into this C#? I just am curious to know if it's possible to do so without a rig worth 25k.

Link to comment
Share on other sites

On 2/25/2023 at 5:29 AM, sarbian said:

Denied.

Is that a "No never" or a. "Just wait until the game is released and has proper mod support why don't you"

Edit:

 

durrr I'm an idiot, I just saw your post, yeahg, it's kind of silly to request mods when we don't even know what the modding API will look like

Edited by viperfan7
Link to comment
Share on other sites

On 2/25/2023 at 12:03 AM, IgorZ said:

This is one of my favorite mods. However, based on what I've seen in the early access version, we need to be patient until MechJeb is made. And I mean, we need a hell of a lot of patience.

I'm sorry, but more patience?

We've been waiting 4-5 years now for this game to release, it's now in early access AND its in a worse state with less content than when people got into KSP1. In the same time it takes other studios to make entire FULL releases.
 

Link to comment
Share on other sites

5 hours ago, Mekan1k said:

So could someone convert the MechJeb code (or at least parts?) into this C#?

MechJeb and the other KSP1 mods are all in C#. It's not about converting them into another programming language, it's about using new game's API. KSP1 doesn't provide an API, but people got used to the codebase (but, of course, nobody decompiled it!). Developers of KSP2 claimed there will be some API, but at this point it's nothing but promises. One way or another community will learn how to make mods for KSP2, but the needed time depends on the devs participation (which is zero as of today).

Edited by IgorZ
Link to comment
Share on other sites

50 minutes ago, mrdanman9 said:

We've been waiting 4-5 years now for this game to release, it's now in early access AND its in a worse state with less content than when people got into KSP1. In the same time it takes other studios to make entire FULL releases.

I'm disappointed too. However, I've seen this before with the other products (not only games). Determining the key aspects of the product and focusing on them during the course of the production is a rare skill. Not many people have it. Hopefully, the devs will make the right conclusions on the community reaction. One reason of KSP1 success was the active devs role.

Link to comment
Share on other sites

On 2/25/2023 at 3:01 PM, Jim DiGriz said:

I'm somewhat unconvinced that MJ is the right way to go.  It attempts to do everything and does most of it badly.

The work I've done (nearly merged now) on extracting a lot of the code that I wrote into a more permissively licensed library IS really geared towards letting people copy battle tested code out of MJ and build mods.  There's obviously a high level of demand for KSP2 mods that do what MJ does for KSP1.

My thoughts though are that I'd rather build something so that WASM code built in other languages could run against KSP2 (kind of kRPC without the socket communication) along with a set of library code (lambert solvers, PIDs, optimization algorithms from alglib, etc) could be available to that framework "free of charge" along with sane right-handed vector/matrix/quaternion objects.  Then I'd like to build a much better transfer planner/flyby finder/maneuver editor/executor, but focusing on expert use cases rather than novice.  Other people could build MJ-like simple launchers on top of that (in languages other than C#).

But I don't even own KSP2 right now and I'm in watch and wait mode.  And if Sarbs tries to build MJ for KSP2 then I might jump in and help since I certainly would want to see it not fail.

Does most of it badly? Please share whatever you're smoking. MJ is a godsend after my 6k-ish hours in KSP 1. Takes away a ton of tedium once you've manually flown your own rockets to orbit for thousands of launches over the years. I don't use its auto dock, auto land, etc functions because I prefer to do those manually myself, but saying MJ does things badly is..... an interestingly inaccurate taste.

Link to comment
Share on other sites

2 hours ago, sjsharks39 said:

saying MJ does things badly is..... an interestingly inaccurate taste.

 As one of the major contributors to MJ code he has a good insight on its imperfections. 
Some parts woks fine, others have their quicks but are still useful, and a lot works only with some specific ships/situations.  
A MJ for KSP 2 would benefit from a more modular architecture instead of being monolithic (even if the current code has some modularity)

Edited by sarbian
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.

×
×
  • Create New...