Jump to content

[1.11–1.12] Planning Node 0.1.4


HebaruSan

Recommended Posts

13 hours ago, Krazy1 said:

I'm a bit nervous about ignoring EXC. Another dev said they are always bad in flight and should be fixed.

That's a very good rule of thumb in most cases, yes. If a mod's code is throwing exceptions, those should just be fixed. If stock code is throwing an exception (as in this case), that should also be fixed if possible; if not possible (since mod developers can't edit stock code), then it may have to be lived with.

I'm by no means a Unity wizard at this point, but I did spend quite a while fighting with this exception, and the two options I ended up with were what I've summarized so far: let it happen to interrupt the OrbitDriver's initialization, or have the whole mod get deleted out of memory as soon as you click the button. Maybe there are some advanced tricks that I don't know about that could be applied here.

Quote

But I can't ignore the log spam .  It's writing about 1 MB per second in the KSP log and I'm sure KSP would crash if I didn't exit quickly.

  Hide contents






[LOG 19:17:05.807] dT is NaN! tA: NaN, E: NaN, M: NaN, T: NaN
  at System.Environment.get_StackTrace () [0x00000] in <ad04dee02e7e4a85a1299c7ee81c79f6>:0 
  at Orbit.GetDTforTrueAnomaly (System.Double tA, System.Double wrapAfterSeconds) [0x00000] in <2afc64dea36946459d4707808bdac511>:0 
  at Trajectory.UpdateFromOrbit (Orbit orbit, System.Int32 sampleCount) [0x00000] in <2afc64dea36946459d4707808bdac511>:0 
  at PatchRendering.UpdatePR () [0x00000] in <2afc64dea36946459d4707808bdac511>:0 
  at PatchedConicRenderer.LateUpdate () [0x00000] in <2afc64dea36946459d4707808bdac511>:0 

Yeah, that one I have much less of a handle on (again the difficulties of debugging stock code). I guess I should add these things to the bugtracker so folks can see they exist and to track the status...

Edited by HebaruSan
Link to comment
Share on other sites

8 hours ago, HebaruSan said:

That's a very good rule of thumb in most cases, yes. If a mod's code is throwing exceptions, those should just be fixed. If stock code is throwing an exception (as in this case), that should also be fixed if possible; if not possible (since mod developers can't edit stock code), then it may have to be lived with.

I'm by no means a Unity wizard at this point, but I did spend quite a while fighting with this exception, and the two options I ended up with were what I've summarized so far: let it happen to interrupt the OrbitDriver's initialization, or have the whole mod get deleted out of memory as soon as you click the button. Maybe there are some advanced tricks that I don't know about that could be applied here.

Yeah, that one I have much less of a handle on (again the difficulties of debugging stock code). I guess I should add these things to the bugtracker so folks can see they exist and to track the status...

This is absolutely true. Exceptions are the program's way of saying something didn't go the way the program expected. NullReferenceException is the program's way of flagging that something it thought should exist doesn't, which makes complete sense with stock code being bent to display an orbit without a real vessel. Looking at the call stack, it isn't even possible to hide this message with a catch block since it's from a Unity/Stock call tree... Does it show up every frame? 1MB/s seems like a lot (I'm not sure if other users see that rate or not), but it's going to hard drive and not RAM so it's unlikely to crash KSP - just fill up your disk. :p

Link to comment
Share on other sites

3 minutes ago, Booots said:

Looking at the call stack, it isn't even possible to hide this message with a catch block since it's from a Unity/Stock call tree...

True, but my hope is that I can manipulate that code's environment (read: set properties on my solver's Orbit patches) to convince it to shut up. However, so far I have not been able to make that work.

3 minutes ago, Booots said:

Does it show up every frame? 1MB/s seems like a lot (I'm not sure if other users see that rate or not), but it's going to hard drive and not RAM so it's unlikely to crash KSP - just fill up your disk. :p

The exception only shows up once. The one starting with "[LOG]" isn't even an exception, but rather just a Debug.Log call that stock code is making, and that's the one that spams the log.

Link to comment
Share on other sites

4 minutes ago, HebaruSan said:

True, but my hope is that I can manipulate that code's environment (read: set properties on my solver's Orbit patches) to convince it to shut up. However, so far I have not been able to make that work.

The exception only shows up once. The one starting with "[LOG]" isn't even an exception, but rather just a Debug.Log call that stock code is making, and that's the one that spams the log.

Do you know what field it's looking for? I wonder if you could make add a pair of LateUpdate methods and somehow sandwich OrbitTargeter to set the field to something and then clear it without breaking anything...

But if it only shows up once per node, honestly I'd leave it (maybe add a log statement earlier in the same frame telling users that it's okay). Heck, ReCoupler throws an exception every launch but I'm not going to spend the hours tracking it down. :p If it's just Debug.Log, consider wrapping it in an #ifdef DEBUG/#endif to remove it from the shipped version and you're good to go!

Link to comment
Share on other sites

4 minutes ago, Booots said:

If it's just Debug.Log, consider wrapping it in an #ifdef DEBUG/#endif to remove it from the shipped version and you're good to go!

It's not my Debug.Log statement, though, it's in Orbit.GetDTforTrueAnomaly, and I don't control the shipped version of the stock game. :sob:

Edited by HebaruSan
Link to comment
Share on other sites

1 minute ago, HebaruSan said:

It's not my Debug.Log statement, though, it's in Orbit.GetDTforTrueAnomaly, and I don't control the shipped version of the stock game. :joy:

Oh I'm sorry, I didn't read the call tree on that one. My bad. More fun with environment manipulation!

Link to comment
Share on other sites

I really appreciate the work on this guys. It's got to be almost impossible to mod something if you can't even see it. I wish I could ignore the log spam but we're talking about a triggered infinite loop of spam here. A spam avalanche... a "spavalanche" ?  :confused:

So just out of curiosity, I tried it again and just let it run.  The log grew about 100 MB a minute.  I tried to grab the prograde handle to set an orbit and I got a bunch of red and orange  messages and the node went back to the asterisk shape and I couldn't do anything else with it.  I actually  opened the log in Wordpad  but it was so slow I couldn't scroll to the bottom.  It was 840 MB. :o

Good luck! We're here for moral support.

Link to comment
Share on other sites

Was curious on this mod and tried it today. However could successfully create a planning node . I got the same issues I have with the stock maneuver node, which is always unfocusing, clicking something in the back, etc. Especially if you are close to a planet and you have to zoom out to observe the orbit, pretty much everything on that planet gets triggered, focussed, etc. while trying to adjust the node. Sadly it seems to not be compatible with precise maneuver. Do you think that would be possible?

Link to comment
Share on other sites

5 hours ago, chris-kerbal said:

Sadly it seems to not be compatible with precise maneuver. Do you think that would be possible?

Only if PreciseManeuver's maintainer wants to do development to make it possible. It only uses the patched conic solver from the active vessel (whereas Planning Node makes its own separate solver, since planning nodes don't start with the vessel's orbit):

The stock maneuver editing pane in the lower left seems to have the same limitation, for what it's worth.

Edited by HebaruSan
Link to comment
Share on other sites

3 minutes ago, HebaruSan said:

Only if PreciseManeuver's maintainer wants to do development to make it possible. It only uses the patched conic solver from the active vessel (whereas Planning Node makes its own separate solver, since planning nodes don't start with the vessel's orbit):

The stock maneuver editing pane in the lower left seems to have the same problem, for what it's worth.

I can ask him, but for him the mod is now more in maintenance, than active development.

Yeah, missed to put that in my text as well. It opens and then flips right away. Otherwise it would have been a nice workaround.

Link to comment
Share on other sites

Following a sudden epiphany, Planning Node v0.1.3 is released!

  • Fixed a bug nobody probably noticed where the auto-adjust maneuver time button would adjust you to the wrong node if you had several, which was caused by a stock API function swapping the Y and Z coordinates of vectors in its return value. Luckily it's easy to swap them back.
  • Eliminated the log spam. My investigation notes are at https://github.com/HebaruSan/PlanningNode/issues/3 for the curious, but to sum up, the stock PatchedConics class provides an easy way to inject our own logic into its operations, of which we now take advantage to prevent the bad data about which the log spam was complaining. (It turns out you get a lot of unwanted Kerbin encounters when your orbit is exactly the same as Kerbin's, go figure.)

https://github.com/HebaruSan/PlanningNode/releases/tag/v0.1.3

Edited by HebaruSan
Link to comment
Share on other sites

On 3/11/2021 at 12:54 PM, DirtyFace83 said:

I will likely wait until it's closer to 1.0 to use it as part of a mod setup for a full playthrough though.

For what it's worth, in case you didn't mean this metaphorically, I don't choose version numbers based on expected stability. I guess I believe in Murphy's Law: as soon as I declare a release safe and stable, a huge previously unknown bug will be found and a series of emergency hotfix releases will ensue.

Link to comment
Share on other sites

Initial 0.1.3 report. Win10 KSP 1.11.1 with other mods 

Spoiler

[x] Science! Continued (xScienceContinued 5.26)
Breaking Ground (BreakingGround-DLC 1.6.0)
ClickThrough Blocker (ClickThroughBlocker 1:0.1.10.15)
Community Trait Icons (CommunityTraitIcons v1.1.1)
Contract Parser (ContractParser 9.0)
Contracts Window + (ContractsWindowPlus 9.4)
Distant Object Enhancement Continued (DistantObject v2.0.2.0)
Distant Object Enhancement Continued default config (DistantObject-default v2.0.2.0)
EasyBoard (EasyBoard 1.10)
Editor Extensions Redux (EditorExtensionsRedux 3.4.2)
Fill It Up (FillitUp 0.2.0.1)
Hangar Extender (HangerExtenderExtended 3.6.0)
Kerbal Alarm Clock (KerbalAlarmClock v3.13.0.0)
Kerbal Engineer Redux (KerbalEngineerRedux 1.1.8.3)
Making History (MakingHistory-DLC 1.11.0)
Module Manager (ModuleManager 4.1.4)
Planning Node (PlanningNode v0.1.3)
Portrait Stats (PortraitStats 18.0)
Progress Parser (ProgressParser 11.0)
QuickBrake (QuickBrake 1:1.4.0.7)
QuickGoTo (QuickGoTo 1:1.4.0.8)
SpaceTux Library (SpaceTuxLibrary 0.0.6)
TAC Fuel Balancer (TacFuelBalancer v2.21.5.1)
TextureReplacer (TextureReplacer v4.3.1)
Toolbar Controller (ToolbarController 1:0.1.9.4)
Triangulum Galaxy Skybox (TriangulumGalaxySkybox 1.0)
TriggerAu Flags (TriggerAu-Flags v2.10.0.0)
TweakScale - Rescale Everything! (TweakScale v2.4.4.5)
Waypoint Manager (WaypointManager 2.8.2.7)
Zero MiniAVC (ZeroMiniAVC 1:1.1.0.1)

I loaded a very early career game with a ship on the launchpad. First realization- patched conics are not available with a level 1 tracking station. I suggest making this mod handle this case with a message and inhibit operation, at least to be consistent with the core game but also to prevent possible core/ mod conflict (just a guess).

I tried the compass icon anyway and it did place the node, opened the popup window and produced the expected red exception text as discussed before. 

Then I tried clicking the node to open the handles like other nodes do. I got orange errors and more red exceptions; the view jumped back; the Esc, Tab and M keys stopped responding.

Spoiler

2xsUDA6.png

I used QuickGoTo to jump to KSC and exit.  No infinite log spam - good! I'll try sandbox next.

UPDATE.... I tried the same career game again and the node handles do work the first time. Then I clicked away from the node; the handles retract; then I clicked the node again to get the handles back and then I got the behavior above. The scroll wheel stops working too.

Edited by Krazy1
Link to comment
Share on other sites

26 minutes ago, Krazy1 said:

I loaded a very early career game with a ship on the launchpad. First realization- patched conics are not available with a level 1 tracking station. 

Thanks for the report. Created for tracking: https://github.com/HebaruSan/PlanningNode/issues/4

The exception is an easy fix, but as you note there are broader balance and progression questions to address for career mode as well.

26 minutes ago, Krazy1 said:

I'll try sandbox next.

Yes, please do. The more feedback I receive, the more fixes I can pack into the next release.

Link to comment
Share on other sites

I tried Sandbox and Career with a level 2 tracking station and they work. Just the normal exception from the compass icon. I got a prograde only hit on Dres (leaves y2d117) :sticktongue: 

It also passed some potential KAC pitfalls. The PN "warp" button does not override earlier KAC warp canceling alarms. User cannot set  a KAC node alarm  on the PN node. I just says "there no  maneuver nodes found". That's fine, just confirming there's no unholy interaction. 

One request though - I can't place additional maneuver nodes on the planning conic. I wish it would support multiple nodes so I could plan a whole trip. I can't get the insertion dV at the target. With multiple nodes we can plan mid-course inclination change, gravity slingshots, bi-elliptic transfers, etc.  I'd like to plan the trip path before I even start designing a ship for the mission or before I accept a contract. It wouldn't need to to anything beyond stock node behavior on the planning conic.  

Link to comment
Share on other sites

16 hours ago, Krazy1 said:

One request though - I can't place additional maneuver nodes on the planning conic. I wish it would support multiple nodes

Agreed, and I was surprised when this didn't happen automatically given what I have set up so far. Did some digging, and it seems to be another spot where stock code (in this case, OrbitTargeter) is limiting functionality to conic solvers associated with the active vessel only (ours is associated with a hidden dummy vessel). So I probably can't do this one.

Quote

I'd like to plan the trip path before I even start designing a ship for the mission or before I accept a contract.

Well, you'll have to build some ship to get into map view to start making planning nodes, since that's the only place where stock code allows editing maneuver nodes.

15 hours ago, Krazy1 said:

One minor thing. The bullseye rings are being hidden behind a planet but the text shows through.

It would be nice if the text was hidden too.

This would entail migrating away from OnGUI, which I should do anyway (it's just so much easier), but I'm not having a lot of luck with getting a Unity.UI.Button to display so far. Hopefully I'll find the right tutorial or sample code eventually.

EDIT: Tracking this at https://github.com/HebaruSan/PlanningNode/issues/5 so I can go do some CKAN stuff without forgetting.

Edited by HebaruSan
Link to comment
Share on other sites

11 hours ago, HebaruSan said:

For what it's worth, in case you didn't mean this metaphorically, I don't choose version numbers based on expected stability. I guess I believe in Murphy's Law: as soon as I declare a release safe and stable, a huge previously unknown bug will be found and a series of emergency hotfix releases will ensue.

Haha, yea... always the way I guess. I meant it mostly metaphorically, yes. 

Link to comment
Share on other sites

12 hours ago, HebaruSan said:

limiting functionality to conic solvers associated with the active vessel only

That's unfortunate. Hmm. I suppose you could actually change the active ship to the dummy - that would cause loading delays going back and forth ... a bit clunky.  

I could cheat a test ship to the same orbit as the departing body leading it just outside SOI. Then I could use the patched conics. But it wouldn't translate easily with this mod to get the departure the same.  

Link to comment
Share on other sites

  • 2 months later...

Planning Node v0.1.4 is released.

  • Require mission control and tracking station upgrades in career mode

I still hope to occlude the marker text with planets, but I wasn't able to figure that out this time. Instead, this release converts the internal .ckan file to YAML format as a test for some recent CKAN infrastructure changes (this will have no impact on users).

https://github.com/HebaruSan/PlanningNode/releases/tag/v0.1.4

Link to comment
Share on other sites

  • 1 year later...

How can I adjust the orbit +/- in the planned node? I clicked new, and it made a node 59 days in advance. My transfer window per the alarm clock says I have 39 days. So I drag the node slightly closer, and suddenly the burn start time says T- 1y 30d and the intersept is botched. Then I drag it slightly farther, and it's added another orbit, now says T-2y 36d.  Thanks

 

SkTsuot.png

 

 

Link to comment
Share on other sites

16 hours ago, immolated said:

How can I adjust the orbit +/- in the planned node?

Hi, you can use the standard stock tools for this:

  1. Left click to open the maneuver node editing widget (it's closed in your screenshot)
    b0saRuu.png
  2. Right click the widget to switch it to the +/- buttons:
    FqzyMWI.png
  3. Click them as needed:
    S7YHKe0.png
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...