Jump to content

[KSP 1.12.x] kOS v1.4.0.0: kOS Scriptable Autopilot System


Dunbaratu

Recommended Posts

4 hours ago, Someone2018 said:

Okay you have *got* to be kidding me.  The dialog box that kOS opens to ask for a connectivity manager is causing some weird nullref exception in KSP if any corner of it is off the edge of the screen when it gets dismissed.  WTH???

Are you running in a small screen resolution where that dialog is hanging off the edge of the screen?  I tested for the smallest resolution setting available on the settings screen when I moved the dialog box offcenter and it never bombed out even when one corner of the box was off the edge of the screen, but in your case that is the very call it's bombing out in - the call KSP makes to test the bounds of the box.  Note this is happening when kOS tells KSP to *dismiss* the box, so it may be that KSP will crash whenever a dialog box goes away while partly off the edge of the screen??

Also, annoyingly, your case isn't the one the others are talking about.  You're having KSP crash *before* it loads.  Other people are having the terminal fail after KSP is loaded.

[Edit: sorry - what I mean is annoyingly for me, since I want to find out what is causing the terminal not appearing bug, since I thought I had it nailed down to Wind Tunnel, but if people are getting the problem without Wind Tunnel then I haven't totally found it.  I still need one of THOSE logs to look through.]

Edited by Steven Mading
Link to comment
Share on other sites

5 hours ago, Steven Mading said:

Okay you have *got* to be kidding me.  The dialog box that kOS opens to ask for a connectivity manager is causing some weird nullref exception in KSP if any corner of it is off the edge of the screen when it gets dismissed.  WTH???

Are you running in a small screen resolution where that dialog is hanging off the edge of the screen?  I tested for the smallest resolution setting available on the settings screen when I moved the dialog box offcenter and it never bombed out even when one corner of the box was off the edge of the screen, but in your case that is the very call it's bombing out in - the call KSP makes to test the bounds of the box.  Note this is happening when kOS tells KSP to *dismiss* the box, so it may be that KSP will crash whenever a dialog box goes away while partly off the edge of the screen??

Also, annoyingly, your case isn't the one the others are talking about.  You're having KSP crash *before* it loads.  Other people are having the terminal fail after KSP is loaded.

[Edit: sorry - what I mean is annoyingly for me, since I want to find out what is causing the terminal not appearing bug, since I thought I had it nailed down to Wind Tunnel, but if people are getting the problem without Wind Tunnel then I haven't totally found it.  I still need one of THOSE logs to look through.]

The connectivity manager box never appears for me at all (on screen), although i did see it in a non-responsive state after switch from fullscreen to non-fullscreen once or twice over the past week.

My resolution is actually large 3840x2160, at a scale of 180% though.

Edited by Someone2018
Link to comment
Share on other sites

hmmm... I tried to reproduce the issue with v1.1.7 on KSP 1.7.0... even set my screen size to 1024x768... the connectivity manager box shows up well away from the screen border, and dragging it around, it seems to have set bounds that keep it uniformlly quite away from the screen edge... I dont know how it would appear overlapping the screen edge at all.. vOv

And every thing seems to be working normally...
One thing that worried me, is after getting the choose terminal font warning on the main menu... I went in to the editor to load a craft and add a kos part... clicking the kos toolbar button, when the toolbar is at the bottom of the screen, clicking the "choose Font" button, opens the other dialog, that ends up well off the bottom edge of the screen... and neither kOS Ui is draggable... but its not a problem when in flight scene, and the toolbar is on the right edge of the screen...
but again, everything seemed to work normally... vOv

And no Wind Tunnel mod installed for me... ;)

Sorry I couldnt be moar help :(

EDIT: after Someone's above post (they ninja'd me), I dont have fullscreen enabled, but I do force -popupwindow...
I generally run 1440x900 for the game... vOv
oh, also, dont know if this would matter, but I force Dx11, and run Electrocutor's Dx Fix...

Edited by Stone Blue
Link to comment
Share on other sites

29 minutes ago, Someone2018 said:

The connectivity manager box never appears for me at all (on screen), although i did see it in a non-responsive state after switch from fullscreen to non-fullscreen once or twice over the past week.

My resolution is actually large 3840x2160, at a scale of 180% though.

Well darn.

Can you temporarily set the 180% scale down to 100% just to see if that changes the behavior of the bug at all?

One change I made in kOS 1.1.7.0 was to move that dialog box offcenter to fix this issue: https://github.com/KSP-KOS/KOS/issues/2456

I don't know if that affects this, but the place it is crashing according to your log *is* the place where KSP checks the corners of that box to see if it's offscreen.  Why that would throw a null exception instead of just handling it or refusing to work if it doesn't like what it sees, I don't know.  I also know I had the box hanging partially offscreen a number of times and it was fine when I tested anyway.

The problem seems to be happening when the box is trying to *close* itself, actually.  So I wonder if some weird timing issue is causing KSP to try calling the offscreen checker *after* the box has started to dispose of itself and its not all there anymore, thus the null ref.

Also, that box appears only if the game is a newly started save from the beginning, or at least a game in which kOS was just installed and had not been running beforehand in that save.  If it's a save where kOS was already installed and used in that save, and that dialog box was already answered, then it shouldn't come back again in that save.

Which situation is having the crash happen?

1 - kOS already installed, then start a brand new savegame from scratch.  (This is a case that I would expect the dialog box to appear).

2 - kOS NOT installed, then start a brand new savegame, then exit KSP and install kOS, then run KSP and resume that savegame.  (a game that was started without kOS, then had kOS added later).  (This is a case that I would expect the dialog box to appear).

3 - kOS already installed, the savegame already has the connectivity manager selected, and you continue it as normal (this is the case where I would NOT expect the dialog box to appear).
 

Link to comment
Share on other sites

6 minutes ago, Steven Mading said:

Well darn.

Can you temporarily set the 180% scale down to 100% just to see if that changes the behavior of the bug at all?

One change I made in kOS 1.1.7.0 was to move that dialog box offcenter to fix this issue: https://github.com/KSP-KOS/KOS/issues/2456

I don't know if that affects this, but the place it is crashing according to your log *is* the place where KSP checks the corners of that box to see if it's offscreen.  Why that would throw a null exception instead of just handling it or refusing to work if it doesn't like what it sees, I don't know.  I also know I had the box hanging partially offscreen a number of times and it was fine when I tested anyway.

The problem seems to be happening when the box is trying to *close* itself, actually.  So I wonder if some weird timing issue is causing KSP to try calling the offscreen checker *after* the box has started to dispose of itself and its not all there anymore, thus the null ref.

Also, that box appears only if the game is a newly started save from the beginning, or at least a game in which kOS was just installed and had not been running beforehand in that save.  If it's a save where kOS was already installed and used in that save, and that dialog box was already answered, then it shouldn't come back again in that save.

Which situation is having the crash happen?

1 - kOS already installed, then start a brand new savegame from scratch.  (This is a case that I would expect the dialog box to appear).

2 - kOS NOT installed, then start a brand new savegame, then exit KSP and install kOS, then run KSP and resume that savegame.  (a game that was started without kOS, then had kOS added later).  (This is a case that I would expect the dialog box to appear).

3 - kOS already installed, the savegame already has the connectivity manager selected, and you continue it as normal (this is the case where I would NOT expect the dialog box to appear).
 

I did mostly 1, but also 2. Testing at 100% scale will have to wait, not at my game pc right now, and won't be for the a few days.

Link to comment
Share on other sites

@Someone2018
If nothing else, I can at least tell you how you can try to bypass that screen by directly editing your persistent.sfs savegame to trick it into thinking you've already given it an answer.

(As with any edit to persistent.sfs, make sure you copy it to some other name first in case you screw up so you can get it back.)


Look for this section of your persistent.sfs save:

		kOSConnectivityParameters
		{

Look for which of the conditions below is the one you want, and edit your section to look exactly like it shows:

IF: you do NOT have Remote Tech installed, and you want to use PermitAll (kOS ignores comms and always pretends you're connected), then make that section look like this:

		kOSConnectivityParameters
		{
			version = 0
			knownHandlerList = PermitAllConnectivityManager,CommNetConnectivityManager
			connectivityHandler = PermitAllConnectivityManager
		}



IF you do NOT have Remote Tech installed, and you want to use CommNet (you want kOS to obey the stock game's antenna connection rules), then make it look like this:

		kOSConnectivityParameters
		{
			version = 0
			knownHandlerList = PermitAllConnectivityManager,CommNetConnectivityManager
			connectivityHandler = CommNetConnectivityManager
		}



IF you DO have Remote Tech installed, then you should use Remote Tech connectivity manager, and make it look like this:

		kOSConnectivityParameters
		{
			version = 0
			knownHandlerList = PermitAllConnectivityManager,RemoteTechConnectivityManager
			connectivityHandler = RemoteTechConnectivityManager
		}


If nothing else, that should let you get past that initial dialog box so at least you can play, but I still would like to get to the bottom of what causes this.
 

Edited by Steven Mading
Link to comment
Share on other sites

Sorry, I didn't have time to play KSP lately, so no log yet. But my case was "3", i.e. I just updated KSP to 1.7 and tried to resume my current career. Everything looked ok except the kOS terminal window.

Oh, and one more thing. When I first loaded a vessel, the kOS window said the processor was starving although the vessel had enough EC. I went to KSC and then back and this message was gone, but the terminal still didn't open. Not sure if these glitches are related.

Link to comment
Share on other sites

1 hour ago, garwel said:

Sorry, I didn't have time to play KSP lately, so no log yet. But my case was "3", i.e. I just updated KSP to 1.7 and tried to resume my current career. Everything looked ok except the kOS terminal window.

Oh, and one more thing. When I first loaded a vessel, the kOS window said the processor was starving although the vessel had enough EC. I went to KSC and then back and this message was gone, but the terminal still didn't open. Not sure if these glitches are related.

There are two different issues being talked about simultaneously in this thread.  The issue where I asked about doing 1, 2, or 3, was not the issue you had.

Your issue is about KSP Loading and running but without the kos terminal working.  The only examples of logs I've seen from that issue were from people who had kerbal wind tunnel, where removing kerbal wind tunnel made it go away.  What makes your version different is that you say you don't have kerbal wind tunnel, which means *something* is different from their problem, but I can't really diagnose what until later when you have a chance to generate that log and post it.

The "1,2, or 3" question was about Someone2018's issue which was different, where all of KSP broke entirely and crashed so it didn't even get as far as being able to enter the flight scene to even try to open the kOS terminal, and Someone2018's log indicated it was a totally different problem in a different part of the program.

Link to comment
Share on other sites

3 hours ago, garwel said:

Here is the log: https://ufile.io/jmwnv3oz

 

In this case, the first mod that shows an error with GetTypes() is KAC.  As a quick test, what happens if you try without KAC installed?  (Careful don't load your existing save with KAC missing if that save has any KAC parts on vessels, as it will delete those vessels - try it with a fresh new save if your existing save has any KAC parts).

Does removing KAC change anything?  I have seen posts over in the KAC thread that say KAC has problems loading in 1.7, even without kOS.

Link to comment
Share on other sites

9 hours ago, Steven Mading said:

 

In this case, the first mod that shows an error with GetTypes() is KAC.  As a quick test, what happens if you try without KAC installed?  (Careful don't load your existing save with KAC missing if that save has any KAC parts on vessels, as it will delete those vessels - try it with a fresh new save if your existing save has any KAC parts).

Does removing KAC change anything?  I have seen posts over in the KAC thread that say KAC has problems loading in 1.7, even without kOS.

You mean KAS, right? Well, this could be the case; I've also heard it had issues with 1.7, but to me things look ok. Will try without it and report back.

Edited by garwel
Link to comment
Share on other sites

35 minutes ago, garwel said:

You mean KAS, right? Well, this could be the case; I've also heard it had issues with 1.7, but to me things look ok. Will try without it and report back.

Oops - yes I mean KAS not KAC.

Link to comment
Share on other sites

I believe I may have a workaround for this "can't open terminal" problem so it doesn't happen again in future versions (i.e. kOS doesn't get ruined by *another* mod's DLL incompatibility).

My fix which seems to handle it - making it not crash even when the broken versions of KAS or Wind Tunnel are installed, is this:

https://github.com/KSP-KOS/KOS/pull/2492/files

This doesn't actually fix the original problems with these other mods failing to work - that's on them - but it fixes the problem of their failure to load in turn causing kOS to fail to work.

The comments in the code are verbose, because I may want to show this to other modders who had the same problem, and I want to explain it to them.  The actual code lines are not many.

Link to comment
Share on other sites

On 4/19/2019 at 9:14 AM, Steven Mading said:

@Someone2018
If nothing else, I can at least tell you how you can try to bypass that screen by directly editing your persistent.sfs savegame to trick it into thinking you've already given it an answer.

(As with any edit to persistent.sfs, make sure you copy it to some other name first in case you screw up so you can get it back.)


Look for this section of your persistent.sfs save:


		kOSConnectivityParameters
		{

Look for which of the conditions below is the one you want, and edit your section to look exactly like it shows:

IF: you do NOT have Remote Tech installed, and you want to use PermitAll (kOS ignores comms and always pretends you're connected), then make that section look like this:


		kOSConnectivityParameters
		{
			version = 0
			knownHandlerList = PermitAllConnectivityManager,CommNetConnectivityManager
			connectivityHandler = PermitAllConnectivityManager
		}



IF you do NOT have Remote Tech installed, and you want to use CommNet (you want kOS to obey the stock game's antenna connection rules), then make it look like this:


		kOSConnectivityParameters
		{
			version = 0
			knownHandlerList = PermitAllConnectivityManager,CommNetConnectivityManager
			connectivityHandler = CommNetConnectivityManager
		}



IF you DO have Remote Tech installed, then you should use Remote Tech connectivity manager, and make it look like this:


		kOSConnectivityParameters
		{
			version = 0
			knownHandlerList = PermitAllConnectivityManager,RemoteTechConnectivityManager
			connectivityHandler = RemoteTechConnectivityManager
		}


If nothing else, that should let you get past that initial dialog box so at least you can play, but I still would like to get to the bottom of what causes this.
 

I narrowed it down to the "moving window change" that really doesn't work well with UI scaling != 100% (i.e. the window is moved offscreen). I have a fix for this, but github forking is broken right now (for me), so I can't put up a pull request.

Figuring out the correct settings is non-trivial (took me several hours at least), so don't bother replicating it :-)

Link to comment
Share on other sites

I have a curious issue with kOS when used with RO.

I have an engine on my craft, the RD108, which is a dual engine, but not multimode. It's a main engine plus a set of vernier thrusters. Both can fire at the same time, use the same fuel, but have different thrust, gimbal, etc.

The issue is that in kOS they show up as two separate engines, but both with the same properties. So I can only get the main engine properties (twice), rather than having them separate.
In the log I get:

[WRN 13:22:28.489] kOS: Second engine without multi-mode on RD108: RD-108 Series

Which makes sense since that's exactly what it is.

So, solutions. Is it going to be best to add some settings to get the secondary engine stats, similar to how the multimode stuff works? I'm not sure what a robust way to get this working is.

 

Edit: I have a possible solution, though I won't be able to test it in game until tomorrow.
I have changed EngineValue.cs to have a list of engines. Multimode work as before whereby it uses either primary or secondary. Everything else sums / averages the properties of all engines.
Hopefully that is more or less correct.

Edited by Flibble
Link to comment
Share on other sites

hi

I don't know who to contact, but... I wanted to inform you, that this week I will release the beta 4 of Infernal Robotics Next. And the interface will change. After that it should be stable (in fact I hope that the project will be releasable after that). But it needs a big modification now.

So... this means, that kOS needs an update too... contact me if you need more information.

Link to comment
Share on other sites

1 hour ago, Rudolf Meier said:

hi

I don't know who to contact, but... I wanted to inform you, that this week I will release the beta 4 of Infernal Robotics Next. And the interface will change. After that it should be stable (in fact I hope that the project will be releasable after that). But it needs a big modification now.

So... this means, that kOS needs an update too... contact me if you need more information.

Here is where I wish these fora had a "mark as unread" button like e-mails do.  I don't have time to work on this right now, but I definitely want it showing up in my "unread post that's important - go look" list the next time I visit the site.

Link to comment
Share on other sites

10 hours ago, Steven Mading said:

Here is where I wish these fora had a "mark as unread" button like e-mails do.  I don't have time to work on this right now, but I definitely want it showing up in my "unread post that's important - go look" list the next time I visit the site.

I use the share icon in the upper right of a post next to the report link to email myself a link to it if I need to remember to look at it later

Link to comment
Share on other sites

8 hours ago, Drew Kerman said:

I use the share icon in the upper right of a post next to the report link to email myself a link to it if I need to remember to look at it later

Good to know about it. Never bothered myself to check out that share in the first place, though.

Link to comment
Share on other sites

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