taniwha

[1.4-1.7] Early Bird 0.1.7

Recommended Posts

Early Bird is a mod for better warp-to-morning functionality. Currently, it modifies the warp-to-morning feature such that warp ends five minutes before sunrise, taking the space center latitude into account (not relevant for stock Kerbin, but relevant for any planet mod that fakes axial tilt (eg, RSS)).

As Early Bird takes over the warp-to-morning button, using it is exactly the same as the stock feature.

Note that for certain latitudes at certain times of the year on bodies with tilt relative to the sun, there is no dawn (due to either midnight sun or midday dark). At such locations, local "midnight" is used in midnight sun conditions, and local "noon" is used for midday dark conditions. Also, time of day is undefined at the exact poles, so you may suffer rhino-daemons if the space center is exactly on a pole.

planned features

  • adjustable time offset for warp-to-morning
  • flight mode warp-to-morning: warp to morning for the current landed location, anywhere on any planet
  • warp to arbitrary time of day
  • warp to arbitrary planet on horizon (or any other "hour")
  • KAC integration
  • orbital warp-to-"morning"

Download: Early Bird 0.1.7. Built against KSP 1.5.1 but should work for pretty much any version of KSP after 1.2.

Source code (GPL): github.

 

Edited by taniwha

Share this post


Link to post
Share on other sites

Thanks. I got tired of warp-to-morning wasting a significant part of the day.

Share this post


Link to post
Share on other sites

I've released version 0.1.1 of Early Bird.

Changes from 0.1.0:

  • Add an app button (currently only stock) to the space center, tracking station and flight scenes. Used to set the offset from sunrise (in minutes).
  • Avoid an NRE when looking for the WarpToMorning button (for KSP 1.2.2?)
  • Fix the warp target time calculation such that hitting the button again shortly after warp ends warps to the next day rather than not at all.
  • Fix a math error resulting in bogus day lengths when at higher latitudes on titled planets (forgot to convert latitude to radians). Many thanks to NathanKell, Theyson and Bornholio for testing in RO and Bornholio for his logs that helped me find my error.
  • Implement flight-mode warp-to-morning. Available via the flight scene app button. Works only when landed or splashed (or prelaunch, which is landed (usually)).
  • Save/load the warp target offsets to/from persistent.sfs.

Known issue: when used with KSCSwitcher, the dawn times are often bogus. This is due to a minor (because it's only just now been discovered) problem in KSCSwitcher which is being investigated.

Edited by taniwha

Share this post


Link to post
Share on other sites

There is one single exception thrown, not sure if this is really a problem:

NullReferenceException: Object reference not set to an instance of an object
  at EarlyBird.EarlyBird+<HijackWarpToMorning>c__Iterator0.MoveNext () [0x00000] in <filename unknown>:0 
  at UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) [0x00000] in <filename unknown>:0 
 
(Filename:  Line: -1)

Log:
https://www.dropbox.com/s/tz11brgezp2zz3f/2017-07-04-1 KSP.log.zip?dl=1

Share this post


Link to post
Share on other sites

Nice.  I might actually start using the warp-to-morning button again.

Share this post


Link to post
Share on other sites

btw on planet packs or let's say in RSS at a different KSC location the time zone is different.

It would be great if this mod could take this into account.
"The morning where the active KSC is located at."

Share this post


Link to post
Share on other sites
1 minute ago, Gordon Dry said:

btw on planet packs or let's say in RSS at a different KSC location the time zone is different.

It would be great if this mod could take this into account.
"The morning where the active KSC is located at."

Is it not?  I assumed based on the second sentence in the first post it did.

Share this post


Link to post
Share on other sites

Well, hmm, I used it for 3 weeks while fiddling with RSS and only the "normal" KSC (Kennedy Space Center) had the "real" morning...

Share this post


Link to post
Share on other sites
1 hour ago, Gordon Dry said:

Well, hmm, I used it for 3 weeks while fiddling with RSS and only the "normal" KSC (Kennedy Space Center) had the "real" morning...

 

On 26/06/2017 at 3:59 PM, taniwha said:

Known issue: when used with KSCSwitcher, the dawn times are often bogus. This is due to a minor (because it's only just now been discovered) problem in KSCSwitcher which is being investigated.

 

Share this post


Link to post
Share on other sites

So well, actually I don't use KSCSwitcher, because I play with

and got the issue there as well.

It's just one KSC and warping to morning is nearly at sunset ...

Share this post


Link to post
Share on other sites

@Gordon Dry: you would be well served by reading the release notes of updated versions. Certainly the NRE and very likely the incorrect dawn time were fixed in 0.1.1.

[edit]I must thank you for your logs, though: they showed me right away that you were using 0.1.0.

Edited by taniwha

Share this post


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

that you were using 0.1.0

Then I'm sorry.

I guess it happened because I'm used to download from Spacedock or GitHub, because I also get notifications when something is changed there.

Because you use a special link I just didn't know ...

Share this post


Link to post
Share on other sites

So now I really got an issue with the 0.1.1:

I realized it after I asked myself
"Where is the UI of the KSP Alternate Resource Panel gone?"

Then I found this:

lass EB_FlightWindow:System.NullReferenceException: 
  at (wrapper managed-to-native) UnityEngine.Behaviour:set_enabled (bool)
  at EarlyBird.EB_FlightWindow.UpdateGUIState () [0x00000] in <filename unknown>:0 
  at EarlyBird.EB_FlightWindow.onShowUI () [0x00000] in <filename unknown>:0 
  at EventVoid.Fire () [0x00000] in <filename unknown>:0 
 
(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 42)

NullReferenceException
  at (wrapper managed-to-native) UnityEngine.Behaviour:set_enabled (bool)
  at EarlyBird.EB_FlightWindow.UpdateGUIState () [0x00000] in <filename unknown>:0 
  at EarlyBird.EB_FlightWindow.onShowUI () [0x00000] in <filename unknown>:0 
  at EventVoid.Fire () [0x00000] in <filename unknown>:0 
UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
UnityEngine.Logger:LogException(Exception, Object)
UnityEngine.Debug:LogException(Exception)
EventVoid:Fire()
FlightDriver:SetPause(Boolean, Boolean)
KSP.UI.Screens.UISpaceCenter:Pause()
KSP.UI.Screens.UISpaceCenter:OnFacilitySpawn_MC()
EventVoid:Fire()
MissionControlBuilding:OnClicked()
SpaceCenterBuilding:EnterBuilding()
SpaceCenterBuilding:OnLeftClick()
<OnMouseTap>c__IteratorBC:MoveNext()
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
 
(Filename:  Line: -1)

a lot of it in different variants

Log:
https://www.dropbox.com/s/xcudgdcxlk6b6au/2017-07-05-5 KSP.log.zip?dl=1

And I know there are also other issues with ContractConfigurator, I will remove several contract packs ...

Spoiler

This is the moment where I start to boil - pfffff - for heavens sake.
Yesterday was a neat "high fps"™ 100% physics time ratio day - after a long time - and today it's borked again - I really don't get it. ;.;

 

Share this post


Link to post
Share on other sites

I've released version 0.1.2 of Early Bird.

Changes from 0.1.1:

  • Clean up after scene destruction.

@Gordon Dry: this should fix your NREs.

Edited by taniwha
wrong version :P

Share this post


Link to post
Share on other sites

I've released version 0.1.3 of Early Bird.

Changes from 0.1.2:

  • Correct handling of flight window state.
  • Rebuild for KSP 1.4.1

Not a lot, really.

Share this post


Link to post
Share on other sites

"Rhino-daemons"? That's super funny, imagining big nosed daemons, but I still don't get it...

On a pole, the sun goes around never setting, but nose-daemons?

Share this post


Link to post
Share on other sites

rhino = nose. ceros = horn. rhinoceros = nose-horn :)

However, rhino-daemons are daemons that come out of your nose. This is a joke about undefined behavior such as when programming language specifications are violated (i.e., when the programmer does something that the spec says is undefined behavior, it is legitimate for the compiler to cause daemons to come out of the programmers nose).

Share this post


Link to post
Share on other sites

This is another one of those "I didn't know I needed it until I could get it" mods!

Is CKAN possible/planned for Early Bird?

Share this post


Link to post
Share on other sites

I don't do CKAN myself. It will take someone who does do CKAN to step up and do the magic.

Share this post


Link to post
Share on other sites
On 3/14/2018 at 8:12 PM, taniwha said:

I don't do CKAN myself. It will take someone who does do CKAN to step up and do the magic.

Would you like me to put this into CKAN for you?

Share this post


Link to post
Share on other sites
35 minutes ago, linuxgurugamer said:

Would you like me to put this into CKAN for you?

Yes, please. I've just updated my build system to create and upload an appropriate .version file. In the process creating version 0.1.4. I expect that while ti's built against KSP 1.4.5, it should work with pretty much any other version of KSP.

Share this post


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