Jump to content

Kerbal Construction Time/StageRecovery Dev Thread


magico13

Recommended Posts

Hmm. I may look into that but it'd be an after-release kind of thing. A lot of work for a "nice to have" rather than a "need to have" when the current system is plenty functional, just not as cool. It's something that someone else could try to add in as well post-release.

 

Edit: The build server is back up and running (mostly)! It's only got MagiCore fully working and the Modlets half-working (their GameData folders aren't in source control yet, so I can't autogenerate .zips yet). Adding in StageRecovery, KCT, and anything else will be trivial now since I can just copy an existing project. The hard part was getting the first builds running (building .NET projects on Linux is always an adventure).

 

What this means is that any time I push code to GitHub, it'll automatically get built into a .dll that can be downloaded and installed. For full releases I typically have it be automatically packaged in a .zip file with a full GameData structure, but for small dev builds it's usually just the .dll (I may change that this time around). Not every build is really useable since I may make breaking changes between builds, but I will frequently tell testers to grab a specific build and it makes full releases much simpler and safer (multiple times I've released an update with the wrong versions of the .dlls in it...)

 

Not having the build server has kinda sucked, so I'm really happy to have it running again. It'll make dev builds much, much easier to manage and I won't have to manually copy them over to dropbox and rename them so they have unique names.

Edited by magico13
Link to comment
Share on other sites

I broke it again...

do I have to delete the KCT settings in my savefiles?

does anyone have step by step instructions for installation?

is  reason it broke above?

NEVERMIND

I just had to delete my settings from my savefile

Edited by StupidAndy
Link to comment
Share on other sites

Okay, I finally got around to testing a little. And yes, just as expected: KCT and CustomBarnKit really don't get along. :( This is a major bummer, since I definitely do want both of them. They were supposed to be among the core of mods for my next install.

@magico13 - Is there any chance that you might be able to look at this? I mean, I'll understand if you're short on time and this is just too specific and obscure of an interaction to deal with... but well, I can at least ask, right? :)

Here's a summary of things I noticed breaking in my tests:

Spoiler

Tested on KSP 1.2.2

Mods present:
- Module Manager 2.7.5
- CustomBarnKit 1.1.10
- KerbalConstructionTime Prerelease 1.2_3

When CustomBarnKit is present alone, a custom config with four building upgrade tiers works as intended.
When KCT is present alone, stock building upgrades (both instant and timed building upgrades) work as intended.

With both mods present, a 4-tier building config loaded, and timed building upgrades active, things break hard at the completion of any building upgrade. The process gets stuck at 100% in the building list, impossible to remove; framerate drops as CPU load shoots up; a message is displayed that "this building upgrade is already requested" (paraphrased); and funds first gets reset to zero, but then starts rapidly ticking upwards, never stopping.

Solution: disable timed building upgrades. That way, upgrades no longer completely bug out. However, there are other problems. Since there are only three building tier assets available, you can tell CustomBarnKit that the middle visual building tier should be used for buildings levels 2 and 3, and the third and final one would only get used for level 4. But! If KCT is present and the order of of visual building tiers is configured to be anything other than 1,2,3 for the first three stages, the visual building tiers go haywire.

For example, if a level 1 building is directed to have anything other than tier 1 graphics, then upon starting a new save, the building is assigned a random graphics tier. Sometimes it looks like first-tier, sometimes like second-tier, sometimes like third tier. Also, the first upgrade conducted always switches a building to tier 2 graphics; and if the order is changed in any way from stock, you never get to see the third tier at all (unless it randomly gets selected for something at save start).

Solution: stick with stock tier progression, and the fourth upgrade tier will just have to be the one that's visually indistinguishable from the tier before it. This prevents bugs with the visual building tiers. But unfortunately it breaks something else:

if a building has the tier 3 graphics active, then doing anything that reloads the space center screen will magically set that building to its maximum level. In essence, KCT seems to look at the building and go "Hey, this building has maximum tier graphics. Clearly it must be maximum level. What is the maximum level, 4? Okay, I don't care what level this building was before, it is now level 4." So the player gets all their level 4 upgrades instantly and free of charge right after they can afford the level 3 upgrades.

Solution: I have not found any.

But wait, there's more!(tm) Apparently KCT scales the time it takes to roll out a vessel to the pad by the level of the pad. (Is this even intended? It doesn't make much sense to me to have that in the first place.) And if you have a launchpad of a level that is not 1 or 2 or 3, then the result of the vessel rollout time calculation is "Infinity, NaN:NaN:NaN". And the rollout literally never finishes.

Solution: I have not found any.

 

Link to comment
Share on other sites

18 hours ago, Streetwind said:

But wait, there's more!(tm) Apparently KCT scales the time it takes to roll out a vessel to the pad by the level of the pad. (Is this even intended? It doesn't make much sense to me to have that in the first place.)

It is intended. The rollout and reconditioning are both linked (they're internally the same thing) and reconditioning of the pad takes less time for the more basic launch pads. It's reasonable that the facilities to put a rocket vertical are simpler at a more basic pad and require less time. If you want to disable that, just remove the "/ (3-[L])" from the reconditioning formula. In fact, that's probably why the rollout goes to infinity, since a 4th level launchpad will have [L] = 3 and you're dividing by zero.

But it sounds like Custom Barnkit is completely incompatible with KCT right now. I'll try to look into it, but it'll be a while from now.

Link to comment
Share on other sites

Ah, so if that part of the formula was "/ (4-[L])" it would no longer divide by zero? Good to know. That means the only thing that's really a dealbreaker is the unintentional auto-upgrading to max level of anything that has tier 3 graphics.

And yes, I understand. I am in no hurry myself; I am doing so much customizing work that I probably won't start this playthrough until 1.3 and its associated mod updates. I'll check back come 1.3 to see if you were able to wrap up a release for it, and then I'll test again.

Link to comment
Share on other sites

4 hours ago, Streetwind said:

Ah, so if that part of the formula was "/ (4-[L])" it would no longer divide by zero? Good to know. That means the only thing that's really a dealbreaker is the unintentional auto-upgrading to max level of anything that has tier 3 graphics.

And yes, I understand. I am in no hurry myself; I am doing so much customizing work that I probably won't start this playthrough until 1.3 and its associated mod updates. I'll check back come 1.3 to see if you were able to wrap up a release for it, and then I'll test again.

That might have been why it was infinite. Except that based on what you're reporting I'm not sure it would work correctly anyway.

Link to comment
Share on other sites

Anyone feeling particularly bored and want to test a few things for StageRecovery? Two main areas need to be tested: Integration with FMRS and kerbal recovery (both through pre-recovery and old-style post-recovery). It's also a test to make sure the build server is producing functional builds, since for a while it was making builds that wouldn't actually load despite compiling,

Get build #14 (or later) from the build server (just download the StageRecovery.zip file under "Last Successful Artifacts").

As always, I'll need logs. If you don't know what logs, check this post. The wrong logs probably don't help and snippets pulled out of logs really don't help either.

FMRS testing:
If FMRS isn't installed, SR should work as normal.
If FMRS is installed but not armed, SR should work as normal.
If FMRS is armed, handling parachutes, and hasn't deferred to SR, then SR shouldn't do anything at all.
If FMRS is armed, handling chutes, but has deferred to SR, then SR will handle chute only stages and FMRS will handle kerbal/probes.
FMRS armed, not handling chutes (deferred doesn't matter), then SR handles chutes and FMRS gets kerbals/probes.
Outside of flight scene, SR should handle everything.

Kerbal recovery testing:
Both pre-recovery (where the kerbals are recovered before the stage is destroyed, by SR guessing that the stage will be deleted) and normal SR styled recovery (where the kerbals are recovered after the OnVesselDestroyed event is fired, when everything else is handled). Whether Pre-recovery is enabled is now a setting you can change in-game.

Ensure that any kerbals recovered by SR appear in the Astronaut Complex as available and have the flight added to their flight log (they get XP as expected).
I'm curious if contracts will still fail (like tourist ones). Probably, but if someone tests it then let me know the results (ideally with and without pre-recovery active).

 

Some notes about pre-recovery. Below 25km altitude it's basically the same as regular recovery. It's still worth testing there but it isn't as big of a deal. The best point to test it with is dropping something suborbital from 30+km altitude while still continuing on so the stage unloads above 25km. That will cause it to get added to the watch list, then SR will wait for it to just about be destroyed and pull out the kerbals, then when destroyed it associates the kerbals and either recovers them or lets them die. Contracts might not fail here, since the kerbals never actually die. With post-recovery the kerbals are killed and then resurrected when the stage is processed, which will fail contracts but has the kerbals available at least.

Btw, pre-recovery has been active for a while now. The option to turn it off is new though. It sometimes has issues with firing at the wrong time and just randomly stealing kerbals out of ships and killing them. Naughty kraken.

Link to comment
Share on other sites

StageRecovery has been officially updated and the links on the OP have been changed to point back to the build server instead of dropbox links. As a result, you don't have to grab the old release and pop the new .dll in, instead you can just grab that and it will have the latest MagiCore and all the required files. I merged in the PR from a while back that removes a bunch of simulation related code, but haven't made any changes myself yet. I'm going to look at Custom Barn Kit tonight.

Edit:

@Streetwind, @thunder175 Would either of you be willing to test out the latest build (#5 or later, from here) with Custom Barnkit? From my testing it doesn't appear to break everything horribly anymore, but I think the last tier isn't getting the right model for some reason, but it could just be that my CB config isn't correct since I've not used it before. Preferably test with and without having KSC build times active and in a save you don't care about (a new one or a copy)

Edited by magico13
Link to comment
Share on other sites

You are a steely-eyed modding man, @magico13! :)

I've tested the new version, and indeed the only thing that still doesn't work is switching the building tier graphics if level 3 is defined with second-tier and level 4 is defined with third-tier graphics. But if I use 1, 2, 3, 3 for building tier graphics progression instead of 1, 2, 2, 3, then everything works as intended. No more spontaneous self-destruct of the savegame when using KSC build times, no more accidental auto-upgrades of buildings, no more random building tier graphics on savegame start if level 1 is defined with anything other than first-tier.

I still got an infinite/NaN rollout time on the level 4 launchpad. I then went into the settings and changed the formula to be (4-[L]) instead of (3-[L]), as discussed further up. That fixed the problem, and the level 4 launchpad works perfectly now.

 

Note: i have not toyed with multiple launchpads yet. I don't know how those work even without CBK present. :wink:

EDIT: Oh, and it seems like the auto-upgrading buildings bug may have been a CBK issue all along. I just got it again, but amusingly enough while testing something without KCT installed. I've submitted a bug report to sarbian, let's see what he says. I'm telling you this just in case somebody tries to bug report this to you at a later date.

 

Edited by Streetwind
Link to comment
Share on other sites

@magico13 I reverted back to my changes in CustomBarnKit that were causing the issues, and after installing the new version of KCT with my current (backed up) save all seems to be working fine. The only significant changes to my custombarnkit config were adding levels to the astronaut complex and mission control. So I can't comment on @Streetwind issue with the launchpad. 

Link to comment
Share on other sites

From a purely hypothetical perspective at this point, how do you all feel about Patreon? I know other modders have had some success with it (linuxgurugamer and RoverDude to name some that I know of). It's never enough to actually cover bills, but it's a solid commitment tying me to supporting and improving my mods (other than "because I want to play with them") and would help justify spending entire evenings and weekends on modding. I'd want to do something fun with it too, like have a stretch goal of having monthly live streams or something like that. Or like with CKAN where different levels get you different things, like access to the lolcommits. I have no idea what I'd actually do for those though, so if you have ideas let me know.

At this point I'm just gauging opinions by you all. There's certainly less of an audience here than the other threads, but anyone reading this is also likely more involved with mods than in a release thread.

Link to comment
Share on other sites

Since KCT is such an integral part of my kerbal experience I would definitely contribute.  I really think the Paetron model is the way to go anyhow, instead of paid mods in general as Steam seems heart set on implementing at some point.  

Link to comment
Share on other sites

Well, I've made a Patreon now. If you have ideas for rewards or goals then let me know. The current ones are subject to change. For anyone who does contribute, thank you in advance!

http://www.patreon.com/magico13

 

 

Day later edit but I don't want to double post: I just made a build because of a WIP update to MagiCore that I'd be wary of using with any other mods that reference MagiCore (of released things that's currently just Sensible Screenshot and Dated QuickSaves I think). They shouldn't have been affected since the methods they use weren't modified, but it's something to be aware of.

The reason for this change is that if you've got a mod and you want to add your own variables to any formulas, there's now an event called onMCVariableReplacing that sends an identifier for the formula (like "KCT_BUILD_RATE") and a dictionary that you can add your variables and their values to. Then after the event has finished the replacement occurs, so another mod could easily add new variables or change existing ones if they wanted, without referencing KCT's assemblies at all. Combine that with a Preset and another mod could conceivably completely override KCT's own processing of pretty much everything without ever referencing KCT in code. Which is pretty awesome.

Edited by magico13
Link to comment
Share on other sites

33 minutes ago, StupidAndy said:

is there a way to get more then 45 build points in sandbox? do I have to transmit science back to Kerbin to get more like in career? does it do that in career?

You can just increase the number in the settings. It's the third number in a field that should say "15,15,45". In career it's based on how many tech nodes you've unlocked.

Link to comment
Share on other sites

@magico13 I've noticed something over the past couple days that I want to report. I have three launch pads. The first (default) is still Level 2. My other two pads are Level 3. I like keeping one pad level 2 for lighter launchers. Usually on initial load, the VAB timers are only rolling for the first two entries in the construction queue, everything else is awaiting construction. When I change pads using the buttons, the other queue'd items begins constructions again (up to 4) and all is well. I haven't tried or verified this behavior in a fresh save. When I downloaded your latest dev build you recommended a few posts up, I started noticing this behavior. I'll see if I can get some screenshots next time it happens. 

Link to comment
Share on other sites

6 hours ago, thunder175 said:

@magico13 I've noticed something over the past couple days that I want to report. I have three launch pads. The first (default) is still Level 2. My other two pads are Level 3. I like keeping one pad level 2 for lighter launchers. Usually on initial load, the VAB timers are only rolling for the first two entries in the construction queue, everything else is awaiting construction. When I change pads using the buttons, the other queue'd items begins constructions again (up to 4) and all is well. I haven't tried or verified this behavior in a fresh save. When I downloaded your latest dev build you recommended a few posts up, I started noticing this behavior. I'll see if I can get some screenshots next time it happens. 

Easily reproduced with just KCT. Probably related to issue #119. I'm guessing the rates just aren't being recalculated at scene start, even though they should be. Hopefully an easy fix.

Actually, it's probably related to the change to support CustomBarnKit, since the facility levels aren't fully up to date right at scene change. They'll report 0 for max levels for a little while until it actually loads, and then they'll say the right amount later. It's probably caching the 0 value, since a level 0 VAB only allows two rates.

 

@thunder175 it should be fixed in build #8 from the build server.

Edited by magico13
Link to comment
Share on other sites

I skimmed through the last pages back to november, but I could not see any reports of airplanes being placed vertically on the runway. To avoid this I have to edit my stored plane before every launch so it faces horizontally. But as soon as I recover it back to SPH, it reverts back to vertical.

Running latest dev build (I think.. downloaded it 4 or 5 days ago).

Edited by SkyKaptn
Link to comment
Share on other sites

7 minutes ago, SkyKaptn said:

I skimmed through the last pages back to november, but I could not see any reports of airplanes being placed vertically on the runway. To avoid this I have to edit my stored plane before every launch so it faces horizontally. But as soon as I recover it back to SPH, it reverts back to vertical.

Running latest dev build (I think.. downloaded it 4 or 5 days ago).

Known issue for a long time. It's been there since the beginning. I have an idea of where to fix it, but need to figure out how to use quaternions. 

Link to comment
Share on other sites

7 hours ago, magico13 said:

Known issue for a long time. It's been there since the beginning. I have an idea of where to fix it, but need to figure out how to use quaternions.

I think you can use Transform.Rotate in Unity with just a three dimensional parameter, if you don't want to study quaternions.

Link to comment
Share on other sites

Hi there @magico13! I've been using KCT for a while, and have now updated to the latest KSP. I wonder whether this release is compatible, and if so, would you be happy with me joining the testing? Also, I notice you've been asking about FMRS - I can't find a version of that for 1.2, any idea where there is one? 

Thanks! 

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