Jump to content

Kerbal Construction Time/StageRecovery Dev Thread


magico13

Recommended Posts

14 hours ago, magico13 said:

Shouldn't be... Hmm. I'll have to experiment. My Linux Mint install is totally goofed up right now because Cinammon is crashing for no reason (on both of my computers no less) so I can't test Linux as easily right now. But I don't see why that would be the cause of this. I definitely saw it not removing the vessel on launch and then definitely did in the code that #13 is built on. Though I didn't try the actual build from the build server. I'll let you know what I figure out.

 

Edit: what... Yeah, even the rollout issue is happening for me now. This is gonna be fun...

Edit2: I bet I know why. I started caching the KSC so it doesn't have to be searched for every time (likely a good performance hit). Ah, the 2 main problems in programming: cache invalidation (this one), naming things, and off by one errors.

Edit3: @Pand5461 try out build 14 and let me know if it's still happening. Tested both cases on my end and it looks cleared up. Based on the logs you provided that definitely was the problem (ironically because it didn't fail to remove the vessel from a build list like it normally does, which normally triggers a forced search in the current lists). Basically it was still holding a reference to the old KSC which no longer existed because of the scene change, so when KCT held onto a reference to the "old" ship it removed it from the list in the "old" KSC instead of removing the corresponding "new" ship from the "new" KSC.

In other news, I really need to just rewrite everything because maintaining this mess is way harder than it needs to be...

Thanks, @magico13! With the new build, the rollout issue is gone. Editing bug is still there.

From what I briefly tested seem to work:

  1. Crew assignment (only tested when assigned crew becomes available by the launch time)
  2. Rollout -> Launch without changing scene
  3. Rollout -> Rollback -> Rollout -> Launch
  4. Wait until build completion -> Edit (a finished ship in storage)
  5. Rollout -> Rollback -> Edit

What does not:

  • Editing ship from build list

But now, edited ship appears after the original in the queue, while in the previous builds edited one was first to build.

There are still messages of successful removal in the "bugged" case, whereas in the working case there are messages about ID comparison.

Maybe I'd better open a Github issue on this?

Logs:

Editing vessel from list

Editing vessel from storage

 

Edited by Pand5461
Link to comment
Share on other sites

15 hours ago, Pand5461 said:

Editing ship from build list

This is for an in-progress vessel? Ok, I didn't test that case. Thought I got everything but apparently something still slipped through. Now that I (presumably) know what's wrong I can probably knock this out really quick when I get home. Thanks for all your help, you've done a great job at testing this. :)

Edit: Alright, it should force a refind of the KSC all the time now, which should fix this issue (in #15). The KSC still gets cached for calculating rates and such, so that'll help performance still, especially when KSC Switcher is installed.

Edit 2: I've added ScrapYard to the OP. It is by no means ready for testing but is my primary focus for April. This thread should be used for discussion until a release thread is made (when it's been through a few betas). If you want to track progress you can do so by reading the github commits, or more easily by visiting the ScrapYard Trello board. This is the first time I've used Trello for a project. If it goes well I'll probably start using it more often. Also, based on what's currently on the board, assuming no delays and not a whole lot new added, I'm targeting a May 1st release of a "Minimum Viable Product" that'll be fully functional but missing a few features I consider important but not required for functionality (MVP features are red, "Strongly Desired" are orange)

Edited by magico13
Link to comment
Share on other sites

12 hours ago, magico13 said:

This is for an in-progress vessel? Ok, I didn't test that case. Thought I got everything but apparently something still slipped through. Now that I (presumably) know what's wrong I can probably knock this out really quick when I get home. Thanks for all your help, you've done a great job at testing this. :)

Edit: Alright, it should force a refind of the KSC all the time now, which should fix this issue (in #15). The KSC still gets cached for calculating rates and such, so that'll help performance still, especially when KSC Switcher is installed.

Edit 2: I've added ScrapYard to the OP. It is by no means ready for testing but is my primary focus for April. This thread should be used for discussion until a release thread is made (when it's been through a few betas). If you want to track progress you can do so by reading the github commits, or more easily by visiting the ScrapYard Trello board. This is the first time I've used Trello for a project. If it goes well I'll probably start using it more often.

I've been using build #15 for an hour or 2... edit seems to work just fine. Recover to storage, on the other hand = game crash.

reload, tried again with different ship... crash

tried again, another different ship ... crash

I'd post the logs, but I can't get on dropbox today for some reason. 

Link to comment
Share on other sites

Just now, TailDragger said:

I've been using build #15 for an hour or 2... edit seems to work just fine. Recover to storage, on the other hand = game crash.

reload, tried again with different ship... crash

tried again, another different ship ... crash

I'd post the logs, but I can't get on dropbox today for some reason. 

I've seen that too but couldn't tell if it was a result of changes I made or just KSP weirdness. I am not sure if I'll be able to fix it because it because it happens without any errors being logged and for no discernible reason... I'll see what I can come up with.

Link to comment
Share on other sites

On 05.04.2017 at 4:13 PM, magico13 said:

This is for an in-progress vessel? Ok, I didn't test that case. Thought I got everything but apparently something still slipped through. Now that I (presumably) know what's wrong I can probably knock this out really quick when I get home. Thanks for all your help, you've done a great job at testing this. :)

My pleasure :) Thanks for the great mod!

Build #15 works just fine on my side (but I have no idea what "Recover to storage" means).

Link to comment
Share on other sites

7 minutes ago, Pand5461 said:

(but I have no idea what "Recover to storage" means)

In the flight scene, while landed on Kerbin, open the KCT window and choose either the VAB or SPH. A button will be in the middle of the window saying "Recover To Storage" or something like that. What it does is takes the current vessel and puts it right back into the "warehouse" (after a short recovery delay). You can then edit it to refill the tanks and replace any missing/broken parts. It's mostly useful for planes since you avoid having to rebuild it with new parts.

It's an error prone process since it takes a Vessel that's had all sorts of things happen to it, and tries to turn it back into a craft file that you can load in the editor. Sometimes it works. Sometimes it doesn't. Since 1.2 it's decided it wants to completely crash the game with no errors, but only sometimes and without warning. It's a feature I added after a lot of requests for it, but it's always been a giant pain. If/when KCT gets rewritten I might try to avoid it entirely by putting more value into the part inventory (such as making vessels that are 100% from the inventory take really small amounts of time instead of "mostly small" amounts).

Link to comment
Share on other sites

Just a heads up. Tomorrow (Saturday April 8th) [edit: accidentally said 7th] at 12pm EDT (16:00 UTC) I'm going to be streaming some dev work. The dev work itself probably won't be that exciting, but it's a chance to come chat with me live about stuff. I'm planning on working on some of the core stuff for ScrapYard, aka all the backend that will make it work but not yet a UI or integration with KCT. I've got other plans that popped up at 4pm so it'll probably just go between 12 and 3 pm.

http://twitch.tv/themagico13

Edited by magico13
Link to comment
Share on other sites

31 minutes ago, StupidAndy said:

I have a glitch where whenever I try to recover it with the KCT menu the game crashes

the mod list is the same as here

do I have to give you a debug log thing or something (sorry, I know nothing about computers)

It was previously reported and I saw it myself. Not sure when I'm going to get a chance to work on that, but for now that functionality is just broken, sorry :/

Link to comment
Share on other sites

8 minutes ago, StupidAndy said:

ah okay, I have two other saves and it didn't happen, so it might have something to do with the modlist, I got the KCT version from the page 51 download so I haven't gotten an updated version.

Yeah, it's been an intermittent problem. With the latest build it's doing it on my end (and was also reported by someone else), but on  previous builds it was fine. But that code hasn't been touched in those builds. That particular code has always been troublesome unfortunately.

 

E: I just pushed an update that might help. When I was working on SimuLite I saw a similar issue with scene changes, where requesting a scene change would cause a crash to desktop. This code is a bit different, but still ultimately results in a scene change (I never actually request one, KSP does it itself). I applied the same fix and it seems to be working better for me. Try out build #16 or later if you get a chance.

Edited by magico13
Link to comment
Share on other sites

April development live stream is going to start in about 10 minutes (at 12pm EDT) and will run for up to 3 hours depending on how I'm feeling (got a bit of a headache starting) and if anybody shows up :wink: As I've mentioned in the past, the development itself probably won't be super interesting (unless you like staring at shoddy code, in which case it will be VERY interesting :D) but you can chat with me live about stuff (KSP related or not). This month I'm going to be focusing on ScrapYard and KCT. https://www.twitch.tv/themagico13

Edit: Stream finished! Thanks for stopping by!

Edited by magico13
Link to comment
Share on other sites

@magico13 So I just watched some of your stream from yesterday. It seems like the downwards pointing ship problem in Simulite is because the ships are being repositioned, but not reoriented. I'd bet that a ship placed on the equator, 180 degrees apart from KSC will point straight down, and one on the pole will be flat on its side, etc. I don't know it that helps, but I figured I'd put my 2 cents in.

Link to comment
Share on other sites

I'm pretty sure it was doing it at the equator as well, but I'll test that again. There's a bunch of rotation related stuff in the code I'm using and I've tried changing parts of it to see what happens, but it's had pretty much no effect. I'll ping Nightingale about it if I can't figure it out and end up going back to that mod at some point.

Link to comment
Share on other sites

Quick progress update on ScrapYard and KCT. I spent some time this weekend trying to get a few more core features into ScrapYard, focusing on the part tracker and coming up with a way for other mods to use the inventory without a hard dependency on ScrapYard. With regards to the part tracker, there are three of them that all appear to be working. The "Individual Part Tracker" uses a Module that's applied to all parts to uniquely track them from the time they're placed into the editor to the time they're recovered. It also tracks how many times that exact part has been recovered, which is persistent across builds. In other words, you can recover a part and then use that exact part in another build and each time it's recovered that will be tracked within the part. The other two part trackers fall under the collective name of the "Like Part Tracker", which doesn't track things on an individual scale but instead just by name (so two very different shaped procedural parts would count as one thing in the Like Tracker). That tracker tracks the total number of uses of a part (if you use 9 of the same engine in a build then that counts as 9 uses) and the total number of builds using that part (that same 9 engine build would count as 1 build, but building it twice means 2 builds and 18 uses).

Regarding the API, I've got a very initial, untested (but theoretically sound), build of KCT locally that is set up to use ScrapYard. There are a few hangups that I'll need to come up with a way to address. Scrapping doesn't work yet (just need to add a few more methods to the API, but that should be easy) and editing vessels wouldn't work right either. Once I track down those situations and double check that all the places that would use the inventory now are using ScrapYard, I'll release an Alpha build with that. I say Alpha and not Beta because ScrapYard might still have some breaking changes on its way with regards to how modules are stored (storing only limited info instead of an entire module) and with how parts are pulled out of the inventory (happening while building instead of at build time). The good news is that if you don't want to play with the potentially breaking ScrapYard changes, that's fine since KCT won't depend on it at all and you don't need to install it :P

 

In short, progress is going well and I'm pretty on track with the schedule outlined in the ScrapYard Trello. I hope to have an Alpha level release of KCT + ScrapYard  in the next week. Beta level release is still scheduled for May 1. I haven't followed KSP 1.3's progress that closely so that might shift plans a bit (in case you are wondering, KCT will not support other languages. If/when the rewrite happens, then it will be written for localization from the start).

Link to comment
Share on other sites

On 3/31/2017 at 9:46 PM, magico13 said:

Speaking of crew assignment... The latest build (#11) now remembers your crew settings in the editor and uses those as the defaults when you assign crew through KCT. It isn't fully tested, so that's where I need your help! This means that if you put your scientists in your science labs and your pilots in your command modules, they should still be there when you go to launch. If they were sent off on a different ship between the build's start and its launch then that kerbal's seat will just be empty by default. If all crew are gone then it'll fall back to the regular method of throwing Jeb into the first seat he can find.

If you want those assignments of scientists and such to be automatic, try out BetterCrewAssignment. This update was made with that mod specifically in mind, so I'd appreciate it if some people could test it. Thanks!

 

@magico13

I recently adopted Crewqueue and renamed it to CrewRandR.  This included renaming all internals, etc.

Can you take a look to see if you can get KCT compatible with it?  API is the same other than the renaming.

Link to comment
Share on other sites

10 minutes ago, linuxgurugamer said:

@magico13

I recently adopted Crewqueue and renamed it to CrewRandR.  This included renaming all internals, etc.

Can you take a look to see if you can get KCT compatible with it?  API is the same other than the renaming.

I can certainly take a look at it. Enneract is the one who put it into KCT in the first place so I never actually knew if it worked, but I don't anticipate it being too difficult to support.

Edit to add that I'll definitely make it happen. KCT's purposefully never interacted with Kerbals and I had been considering taking over CrewQueue for a while to handle that side of things. With that said, if you find you need to shed some load in the future, let me know.

Edited by magico13
Link to comment
Share on other sites

On 4/16/2017 at 11:09 PM, magico13 said:

Quick progress update on ScrapYard and KCT. I spent some time this weekend trying to get a few more core features into ScrapYard, focusing on the part tracker and coming up with a way for other mods to use the inventory without a hard dependency on ScrapYard. With regards to the part tracker, there are three of them that all appear to be working. The "Individual Part Tracker" uses a Module that's applied to all parts to uniquely track them from the time they're placed into the editor to the time they're recovered. It also tracks how many times that exact part has been recovered, which is persistent across builds. In other words, you can recover a part and then use that exact part in another build and each time it's recovered that will be tracked within the part. The other two part trackers fall under the collective name of the "Like Part Tracker", which doesn't track things on an individual scale but instead just by name (so two very different shaped procedural parts would count as one thing in the Like Tracker). That tracker tracks the total number of uses of a part (if you use 9 of the same engine in a build then that counts as 9 uses) and the total number of builds using that part (that same 9 engine build would count as 1 build, but building it twice means 2 builds and 18 uses).

Regarding the API, I've got a very initial, untested (but theoretically sound), build of KCT locally that is set up to use ScrapYard. There are a few hangups that I'll need to come up with a way to address. Scrapping doesn't work yet (just need to add a few more methods to the API, but that should be easy) and editing vessels wouldn't work right either. Once I track down those situations and double check that all the places that would use the inventory now are using ScrapYard, I'll release an Alpha build with that. I say Alpha and not Beta because ScrapYard might still have some breaking changes on its way with regards to how modules are stored (storing only limited info instead of an entire module) and with how parts are pulled out of the inventory (happening while building instead of at build time). The good news is that if you don't want to play with the potentially breaking ScrapYard changes, that's fine since KCT won't depend on it at all and you don't need to install it :P

 

In short, progress is going well and I'm pretty on track with the schedule outlined in the ScrapYard Trello. I hope to have an Alpha level release of KCT + ScrapYard  in the next week. Beta level release is still scheduled for May 1. I haven't followed KSP 1.3's progress that closely so that might shift plans a bit (in case you are wondering, KCT will not support other languages. If/when the rewrite happens, then it will be written for localization from the start).

Forgive me if this is a dumb question, but does "breaking" mean that if I have an ongoing campaign using KCT, I'm not going to be able to add ScrapYard and will have to restart?

Link to comment
Share on other sites

1 hour ago, ZachPruckowski said:

Forgive me if this is a dumb question, but does "breaking" mean that if I have an ongoing campaign using KCT, I'm not going to be able to add ScrapYard and will have to restart?

 

30 minutes ago, JeffreyCor said:

It depends on context. i believe in this instance it is more game/save breaking bugs rather than continuity of save. Before release it is always a good idea to do all testing with a separate save anyway. :)

You will be able to add ScrapYard to an existing save and theoretically will be able to remove it later without issue (other than some build times being out of whack, such as when editing a finished vessel). But while ScrapYard is in development the inventory might get broken between builds and have to be cleared out. If you wait until release that shouldn't be an issue and you can drop it into an existing save without any problems. Note that the inventory being broken between builds isn't necessarily save breaking since you can safely delete all that data from the save file manually if need be. It shouldn't cause any permanent breaks as long as you're ok with the occasional editing of the save file to delete a chunk of text. But backup the save often.

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