Jump to content

[1.12.x] Kerbal Alarm Clock v3.13.0.0 (April 10)


TriggerAu

Recommended Posts

thats pretty much my understanding of things too. MJs formula's used to be the same as the circular orbits you mention on the wiki as well, but I havent looked at that code in a while. I've wondered a few times about simply removing the transfer function from KAC, or implementing somthing like AlexMuns tool so people can use a more accurate tool, but the math is over my head TBH.

Link to comment
Share on other sites

Would it be possible to implement something to auto generates an alarm if 2 vessels will come within 2.5 km of each other (just one or two orbits in advance)? I like to keep track of how everything is drifting about and try to do station keeping such that none of my satellites get to close to one another.

I feel that if any mod could do this it would definitely be KAC since it would be similar to the way the mod detects SOI transitions. :)

Link to comment
Share on other sites

thats pretty much my understanding of things too. MJs formula's used to be the same as the circular orbits you mention on the wiki as well, but I havent looked at that code in a while. I've wondered a few times about simply removing the transfer function from KAC, or implementing somthing like AlexMuns tool so people can use a more accurate tool, but the math is over my head TBH.

Let me spend my 2cents here. The way KAC already implements transfer alarms could hardly be improved. The most we may ask is for an increase in the number of years the model solution is already calculated.

To compute correctly the timing of transfer windows, with orbits that are elliptic and inclined, there is not a single formula to be used. The method used is a variant of iterative procedures, first used by C.F. Gauss in 1801, and requires to minimize errors in a system of 3 equations with 3 unknowns for determining the transfer orbit parameters (semi-major axis, semi-latus rectum, eccentric anomaly with the transfer orbit) given the positions of the bodies involved. Flight time with one of those equations is used to check the error against the flight time used initially.

As the method is iterative, it can't really be applied to any tool designed to work in real-time, like KAC. The amount of CPU cycles required to solve for a single day and a single pair of bodies is already significant, but if used to compute along a number of years for all bodies orbiting the Kerbol system, that would either make KSP appear extremely laggy or stopped, or would not complete until after a very large number of KSP frames are elapsed (truly not acceptable real-time wise). Therefore, the best approach remains to use a table of precomputed windows, just what the model mode actually does.

The formula mode in KAC, computed almost real-time, is actually close enough with most orbits to be good for a generic alarm. But for any transfer window that I really want to use, I prefer to double-check with Arrowstar or Alexmun tools. The more so with highly eccentric orbits like Eeloo.

Edited by diomedea
minor wording corrections
Link to comment
Share on other sites

Would it be possible to implement something to auto generates an alarm if 2 vessels will come within 2.5 km of each other (just one or two orbits in advance)? I like to keep track of how everything is drifting about and try to do station keeping such that none of my satellites get to close to one another.

I feel that if any mod could do this it would definitely be KAC since it would be similar to the way the mod detects SOI transitions. :)

From the way you've written it I guess you know you can do that using the Closest Approach alarm type, but you do need to set it up for each vessel/combination. (in case not heres the manual screenshot.

Add_Closest.png

If you mean have it watch all the orbits in game and detect these types of events then it could be possible. Let me know which one it is your after

Link to comment
Share on other sites

v2.7.4.0 Now Available - Download from GitHub or Download from Curse* * Once it's approved

So heres the list of tweaks here:

  • Removed log message on periodic saves (Issue #25)
  • Window height now adjusts for Multiline Alarms (Issue #15)
  • Closest Approach Alarms now allow target of Docking Port (Issue #1)
  • Fixed duplication of Manuever Nodes on Ship Jump (Issue #23)
  • Changed latest version file source to be Google site (smaller file)Removed links to spaceport

Next up is ability to add alarms at the SC and TS screens now that I've cleared my workload of a bunch of stuff, then on to version 3

On the transfer windows I am looking at how I could perhaps generate a new table of model data for a longer period of time and keep the file size relatively small, but will keep people up to date.

Edited by TriggerAu
link typo
Link to comment
Share on other sites

From the way you've written it I guess you know you can do that using the Closest Approach alarm type, but you do need to set it up for each vessel/combination. (in case not heres the manual screenshot.

https://sites.google.com/site/kerbalalarmclock/_/rsrc/1382357518731/images/Add_Closest.png

If you mean have it watch all the orbits in game and detect these types of events then it could be possible. Let me know which one it is your after

Sorry for the confusion but yes I was wondering about the possibility of something watching all the orbits in game and automatically detect if a ship passes within certain distance of any other ship.

Link to comment
Share on other sites

There's what looks like a fresh bug in the latest version, at least it didn't happen with the one immediately prior.

When switching between vessels, going EVA and back, etc, KSP freezes for up to fifteen seconds. After lots of testing I tracked this down to KAC -- apparently, every time on vessel initialisation, it checks for a new version across the web or something of the sort, locking the entire process up, and wherever it checks takes too long to respond.

Turning off checking for new versions fixes the problem.

My suggestion would be to reduce the timeout on the check to something more reasonable, or better yet, rewrite it in some kind of asynchronous fashion.

Link to comment
Share on other sites

There's what looks like a fresh bug in the latest version, at least it didn't happen with the one immediately prior.

When switching between vessels, going EVA and back, etc, KSP freezes for up to fifteen seconds. After lots of testing I tracked this down to KAC -- apparently, every time on vessel initialisation, it checks for a new version across the web or something of the sort, locking the entire process up, and wherever it checks takes too long to respond.

Turning off checking for new versions fixes the problem.

My suggestion would be to reduce the timeout on the check to something more reasonable, or better yet, rewrite it in some kind of asynchronous fashion.

Well thats not good. At most it should do it once a day - Am pretty sure thats what I saw in my testing.

I tried making it async a while ago, but couldnt get the code to work for me.

I'll revisit it asap, thanks

Link to comment
Share on other sites

There's what looks like a fresh bug in the latest version, at least it didn't happen with the one immediately prior.

When switching between vessels, going EVA and back, etc, KSP freezes for up to fifteen seconds. After lots of testing I tracked this down to KAC -- apparently, every time on vessel initialisation, it checks for a new version across the web or something of the sort, locking the entire process up, and wherever it checks takes too long to respond.

Turning off checking for new versions fixes the problem.

My suggestion would be to reduce the timeout on the check to something more reasonable, or better yet, rewrite it in some kind of asynchronous fashion.

So doing some testing here and it seems to be working fine for me. I get only one check each day for the flight mode entering one unless I nuke my settings.

If you don't mind Mihara, can you pastebin your log file, config and save with it breaking. There must be something I'm not seeing here, hopefully theres something in the log

I'll also put the Async version check idea on the list of work as it is a good idea that I forgot to bring back (Issue #28)

Link to comment
Share on other sites

v2.7.4.0 Now Available

....

....

  • Removed log message on periodic saves (Issue #25)
  • Window height now adjusts for Multiline Alarms (Issue #15)

....

....

Next up is ability to add alarms at the SC and TS screens.......

Oh Yeah! Those are the three things, that I wished to be in this update. Good Job man!

Link to comment
Share on other sites

I was wondering if it were possible to have the "Alarms-savegamename (career/sandbox).txt" that contains the actual alarms to be located in the specific save game folder rather than in the GameData subfolders. As I backup my saves, I often lose my alarms (forgetting to also move this txt file into my zip).

Link to comment
Share on other sites

So doing some testing here and it seems to be working fine for me. I get only one check each day for the flight mode entering one unless I nuke my settings.

Well, you aren't in Russia and aren't on my ISP, so the circumstances where the problem manifests may be tough to replicate and might not even be your fault. However, it remains that turning version checking off fixes the problem.

Actually, upon reflection, here it is...


6/10/2014 4:45:35 PM,KerbalAlarmClock,Starting Version Check-No current web version stored

(Filename: C:/BuildAgent/work/d3d49558e4d408f4/artifacts/StandalonePlayerGenerated/UnityEngineDebug.cpp Line: 53)

6/10/2014 4:45:35 PM,KerbalAlarmClock,Reading version from Web

(Filename: C:/BuildAgent/work/d3d49558e4d408f4/artifacts/StandalonePlayerGenerated/UnityEngineDebug.cpp Line: 53)

You are trying to load data from a www stream which had the following error when downloading.
Unknown SSL protocol error in connection to sites.google.com:443

(Filename: Line: 1066)

You are trying to load data from a www stream which had the following error when downloading.
Unknown SSL protocol error in connection to sites.google.com:443

(Filename: Line: 1066)

6/10/2014 4:45:43 PM,KerbalAlarmClock,Response Length:0

(Filename: C:/BuildAgent/work/d3d49558e4d408f4/artifacts/StandalonePlayerGenerated/UnityEngineDebug.cpp Line: 53)

6/10/2014 4:45:43 PM,KerbalAlarmClock,Got Version ''

'No current web version stored' pops up every time, because it never gets a correct web version, (I reinstalled everything recently, so there isn't one stored.) and since it doesn't have one, it goes to redo the web version check every time.

I'm not sure if the problem is with their hosting, or with Unity being silly, but the correct solution would be to handle that error specially, for example, by disabling version checking and notifying the user. It might be that because I have IPv6, and so does sites.google.com, an IPv6 connection happens and they answer differently to those.

Link to comment
Share on other sites

There's what looks like a fresh bug in the latest version, at least it didn't happen with the one immediately prior.

When switching between vessels, going EVA and back, etc, KSP freezes for up to fifteen seconds. After lots of testing I tracked this down to KAC -- apparently, every time on vessel initialisation, it checks for a new version across the web or something of the sort, locking the entire process up, and wherever it checks takes too long to respond.

Turning off checking for new versions fixes the problem.

My suggestion would be to reduce the timeout on the check to something more reasonable, or better yet, rewrite it in some kind of asynchronous fashion.

I have this exact same problem when I play KSP when I don't have an internet connection. From my KSP.log:


[LOG 15:20:37.006] 6/10/2014 3:20:37 PM,KerbalAlarmClock,Adding DrawGUI to PostRender Queue
[LOG 15:20:37.006] 6/10/2014 3:20:37 PM,KerbalAlarmClock,Starting Version Check-No current web version stored
[LOG 15:20:37.007] 6/10/2014 3:20:37 PM,KerbalAlarmClock,Reading version from Web
[ERR 15:20:48.086] You are trying to load data from a www stream which had the following error when downloading.
couldn't connect to host
[ERR 15:20:48.086] You are trying to load data from a www stream which had the following error when downloading.
couldn't connect to host
[LOG 15:20:48.086] 6/10/2014 3:20:48 PM,KerbalAlarmClock,Response Length:0
[LOG 15:20:48.087] 6/10/2014 3:20:48 PM,KerbalAlarmClock,Got Version ''
[LOG 15:20:48.087] 6/10/2014 3:20:48 PM,KerbalAlarmClock,Version Check result:Unable to parse web service
[LOG 15:20:48.088] 6/10/2014 3:20:48 PM,KerbalAlarmClock,Saving Config

Kerbal Engineer had this same issue as well. In that case, the fix was to change from this:


private string GetRemoteVersion()
{
try
{
WWW www = new WWW("http://www.cybutek.net/ksp/getversion.php?name=" + PRODUCT_NAME);
while (!www.isDone) { }
return www.text;
}
catch { }
return "";
}

To this:


private string GetRemoteVersion()
{
try
{
if(updateRequest == null)
updateRequest = new WWW("http://www.cybutek.net/ksp/getversion.php?name=" + PRODUCT_NAME);
return updateRequest.isDone ? updateRequest.text : string.Empty;
}
catch {}
return string.Empty;
}

I haven't looked at the code for Alarm Clock but the fix might be something similar.

Link to comment
Share on other sites

I was wondering if it were possible to have the "Alarms-savegamename (career/sandbox).txt" that contains the actual alarms to be located in the specific save game folder rather than in the GameData subfolders. As I backup my saves, I often lose my alarms (forgetting to also move this txt file into my zip).

I'm currently working on two streams of KAC v2 and v3 - the code is done for this in v3 where the alarms are saved in the savefile, but need to get some other stuff done before its releasable

Link to comment
Share on other sites

Well, you aren't in Russia and aren't on my ISP, so the circumstances where the problem manifests may be tough to replicate and might not even be your fault. However, it remains that turning version checking off fixes the problem.

Actually, upon reflection, here it is...

I have this exact same problem when I play KSP when I don't have an internet connection. From my KSP.log:

....

Thanks for the info guys, from my checking of the logic, even if it fails to get a version number it "should" still set the date flag so it doesn't recheck again that day - that was the plan to handle all errors on the version check, but I must be reading it wrong.

So what I'll do is this:

  • Recheck that code so it does only check once a day - I must be getting something wrong in my logic there
  • Look at Telanor's code to see if that will get it to work Async - otherwise look at that too
  • Look for why you would get an SSL error against a Google Site

Mihara, can you see if you can browse to the version check URL directly - https://sites.google.com/site/kerbalalarmclock/latestversion

Link to comment
Share on other sites

Mihara, can you see if you can browse to the version check URL directly - https://sites.google.com/site/kerbalalarmclock/latestversion

Yes, it seems to work normally from a browser. I'm pretty sure it's IPv6 enabled though, (what I'm connecting to is actually 2a00:1450:4010:c02::64) so it might be a Unity problem related to IPv6...

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