Jump to content

Kerbal Construction Time/StageRecovery Dev Thread


magico13

Recommended Posts

Hey. c@magico13

Could I ask you for a small favour?

When kct checks for crew when you launch a vessel, could I ask that it checks the Protocrewmember.inactive flag and not put that kerbal in the roster if it's true?

It's for a mod I'm working on, at the moment it doesn't work properly with kct as inactive crew members still get pulled through.

I would send you a PR but not sure how up to date the github code is

Link to comment
Share on other sites

19 hours ago, severedsolo said:

When kct checks for crew when you launch a vessel, could I ask that it checks the Protocrewmember.inactive flag and not put that kerbal in the roster if it's true?

I would send you a PR but not sure how up to date the github code is

Is that a standard flag? I should be able to do that pretty easily tonight but if you'd rather do it yourself and submit a PR, it'd be here in the GetAvailableCrew method. The development branch is the one that's most up to date. I'm really considering getting rid of that branch after the next release and just doing everything in Master now that I actually use source control correctly, especially with the build server up and running again :P

Edit: Updated to not grab kerbals who are inactive. Also MagiCore updated to not hard code lengths of time for days/years

Edited by magico13
Link to comment
Share on other sites

On 4/25/2017 at 3:55 PM, magico13 said:

In general I'm seeing some unexpected things regarding half of the max building upgrades being set to -1 and half set to 2 (Personally I was seeing them all set to -1 in the editor and 2 in the space center) which I'll have to add in some code to work around, but I didn't see anything crazy going on around decoupling. I did realize I need to put some logging around the vessel tracker, so there's a bit more in the latest build. Nothing (other than the building upgrades) obviously screwy in general though.

Found the issue with, strangely, EngineLight. They stuck in a decoupler cfg and pulling that out the stage lag on decoupleing is gone. :)
Separately, lastest try KRASH simulations wouldn't load. Selecting it stayed in the VAB but gave the "simulation active" notice. Not sure if it's related to present KCT build in some way. With the system you're working on though it may not make much of a different depending on how that goes :)

https://www.dropbox.com/s/83oon7o7jj2cylr/output_log.txt?dl=0

Posting really messed up! edited best I could to clean it up :P

On 4/25/2017 at 3:55 PM, magico13 said:

 

On 4/25/2017 at 3:55 PM, magico13 said:

 

Edited by JeffreyCor
Link to comment
Share on other sites

6 hours ago, JeffreyCor said:

Separately, lastest try KRASH simulations wouldn't load. Selecting it stayed in the VAB but gave the "simulation active" notice. Not sure if it's related to present KCT build in some way.

Hmm, looks like it is actually something failing when trying to save the KCT data to the persistence file but I'm not sure why. That only happened the first time you were in the editor in that log, the second time it was fine.

Link to comment
Share on other sites

1 hour ago, JeffreyCor said:

Only tried the KRASH simulation once. Second time was trying to reset the "simulation active" notice that was looping in every screen. And it didn't work. :P

Let me know if you see it again. I haven't seen that exact problem before but it might have to do with the rate caching I was doing. Not sure :/

Link to comment
Share on other sites

I've discovered a bug, after scrapping a craft it appears to add an infinite amount of components to inventory.

Reproduction is easy, start a fresh career game, build a mk 1 pod, then scrap it from the build list. Returning to the VAB you see the old build rate, after clicking the apply inventory button build rate drops as expected. However, after building another pod the rate stays low.

It should go back to the high rate again as there should only be one pod in inventory. It works as intended if you launch the craft and recover. One recovery gives one pod at the reduced production rate.

I've also noticed some of the config settings breaking production,[ScL] and [TScL] broke science point production when used in a formula, while [ScK] and [TScK] worked fine.

Edited by MarcAFK
Link to comment
Share on other sites

32 minutes ago, MarcAFK said:

I've discovered a bug, after scrapping a craft it appears to add an infinite amount of components to inventory.

Reproduction is easy, start a fresh career game, build a mk 1 pod, then scrap it from the build list. Returning to the VAB you see the old build rate, after clicking the apply inventory button build rate drops as expected. However, after building another pod the rate stays low.

It should go back to the high rate again as there should only be one pod in inventory. It works as intended if you launch the craft and recover. One recovery gives one pod at the reduced production rate.

I've also noticed some of the config settings breaking production,[ScL] and [TScL] broke science point production when used in a formula, while [ScK] and [TScK] worked fine.

Did you check the actual build time of the second vessel? The UI isn't currently updating but upon build everything will recalculate. See my rather long update on last week's progress (quoted below). Also, a small thing, rates != build times. Rates are how fast builds progress and are very different internally from build times, which are the BP value of the vessel divided by the rate. It's a nitpick, but it could be confusing to say one but mean the other since I could end up looking for bugs in a totally different set of code.

There's also an issue where when you build a vessel in KCT the parts in the editor will still appear as if they're pulled from the inventory, but those parts are already removed from the inventory from the previous build (it makes sense when you see it, basically it's "cache invalidation"). I've got a solution in my head for that, basically to just replace them all with fresh parts whenever the parts are removed.

 

As for Kerbal levels not working correctly in formulas, I'll look into that. Most likely a simple fix.

Link to comment
Share on other sites

It is the actual build time not just displayed build time.

I also seem to be getting the same results another way.

If I start a new game and build then recover a single pod I can apply inventory to produce one faster pod, then the build rate jumps back up. But if I build then recover 2 pods the build rate will stay low, each time I go to the Vab and click "apply inventory" the rate goes down and stays down untill I clear the craft, but goes back if I use apply inventory again. I can build as many pods at that rate as I want.

Edited by MarcAFK
Link to comment
Share on other sites

@MarcAFK should be corrected in the latest build now. Whenever a part gets removed from the inventory it will also be removed from the currently active editor vessel.
 

 

Unrelated but avoiding a double post, May's Patreon poll is now open until the 5th of May: https://www.patreon.com/posts/9607929

Edited by magico13
Link to comment
Share on other sites

@magico13

tested latest build to check the new time/clock changes discussed in the release thread.

However after install KCT seams to be misbehaving.

KSP version: 1.2.2 (heavily modded)

KCT version: 1.3.9.0

MagiCore version: 1.2.1.0

 

Old KCT folder deleted, no MagiCore folder was installed (IDK how KCT would have been working unless a way older build didn't need it, last time I updated was before you got the new build server)

Installed from Build #23

Any save loaded whether it's an old one from before the update or a new one made after the update says that there is an error loading KCT data and that KCT is broken. Starting a new save the settings dialog seams to work fine, but selecting spend upgrades fails to open the upgrade window, instead you just get a small bar about the width of the upgrade window normally, same thing happens when clicking on the VAB button in the main UI, all the other buttons work as normal.

Link to logs: https://www.dropbox.com/sh/1af69yylgxfkrhi/AAAAAEttukbQVzvSPGQvH6k7a?dl=0

Spoiler

screens

 

Let me know if you need anything else or want me to try anything else, I'll try on a fresh install in a few hours.

 

Link to comment
Share on other sites

13 minutes ago, Akira_R said:

However after install KCT seams to be misbehaving.

KCT isn't executing the MagiCore methods correctly according to the log. Not sure why. I'm gonna look into it and will get back to you.

Nevermind, figured it out. You've got two MagiCores installed. The way it gets installed changed from going straight to GameData (ie GameData/MagiCore.dll) to going into a subdirectory (GameData/MagiCore/MagiCore.dll). Remove the one that's in GameData and make sure the other one is the up to date one.

Link to comment
Share on other sites

1 hour ago, magico13 said:

KCT isn't executing the MagiCore methods correctly according to the log. Not sure why. I'm gonna look into it and will get back to you.

Nevermind, figured it out. You've got two MagiCores installed. The way it gets installed changed from going straight to GameData (ie GameData/MagiCore.dll) to going into a subdirectory (GameData/MagiCore/MagiCore.dll). Remove the one that's in GameData and make sure the other one is the up to date one.

Derp i should have thought of that when I saw I didn't have a MagiCore folder. Deleted and it's working fine.

However KCT is still counting down by 6 hour days, I tried both an existing save and a new game and in both cases KCT was still counting by 6 hour days, would you like logs and screens?

Link to comment
Share on other sites

50 minutes ago, Akira_R said:

However KCT is still counting down by 6 hour days, I tried both an existing save and a new game and in both cases KCT was still counting by 6 hour days, would you like logs and screens?

I'm guessing they're not changing the dateFormatProvider then. I'll need to look at their source and either provide a configuration option or try to come up with something that works automatically. Could you please link me to the appropriate thread?

Link to comment
Share on other sites

1 hour ago, magico13 said:

I'm guessing they're not changing the dateFormatProvider then. I'll need to look at their source and either provide a configuration option or try to come up with something that works automatically. Could you please link me to the appropriate thread?

Here is the Kopernicus forum thread

 

And GitHub https://github.com/Kopernicus/Kopernicus

And Sigma Dimensions (the mod to apply the scaling change) forum thread

And GitHub https://github.com/Kopernicus/Kopernicus

Link to comment
Share on other sites

Ah, right thread! :) 

So, I wandered in here mostly seeking the dev version that's s'posed to mesh a little better with the odd day lengths in upscaled Galileo's planets. Installed 1.3.4.1, and at first glance, my build times seem to have gone nuts. They're way too long. Now I'm probably missing something here, I looked thru the KCT & MagiCore folders for a relevant config, but couldn't find anything obvious. I'm guessing the build times are just displaying the wrong day length because of an untweaked value somewhere.

 

Also, and completely unrelated (as I was getting it with the older release version of KCT as well), any time I'm in the VAB I'm getting this spammed to the log:

[EXC 21:43:21.369] NullReferenceException: Object reference not set to an instance of an object
	KerbalConstructionTime.KCT_Utilities.ProgressBuildTime ()
	KerbalConstructionTime.KerbalConstructionTime.FixedUpdate ()
	UnityEngine.Debug:LogException(Exception)
	KerbalConstructionTime.KerbalConstructionTime:FixedUpdate()

Doesn't seem to be actually harming anything. I will get a full log once I reload the game so it's not 36 freaking megabytes. :confused:

Link to comment
Share on other sites

I'm not having trouble with unusual build times with earth time turned on, and kerbin system resized by 8.8 and day lengths rescaled by an extra 4.0095 using sigma dimensions to get exactly 24 hour days and 365 day years.

How long are your build times? I'm getting 5 and  half days to make a mk 1 pod with 0.1 points  on the default config.

Link to comment
Share on other sites

8 hours ago, CatastrophicFailure said:

Also, and completely unrelated (as I was getting it with the older release version of KCT as well), any time I'm in the VAB I'm getting this spammed to the log

Not sure on the issue with build times. It's likely just a display thing.

As for the spam of stuff in the editor, are you using Editor Time? It's probably because of that. I haven't fixed that bug yet, but KCT and Editor Time aren't working together correctly in 1.2 yet.

Link to comment
Share on other sites

2 hours ago, magico13 said:

Not sure on the issue with build times. It's likely just a display thing.

Wasn't it mentioned in the GPP thread there was the beginnings of a fix for this tho?

 

2 hours ago, magico13 said:

As for the spam of stuff in the editor, are you using Editor Time? It's probably because of that. I haven't fixed that bug yet, but KCT and Editor Time aren't working together correctly in 1.2 yet.

That would be it, then. So I will continue not worrying about it. :D

Link to comment
Share on other sites

27 minutes ago, CatastrophicFailure said:

Wasn't it mentioned in the GPP thread there was the beginnings of a fix for this tho?

Yeah, see the few posts above your previous one, they're all about that. The build times shouldn't be any more crazy than they were before. If you're seeing super weird things I'd be interested in reproducing that (so a mod list preferably), but I'm guessing it's still just using 6 hour or 24 hour days. I have to look into how they're changing times to see if I can support it automatically and/or provide a config option for it. They seemingly aren't changing it the way that I would expect, which is potentially the easiest way.

 

Edit: They are doing it the way I thought they would. But then they went and (incorrectly) hardcoded some values to Kerbin time, which happen to be the ones that I'm referencing. 

Edit 2: I submitted an issue on Kopernicus' GitHub. When they fix that, MagiCore and KCT should start working correctly. It's possible that other mods may start working automatically as well.

Edited by magico13
Link to comment
Share on other sites

Alright, I need all of your help. Per the ScrapYard Trello, ScrapYard is officially ready for Beta! :o I'm going to set that up a release thread in the next few days, but before the official Beta drops I'd like for you all to hammer it with anything you've got to uncover any bugs that are hiding under the carpet, behind the curtains, and in the cupboards. Interaction with KCT isn't as important as just ScrapYard itself, but it is important to also run tests with KCT since that will test the API as well. Basically both situations need to be tested thoroughly. What doesn't matter is the Override Funds option, since that's not an official feature yet.

What needs to be tested:

  • All parts get added to the inventory when they should (you have to watch the save file for now)
  • Builds/uses get tracked in the part tracker properly
  • Applying the inventory grabs the right things out of the inventory and applies them correctly
  • Launching a ship (or building with KCT) pulls those parts out of the inventory as expected
  • Recovering a part increases the TimesRecovered counter
  • With KCT, scrapping a not launched, but completed, vessel sets Inventoried to true but keeps TimesRecovered at 0.
  • Disabling the mod in the game settings actually disables it (no parts added/removed from inventory, no part tracker increasing, no button in the editor, and KCT doesn't reduce build times)
  • Disabling just the part inventory actually disables the use of the part inventory (adding or removing)
  • Disabling just the part tracker disables the part tracker as expected (won't increase with builds, KCT build times don't get better)
  • TweakScale parts with a default scale don't have the tweakscale module stored
  • TweakScale parts with a non-default scale DO have the tweakscale module stored
  • Procedural part modules are stored (hit me with every procedural part mod you can think of, and give me .craft files for any parts that don't save correctly)
  • With Procedural parts/tweakscale, when applying inventory only exact matches are applied (sucks right now with the UI, I promise it'll get better later)
  • Find a mod that applies upgrades to modules and verify any modules that aren't normally stored (for instance, ModuleEngines) are stored if they have upgrades applied (porkjet's engines from here maybe? http://forum.kerbalspaceprogram.com/index.php?/topic/147582-update-12-pre-release-is-here/)
  • Make sure EVAs don't get stored as parts
  • Test out creating new MODULE_TEMPLATE and FORBIDDEN_TEMPLATE templates in the PluginData/ModuleTemplates.cfg file. It's not ModuleManager-able yet, but I want to do that during the Beta. I'll explain the details of this in a separate post later, but you can use the notes in that file to figure out how to define which modules to store or forbid. Right now it's stuck using MagiCore's math parser. Any result > 0 is counted as "true" for a requirement and <= 0 is "false". That does mean it can only check equality of numbers and not strings, for now. I need to either expand the parser to support strings or create something different.
  • Probably tons more. Report anything and everything funky.

I know for a fact that KCT isn't using ScrapYard correctly in some instances (recovering directly to storage is probably incorrect, editing a vessel might mess it up too). If you want to hunt down those too I'd appreciate it. At the very least, just let me know if something seems wrong and I should be able to quickly figure out whether it's working correctly or not. That can wait for post-Beta since that's a KCT issue and not a ScrapYard one.

 

Again, thank you all for your support and help so far. It's not done yet, but it's so much closer than it was a month ago. With the Beta I want to clean it up and work on some desired but not required features. To be at a point where it actually seems to be working as I imagined it two years ago when enneract and I first discussed the design (though the name goes back to an earlier venture with SeriousSam) makes me incredibly happy. I've been wanting to break out and rewrite the part inventory for a long time, so I'm very happy that it's almost a reality :D

(I know it might seem silly to be so worked up about limited value mod for a 5 year old game, but KSP modding is what enabled me to be in the career I'm in right now, and although ScrapYard's code isn't perfect it's still miles ahead of where I was when I wrote KCT or even StageRecovery, and it's nice to make something that doesn't totally suck that I've wanted to make for a long time. If even one other mod uses it then I'll be ecstatic, and if it's just KCT that uses it then oh well, at least KCT users will have an inventory that makes sense and will [hopefully] not break with weird mods.)

Edited by magico13
Link to comment
Share on other sites

Eh, I'll look into firing up scrapyard into my current active save (after backing it up) sometime here soonish.  I just failed out of one of my physics classes via essentially a linear combination of extreme burnout (because 3 years of no breaks [ie. summer classes] is *awesome*) and test anxiety ...  so I'm not really in the right headspace to do decent QA, much less actually enjoy playing complex games at the moment.   Depression and semi-irrational irritation don't mix very well with complexity.   On the plus side, at least it was wave motion of arbitrary wave-types in arbitrary mediums (ie. physical disturbance, electrical/magnetic, heat, etc), manual Fourier analysis or arbitrary waves, and the like that beat my face in and not basic kinematics. :wink:

Edited by storm6436
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...