allista

[1.9-1.10] Throttle Controlled Avionics

Recommended Posts

TCA is now one of my first installs, so thanks for all your work so far.

I do have an issue, which is likely operator error, but I can't seem to work it out:

As of a recent update, the on-screen elements (Autopilot execute button, VTOL panel, etc) are no longer visible. I can't tell if they're off-screen or not rendering but the game/mod behaves as if they're there and functional (eg after a manoeuvre, it will be using your SAS, overriding stock).

https://imgur.com/a/4xE7GEV

How can I reset/reinitialise the layout?

 

Share this post


Link to post
Share on other sites

Same thing happening here after updating to 1.9 -- I wasn't particularly worried because everything seemed to load up fine, then I realized that none of the floating windows were showing up and had to fly the ship to safety by hand. No fatalities, but I have a few ships that are completely unflyable without TCA due to funky engine layouts.

Share this post


Link to post
Share on other sites

TCA was not yet updated for KSP 1.9, and, by experience with all previous KSP upgrades, this means that something ought to be broken.

We all have to wait until my work permits me to attend the issue :confused:

Share this post


Link to post
Share on other sites
15 hours ago, allista said:

TCA was not yet updated for KSP 1.9, and, by experience with all previous KSP upgrades, this means that something ought to be broken.

We all have to wait until my work permits me to attend the issue :confused:

No worries, thanks for whenever you get the time.

Not sure if it's related but launch to orbit form KSC is also not working as expected - vessel under-thrusts considerably and splashes down not far to the East. Happens even with designs that are hugely over-powered and can reach orbit easily.

[Another one for the list when that mythical "spare time" rolls 'round]

All the best.

Share this post


Link to post
Share on other sites
On 2/23/2020 at 12:34 AM, allista said:

TCA was not yet updated for KSP 1.9, and, by experience with all previous KSP upgrades, this means that something ought to be broken.

We all have to wait until my work permits me to attend the issue :confused:

the basic functions still appear to work.. but the aux windows do  not show up.  one thing that I think is unrelated but, if you're in there anyway - I see in the config window that you can uncheck RCS translation and RCS rotation -it'd be nice if, when unchecked but RCS is still on, TCA wouldn't block manual RCS inputs.

Share this post


Link to post
Share on other sites

is there any chance that a simple TCA recompile against 1.9.1's DLLs would fix the issues, or is it deeper than that and requires a code change?  Or do we know yet?

Share this post


Link to post
Share on other sites
On 3/23/2020 at 9:42 PM, ss8913 said:

is there any chance that a simple TCA recompile against 1.9.1's DLLs would fix the issues, or is it deeper than that and requires a code change?  Or do we know yet?

I don't believe so... The error log seems to imply that UI components have been moved about. (Assuming I've picked out the correct exception)

Share this post


Link to post
Share on other sites
Posted (edited)
On 3/29/2020 at 2:39 PM, Baslifico said:

I don't believe so... The error log seems to imply that UI components have been moved about. (Assuming I've picked out the correct exception)

since I am working from home and no longer am wasting 2+ hours a day commuting, I'm going to dig into it in visual studio and see if I can find a way to fix it.  If I can, I will document the solution and post it here; it might not be a full fix or completely elegant, but hopefully it might give @allista a starting point and save him some time in making a proper update, when he has time.  As it stands right now, it is.. basically functional, but there's certain things it's not doing correctly and certain functions which are dependent on the other UI windows which obviously are not working at all.

One thing that helps is using Diazo's vertical velocity controller to replace the TCA vertical controls; Diazo's mod works fine with 1.9.1 and plays  nice with TCA - the only thing that is.. weird, is that when using open-cycle (air-breathing) engines, you have to manually adjust the desired vertical speed; ie, a set-point of 0 in diazo's mod may effect a -4.00 m/s vertical rate, but setting the mod to +4.00 will be effectively zero.. it's odd and it's been like this for several releases, and I'm not sure what's causing it, but... it's a workaround for one of the things that TCA is currently not able to do.

update:  I can't even get AT_Utils to build, period, in visual studio - I know Allista has a linux-based build system for this, which ordinarily I could adapt to but it seems it's a custom build environment and not all the pieces are in the AT_Utils github project (nor the TCA project).  I've built prior versions in VS before but this time it's eluding me with unresolved references that.. look like they're being clearly resolved.  so I'm a bit stuck on this.  Granted my VS/C# isn't that great, I mostly develop in python and C++ using gcc/g++ and standard Makefiles/cmake ... I feel like I'm at the limit of my understanding of VS in terms of resolving the build dependencies... so I suppose I will just wait for an official rebuild or if someone knows how to get it to build in visual studio, I'm all ears :)

Edited by ss8913

Share this post


Link to post
Share on other sites
On 3/31/2020 at 12:50 AM, ss8913 said:

since I am working from home and no longer am wasting 2+ hours a day commuting, I'm going to dig into it in visual studio and see if I can find a way to fix it.  If I can, I will document the solution and post it here; it might not be a full fix or completely elegant, but hopefully it might give @allista a starting point and save him some time in making a proper update, when he has time.  As it stands right now, it is.. basically functional, but there's certain things it's not doing correctly and certain functions which are dependent on the other UI windows which obviously are not working at all.

One thing that helps is using Diazo's vertical velocity controller to replace the TCA vertical controls; Diazo's mod works fine with 1.9.1 and plays  nice with TCA - the only thing that is.. weird, is that when using open-cycle (air-breathing) engines, you have to manually adjust the desired vertical speed; ie, a set-point of 0 in diazo's mod may effect a -4.00 m/s vertical rate, but setting the mod to +4.00 will be effectively zero.. it's odd and it's been like this for several releases, and I'm not sure what's causing it, but... it's a workaround for one of the things that TCA is currently not able to do.

update:  I can't even get AT_Utils to build, period, in visual studio - I know Allista has a linux-based build system for this, which ordinarily I could adapt to but it seems it's a custom build environment and not all the pieces are in the AT_Utils github project (nor the TCA project).  I've built prior versions in VS before but this time it's eluding me with unresolved references that.. look like they're being clearly resolved.  so I'm a bit stuck on this.  Granted my VS/C# isn't that great, I mostly develop in python and C++ using gcc/g++ and standard Makefiles/cmake ... I feel like I'm at the limit of my understanding of VS in terms of resolving the build dependencies... so I suppose I will just wait for an official rebuild or if someone knows how to get it to build in visual studio, I'm all ears :)

So I've decided to also give it a try, since I really love this mod. What I quickly realized is that allista uses a master repo (https://github.com/allista/AT_KSP_Plugins) and using that I can build it against the current version after copying my KSP_x64_Data folder to KSP_Data (alternatively you could change the references). I tried it out quickly and recompiling did not resolve the problem. I'll try to take a closer look at it tomorrow, but I don't know if I will be able to even find the problem, because while I'm relatively good at C# I haven't done any KSP/Unity modding so far.

One thing I found so far in the log file:

[EXC 22:37:43.878] ArgumentException: Getting control 0's position in a group with only 0 controls when doing repaint
Aborting
	UnityEngine.GUILayoutGroup.GetNext () (at <fa6f9762ac624af092525d37c9d516c4>:0)
	UnityEngine.GUILayoutUtility.BeginLayoutGroup (UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options, System.Type layoutType) (at <fa6f9762ac624af092525d37c9d516c4>:0)
	UnityEngine.GUILayout.BeginVertical (UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at <fa6f9762ac624af092525d37c9d516c4>:0)
	UnityEngine.GUILayout.BeginVertical (UnityEngine.GUILayoutOption[] options) (at <fa6f9762ac624af092525d37c9d516c4>:0)
	ThrottleControlledAvionics.TCAGui.DrawMainWindow (System.Int32 windowID) (at <5ca06e48456b45f4acb4805fdff16495>:0)
	UnityEngine.GUILayout+LayoutedWindow.DoWindow (System.Int32 windowID) (at <fa6f9762ac624af092525d37c9d516c4>:0)
	UnityEngine.GUI.CallWindowDelegate (UnityEngine.GUI+WindowFunction func, System.Int32 id, System.Int32 instanceID, UnityEngine.GUISkin _skin, System.Int32 forceRect, System.Single width, System.Single height, UnityEngine.GUIStyle style) (at <fa6f9762ac624af092525d37c9d516c4>:0)

 

Share this post


Link to post
Share on other sites
Posted (edited)
1 hour ago, Sephiroth_018 said:

So I've decided to also give it a try, since I really love this mod. What I quickly realized is that allista uses a master repo (https://github.com/allista/AT_KSP_Plugins) and using that I can build it against the current version after copying my KSP_x64_Data folder to KSP_Data (alternatively you could change the references). I tried it out quickly and recompiling did not resolve the problem. I'll try to take a closer look at it tomorrow, but I don't know if I will be able to even find the problem, because while I'm relatively good at C# I haven't done any KSP/Unity modding so far.

One thing I found so far in the log file:


[EXC 22:37:43.878] ArgumentException: Getting control 0's position in a group with only 0 controls when doing repaint
Aborting

 

Yeah, that's the exception I fished out too.... Means it's likely the right one, rather than one of the gazillion other mods I use.

A quick hunt shows that the TAC addon experienced the same 

It has now been patched, so that might be a good starting point.

Unfortunately, as I can work from home, and with the overhead of dealing with a lockdown, my days are busier than usual so I don't have much time to sink into this right now.

 

Edited by Baslifico

Share this post


Link to post
Share on other sites
Posted (edited)
13 hours ago, Baslifico said:

Yeah, that's the exception I fished out too.... Means it's likely the right one, rather than one of the gazillion other mods I use.

A quick hunt shows that the TAC addon experienced the same 

It has now been patched, so that might be a good starting point.

Unfortunately, as I can work from home, and with the overhead of dealing with a lockdown, my days are busier than usual so I don't have much time to sink into this right now.

 

The info with TAC will most likely be helpful, thanks. Let's see if I can fix it over the weekend.

 

Update:

After trying it out again with a clean KSP install, the error does not always show up but the elements are still missing, so this was most likely not the cause, just some stuff which most likely meant nothing.

Edited by Sephiroth_018

Share this post


Link to post
Share on other sites

My finding so far: The cause seems to be a problem with loading the ThrottleControledAvionics assets bundle (happens here which prevents getting past this point and drawing the elements). I'm currently setting up KSP 1.8 to verify that this worked there and I'm not missinterpreting things. If this is the problem I have to try to set up Unity so I can try recompiling that bundle...

Share this post


Link to post
Share on other sites
Posted (edited)

So, after a lot of trial and error (with 100% error), I have to give up. The problem is most likely in the assets bundle (also see my previous post), and I cannot get Unity to create a working bundle (various "script missing" errors in the assets). I hope that this helps you, @allista.

And just to be clear, that problem occurs for both the at_utils_ui.ksp and tca_ui.ksp bundles.

Edited by Sephiroth_018

Share this post


Link to post
Share on other sites
Posted (edited)

@Sephiroth_018 Can you provide a repo or meta-repo (using submodules) that repros this circumstance? I'd like to take a whack at it from where you left off.

Additionally, @allista, how do you go about preparing these bundles- does this issue sound like it has an obvious solution to you?

Edited by Dessix

Share this post


Link to post
Share on other sites

@Dessix Only thing I did is get the sources from @allista's meta repo (https://github.com/allista/AT_KSP_Plugins), set everything up and then start debugging.

Steps I did for setup:

  • Copied a fresh KSP 1.9.1 instance with only TCA (and dependencies) into "ksp-test/KSP_test_1.9.1" in the main folder of the meta repo
  • Changed the references to use the KSP 1.9.1 libs in all project files (I created a symlink "KSP_Data" pointing to "KSP_x64_Data" in the KSP folder so that I only had to change the version number of the references)
  • Unloaded the KSP-AVC-updater project (because it threw some compile errors later and I don't care about it)
  • Switched the "Debugging Information" setting under "Properties" -> "Build" -> "Advanced" to "Portable" for all projects (breakpoints didn't work without this for me)
  • Recompile
  • Copy the compiled dlls in the GameData folders in the respective projects (AT_Utils, ThrottleControlledAvionics) to my KSP test instance
  • Followed the instructions in this specific post to be able to attach to the KSP process and use breakpoints

After that I debugged around and eventually discovered that the asset bundles are not being loaded (no error, just not loaded) which results in the controls not drawn, as these come from the assets. From what I saw when opening the assets in Unity 2019 I think all the custom code attached to assets needs to be reattached and I was only able to identify the top level scripts.

 

Sorry for not being able to provide a repo, but 99% of this was setup and debugging with breakpoints.

Good luck trying to fix this, but I fear that some necessary files for Unity are missing from the repo (from what I read this was a common problem with earlier Unity versions).

 

Share this post


Link to post
Share on other sites

I just wanted to take a moment and say thank you to you guys for trying to fix this in Allista's absence.  It is really appreciated.

Share this post


Link to post
Share on other sites
On 4/16/2020 at 12:26 PM, SkyPunch said:

I just wanted to take a moment and say thank you to you guys for trying to fix this in Allista's absence.  It is really appreciated.

on that note.. is @allista ok?  Given the circumstances, I hope that he and everyone else is staying safe... I wish I had more Visual Studio // mono skills to help fix this, but I appear to be at the limits of my ability to do so.  Happy to help test, though, if anyone has any interim builds.

Share this post


Link to post
Share on other sites

I want to thank you all for the support you give, and for the effort you make to keep the mods alive.

My periodic absence is not caused by boredom or tiredness with KSP; but simply by the overwhelming amount of work that often live me no free time apart for the hours I spent with the family.

So as far as KSP lives and as soon as get some free time I would continue to develop for KSP and for you.

That being said...

 

Version 3.6.2.1 for Kerbal Space Program 1.9.1

Released on 2020-04-28

  • Compatible with KSP-1.9
  • Compiled against AT_Utils 1.9.2

 Download 

 

Version 3.6.2 for Kerbal Space Program 1.8.1

Released on 2020-04-28

  • Fixed RCS specific torque calculation for some thrusters
  • Added integration with the new CargoAccelerators mod (WIP)
  • Compiled against AT_Utils 1.9.1

 Download 

Share this post


Link to post
Share on other sites

Woo, thanks @allista!

Also, that CargoAccelerators mod looks like something I've been looking for for a while. Excited to use them both :)

Share this post


Link to post
Share on other sites
4 hours ago, Dessix said:

Woo, thanks @allista!

Also, that CargoAccelerators mod looks like something I've been looking for for a while. Excited to use them both :)

It's still under heavy development. You can play with it in sandbox, but it's unusable for career.

I'll make dedicated forum thread for it soon.

Share this post


Link to post
Share on other sites

Thank you very much for the updated version, @allista. Btw, did I see that correctly that the problem with the bundle was the missing file extension? Makes me feel kind of dump for not trying that...

Also, I have one request:

Could you please include the .meta files generated by Unity so that others can also correctly open the Unity project? In them (at least according to what I read), Unity stores unique file ids that it then uses for referencing in the editor. Without them, those references (eg to code) can't be restored.

Share this post


Link to post
Share on other sites
Posted (edited)

there might be an issue with the controls UI when going to flight mode a second time.  only the modules and main UI is showing up but the controls UI not. there is also an error in the console which states something with an error on redrawing. anyone   with the same issue?

 

Log:

[EXC 23:42:21.769] ArgumentException: Getting control 0's position in a group with only 0 controls when doing repaint
Aborting
    UnityEngine.GUILayoutGroup.GetNext () (at <fa6f9762ac624af092525d37c9d516c4>:0)
    UnityEngine.GUILayoutUtility.BeginLayoutGroup (UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options, System.Type layoutType) (at <fa6f9762ac624af092525d37c9d516c4>:0)
    UnityEngine.GUILayout.BeginVertical (UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at <fa6f9762ac624af092525d37c9d516c4>:0)
    UnityEngine.GUILayout.BeginVertical (UnityEngine.GUILayoutOption[] options) (at <fa6f9762ac624af092525d37c9d516c4>:0)
    ThrottleControlledAvionics.TCAGui.DrawMainWindow (System.Int32 windowID) (at <e689ed1085464a36ab2516ad57c1a974>:0)
    UnityEngine.GUILayout+LayoutedWindow.DoWindow (System.Int32 windowID) (at <fa6f9762ac624af092525d37c9d516c4>:0)
    UnityEngine.GUI.CallWindowDelegate (UnityEngine.GUI+WindowFunction func, System.Int32 id, System.Int32 instanceID, UnityEngine.GUISkin _skin, System.Int32 forceRect, System.Single width, System.Single height, UnityEngine.GUIStyle style) (at <fa6f9762ac624af092525d37c9d516c4>:0)
    UnityEngine.DebugLogHandler:LogException(Exception, Object)
    ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
    UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)

 

Also found a second exception. i do not know if related

[EXC 00:14:41.952] NullReferenceException: Object reference not set to an instance of an object
    AT_Utils.UIBundle+<LoadAsset>d__10.MoveNext () (at <488b8abd490d4610a99c7b87ac625952>:0)
    AT_Utils.UIWindowBase`1+<Show>d__16[T].MoveNext () (at <488b8abd490d4610a99c7b87ac625952>:0)
    UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <5aeafee3fea24f37abd1315553f2cfa6>:0)
    UnityEngine.DebugLogHandler:LogException(Exception, Object)
    ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
    UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)
 

Edited by GoAHead

Share this post


Link to post
Share on other sites
2 hours ago, GoAHead said:

 anyone   with the same issue?

 

Yeah, i got those errors as well.

Share this post


Link to post
Share on other sites
Posted (edited)
13 hours ago, Sephiroth_018 said:

Btw, did I see that correctly that the problem with the bundle was the missing file extension?

No, it was that the KSP stopped autoloading non-squad bundles, so I had to reimplement the loading process with pure Unity API. Now they're being loaded not by their "names" (that KSP was changing during "bundle compilation"), but by file paths. Hence the need to add the extension, which is just the part of the file name.

13 hours ago, Sephiroth_018 said:

Could you please include the .meta files generated by Unity so that others can also correctly open the Unity project? In them (at least according to what I read), Unity stores unique file ids that it then uses for referencing in the editor. Without them, those references (eg to code) can't be restored.

Oh, boy, certainly will do!

Unity gives hell to VCS :/

10 hours ago, GoAHead said:

Also found a second exception. i do not know if related

[EXC 00:14:41.952] NullReferenceException: Object reference not set to an instance of an object
    AT_Utils.UIBundle+<LoadAsset>d__10.MoveNext () (at <488b8abd490d4610a99c7b87ac625952>:0)
    AT_Utils.UIWindowBase`1+<Show>d__16[T].MoveNext () (at <488b8abd490d4610a99c7b87ac625952>:0)
    UnityEngine.SetupCoroutine.InvokeMoveNext (System.Collections.IEnumerator enumerator, System.IntPtr returnValueAddress) (at <5aeafee3fea24f37abd1315553f2cfa6>:0)
    UnityEngine.DebugLogHandler:LogException(Exception, Object)

That's the culprit. Thanks!

Without automated testing (and the lack of several human slaves at my disposal) I'm doomed to miss these bugs :(

Edited by allista

Share this post


Link to post
Share on other sites
9 hours ago, allista said:

Without automated testing (and the lack of several human slaves at my disposal) I'm doomed to miss these bugs 

No worries, even the biggest companies with hundreds of employers publish software with bugs. With large TCA fan base it is high chance that bugs will be noticed and have chance to be fixed soon enough.

Share this post


Link to post
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.