Jump to content

Kerbal Construction Time/StageRecovery Dev Thread


magico13

Recommended Posts

I like where this is going and I will be looking at it for future use. How will this handle mods?

The build time algorithm is a function of the cost of the parts that make up the total vessel. As long as the mods include a price for their parts there isn't an issue (and any parts with zero cost just don't have an effect on the build time). As far as I can tell, most mods have somewhat reasonable costs for their parts compared to stock, so build times should be reasonable. Mods that don't add parts shouldn't have any effect on this and this shouldn't have an effect on them, after the build list is complete at least (see above for issues with Interstellar, also some life support mods may have issue). There may be times when incompatibilities arise, however, as there is with any mod. Kerbal Alarm Clock is one mod that I wish to maintain compatibility with, and perhaps include functionality for (adding timers for currently constructing vessels automatically), along with the toolbar plugin in future updates.

Link to comment
Share on other sites

Alright, I just finished uploading Pre-Release 3. The biggest change: The build list! It's still super beta, and if there were a release that would break everything it would be this one. If you're going to try it with an existing save, I'd suggest letting any building ships finish and then making a backup. It seems to be working fine with new saves though.

How to use the build list:

In the editor of your choice (VAB or SPH), start building a new craft. Click the Launch! button, then Add to Build List. The window will close, and you're done. It's in the list now. Go back to the Space Center and click the KCT button, the GUI will pop up with the next craft to finish being listed (name, location, time left, and a time jump button). Press the VAB List or SPH List button, you should see your craft there with a percentage, a time left, and two buttons. TOP puts that ship at the top of the list (only the top one progresses) and X cancels construction of the ship. When the ship is finished, it goes into the respective Storage. Open that, then press Launch to launch the ship or Scrap to scrap it for parts. That's basically it. I added a few pictures at the end of the embeded album on the OP.

Time Jump: Time Jump is available in the Space Center scene only. It requires that all vessels be either landed or in circular orbits (to prevent SOI changes, which break things). Circular is defined as the periapsis being within 10% of the apoapsis (so a 250km apoapsis must have a periapsis of 225km or higher). Unfortunately, I can only get SOI change predictions for the active vessel, and not all vessels.

Time Warp: Available in the flight mode version of the build list GUI. This warps just like the old versions, and is safer. Plant a flag at KSC and use it to warp. You can't warp in the space center scene, otherwise I would have implemented that instead of time jump.

Q: Why does my ship have messed up crew assignments?

A: I had to take the default crew assignments, which means that we're back to pre-0.21 times. Use a mod like Crew Manifest for the meantime (linked in OP).

After how much this past week has been crappy for me (unrelated to this) and because I'm visiting a grad school next weekend, I won't be doing any work this week/weekend on this. Except in the case of serious bugs. Afterward, I will get to work on one of the following things, let me know which one you want:

* Tech tree integration of the build list, along with other build list improvements (finer control of order, ability to edit currently constructing vessels)

* Tech tree integration of simulations, along with other simulation improvements (selectable end conditions [with more options as you advance the tree], better revert capabilities [aka, making a backup of the save file], simulations affecting build times)

* Blizzy's Toolbar integration + Crew selection GUI

Link to comment
Share on other sites

Is there a way to disable the auto revert in simulation when I crash or get to orbit? I am using Mission Controller and I would rather use that revert so I get my money back.

Not currently. Does Mission Controller normally give you you money back when you revert to the editor? This does it in the exact same way as pressing the revert to vehicle assembly button in stock KSP (which loads a cached copy of the persistence).

At the very least, you can disable the time limit for simulations in the config file (default is 7200 seconds, or 2 game hours) which would only leave you with reverting on crash, which happens automatically because KSP has an absolutely evil window that pops up when a vessel is destroyed that lets you bypass the restrictions of simulations (which I may be able to avoid by saving a copy of the persistence myself, then loading that later).

Link to comment
Share on other sites

Not currently. Does Mission Controller normally give you you money back when you revert to the editor? This does it in the exact same way as pressing the revert to vehicle assembly button in stock KSP (which loads a cached copy of the persistence).

At the very least, you can disable the time limit for simulations in the config file (default is 7200 seconds, or 2 game hours) which would only leave you with reverting on crash, which happens automatically because KSP has an absolutely evil window that pops up when a vessel is destroyed that lets you bypass the restrictions of simulations (which I may be able to avoid by saving a copy of the persistence myself, then loading that later).

It does not give your money back unless you use the revert button from MCE. Is there a way you could post a version that uses that revert for people using MCE? :)

Link to comment
Share on other sites

At the very least I can maybe make a config option to disable the auto revert on crash. Can you still use MCE to revert no problem with the normal timed method? All that happens when the time is up is that the game pauses and a window pops up, you should be able to activate other buttons on other GUIs no problem (also, you can disable the time limit). I think he's gonna be redoing his API soon, so i may be able to do some better integration down the line.

I have class and stuff now, but might be able to get a hotfix out tonight

Link to comment
Share on other sites

Alright, hotfix is uploaded. Includes a config option "AutoRevertOnCrash = true" which when set to false makes the window pop up instead. However, KSP's evil window of evil will also pop up. It is imperitive that you PRESS CLOSE ON THE EVIL WINDOW. Don't ever press anything else. Please. It messes things up. I'm trusting you :wink:

Also makes the little pop up GUIs have sensible heights and look less silly, so there's that. Otherwise, no changes from the previous version.

Edit: Uploaded a hotfix that actually matters in terms of bug fixes! It fixes a pretty serious bug that occurs when something is being removed by the game but the active vessel is null. I had it happen to me, and it totally broke the game, but didn't kill the save thankfully. This hotfix (located in the OP) fixes that issue (it was in the booster recovery code. Booster recovery should still work no problems, but is untested as of right now).

It is highly recommended that you use the new hotfix! (PR 3b)

Edited by magico13
Link to comment
Share on other sites

I've been wanting to use a mod like this for a long time! Thankyou for your work. Unfortunately I was unable to get your most recent Beta to work well on my game. However I installed your second beta and I love it! I set the build time modifier to x4, because I'm running TAC life support, and that seemed to balance out very well.

I actually really like your simulation system how it is set up, it works well with my gameplay style.

Link to comment
Share on other sites

Glad to hear that you're enjoying this :)

By you saying that the most recent beta did not work for you, what exactly do you mean by that? Perhaps I can help. Are you currently using PR2? And which version of PR3 were you trying? Or do you mean that PR3b is the one you're using and PR3a didn't work for you? If that's the case, then you were probably having the same bug I was, which actually made it impossible for me to use this in my main save :P

For anyone wishing to submit bug reports, the ksp.log file and the KSPdata/output_log files are extremely helpful for me when diagnosing bugs. They may even help you fine the source of other bugs you may encounter in other mods :)

Link to comment
Share on other sites

Hi, I'd really like to use this but it completely kills KSP for some reason. Trying to load any save with this installed goes all wonkie, it says X number of flights in the select screen, but get to the tracking station and there's only one there, even tho the icons say there should be more, and they're all visible on the map. Trying to actually load one just gets me the "nothing there but rushing wind" thing. As long as the persistence file hasn't been saved, I can exit, remove your mod, reload & everything seems fine. Try that AFTER it saves, and there will be dozens of duplicates of a flight. I realize that's not a whole lot to go off of, so let me know what other info you need.

Link to comment
Share on other sites

Hi, I'd really like to use this but it completely kills KSP for some reason.

This is with the newest hotfix (3b)? Hmm, you don't skip the Space Center scene with another mod do you? That may cause issues, but just with ship ghosting. Maybe I messed something up with the new hotfix, but I was just playing with it without issues. If you can get me your KSPData/output_log file (its something like that, I'm not at my computer ATM) then I can take a look tomorrow morning. Thanks! :)

Edit: It's KSP_Data/output_log.txt and it gets rewritten every time KSP is started. For it to be useful to me, the issue had to happen during the last time you ran KSP (quickloading won't mess up the log though). Thanks everyone! Hopefully we can track these bugs down!

Edited by magico13
Link to comment
Share on other sites

Not currently. Does Mission Controller normally give you you money back when you revert to the editor? This does it in the exact same way as pressing the revert to vehicle assembly button in stock KSP (which loads a cached copy of the persistence).

At the very least, you can disable the time limit for simulations in the config file (default is 7200 seconds, or 2 game hours) which would only leave you with reverting on crash, which happens automatically because KSP has an absolutely evil window that pops up when a vessel is destroyed that lets you bypass the restrictions of simulations (which I may be able to avoid by saving a copy of the persistence myself, then loading that later).

The revert in MCE all it does is keep the MCE Save file and the KSP save file in sync. So when you use the MCE revert button the backup save for MCE and the backup save for KSP is loaded.

With regular Revert for KSP only the KSP backup save is loaded. Which was causing issues with money in MCE. Never really found a way to disable or overwrite the Regular KSP revert. Which is why I made my own.

The revert for MCE is not available right now in the API. Never thought anyone would need it. But I could work on adding it.

Basically how it works is pretty easy. I just use the regular Revert button and a LoadBackup save on my button. The backup is only ever saved during Spacecenter screen. So its usually always behind the regular save file. They push button, and KSP reverts as usual, and also loads the backup .sp file for MCE. (which should in most cases have the old saved info and Money before the launch)

Edited by malkuth
Link to comment
Share on other sites

The revert in MCE all it does is keep the MCE Save file and the KSP save file in sync. So when you use the MCE revert button the backup save for MCE and the backup save for KSP is loaded.

With regular Revert for KSP only the KSP backup save is loaded. Which was causing issues with money in MCE. Never really found a way to disable or overwrite the Regular KSP revert. Which is why I made my own.

The revert for MCE is not available right now in the API. Never thought anyone would need it. But I could work on adding it.

Basically how it works is pretty easy. I just use the regular Revert button and a LoadBackup save on my button. The backup is only ever saved during Spacecenter screen. So its usually always behind the regular save file. They push button, and KSP reverts as usual, and also loads the backup .sp file for MCE. (which should in most cases have the old saved info and Money before the launch)

Have you tried setting FlightDriver.CanRevertToPostInit and FlightDriver.CanRevertToPrelaunch to false after loading? I haven't tried it, but that may disable the normal revert buttons (though I don't know what repercussions that may have).

So all I'd need to do is get access to your LoadBackup and run that in my revert? Seems simple enough, if you can make that available in the API. Unless you come up with a better method for the API, perhaps setting a variable like ForceLoadBackup to true and your mod handling the loading when it sees that, that way I don't need to know the file names and you have more control.

No rush on this either, the current way its being handled works fine for now and I'm rather busy for the next week or so anyway.

Link to comment
Share on other sites

This is with the newest hotfix (3b)? Hmm, you don't skip the Space Center scene with another mod do you? That may cause issues, but just with ship ghosting. Maybe I messed something up with the new hotfix, but I was just playing with it without issues. If you can get me your KSPData/output_log file (its something like that, I'm not at my computer ATM) then I can take a look tomorrow morning. Thanks! :)

Edit: It's KSP_Data/output_log.txt and it gets rewritten every time KSP is started. For it to be useful to me, the issue had to happen during the last time you ran KSP (quickloading won't mess up the log though). Thanks everyone! Hopefully we can track these bugs down!

Ok I redownloaded 3b and that does seem to work ok, tho I only futzed with it for a few minutes, it did not appear to have corrupted anything. Iirc there's no settings file in that download, just the .dll right?

Link to comment
Share on other sites

Ok I redownloaded 3b and that does seem to work ok, tho I only futzed with it for a few minutes, it did not appear to have corrupted anything. Iirc there's no settings file in that download, just the .dll right?

Correct, the settings file from the old version would work just fine with this one. I didn't include it (I did only for the original PR3) because I didn't want to overwrite any changes people may have made to theirs. Sounds like you had the same issue I did then. For me it caused the whole Space Center model to be imported into the editor, then any time you launched it would just do the "nothing but wind" bug. I also saw some duplication going on with that. Couldn't ever get to the tracking center though, because of remote tech. Otherwise I also would have probably seen the massive explosion you did :D

Note, this issue should also exist in pre release 2! So if anyone is using that, I'd suggest updating!

If anyone's curious, I think this is the cause: In the "onVesselDestroy" event I was checking if FlightGlobals.ActiveVessel.id == destroyedVessel.id, but if you haven't loaded the flight scene yet then FlightGlobals.ActiveVessel doesn't exist yet (thus you can't get the id). In a new game (what I test with) there is no way that would get called before flight. In a saved game it can get called before flight, which KSP then flips it's *** about and has all sorts of weird (seemingly unrelated to the actual cause) bugs. KSP has the weirdest crashes...

Link to comment
Share on other sites

Have you tried setting FlightDriver.CanRevertToPostInit and FlightDriver.CanRevertToPrelaunch to false after loading? I haven't tried it, but that may disable the normal revert buttons (though I don't know what repercussions that may have).

So all I'd need to do is get access to your LoadBackup and run that in my revert? Seems simple enough, if you can make that available in the API. Unless you come up with a better method for the API, perhaps setting a variable like ForceLoadBackup to true and your mod handling the loading when it sees that, that way I don't need to know the file names and you have more control.

No rush on this either, the current way its being handled works fine for now and I'm rather busy for the next week or so anyway.

yup already added it to the API for next version. Have a few more things I'm working on and will upload it.

Disabling the revert would be bad. Then nobody could revert. Not even my button. ;) since it uses the same functions to operate as KSP revert. (good idea for hardcore mode though)

Best bet would of been to overwrite the Revert in the pop up. But can't find any access to it. Like a lot of things in KSP its one of the things you can't overwrite.

by the way that evil screen you reference about. (the one that pops up when you crash) did you know that all the buttons in that screen revert the save file? Even the ones that say spacecenter and trackingstation.

Did many test on that dam screen.. And it is indeed evil.

Edited by malkuth
Link to comment
Share on other sites

Best bet would of been to overwrite the Revert in the pop up. But can't find any access to it. Like a lot of things in KSP its one of the things you can't overwrite.

Yeah, if I could just disable that pop up entirely then I'd be happy. It doesn't look like it has its own GameEvent.onGUI**Spawn method either, so no doing anything there. I'm not a huge fan of doing the auto revert (1: no epic crashes during simulations, 2: reloading the editor scene just to do another test flight is unnecessarily annoying, 3: it just feels really out of place), so when I do some more work on simulations I may come up with a different method (probably manually backing up the save, then people can do pretty much anything and if they choose any of the other options on that popup it will just load my backup)

Just saw your comment on the reverting with the pop up. Even going to space center reverts? Are you sure, because then how would Kerbals stay dead? I'll have to do more tests with it. If that's the case, then it makes my job a lot easier.

Actually I don't think I put any settings file in with the .dll at all, if that makes a difference.

Nope, it will just create it with the default values and it will be there next time you look! If you never change anything in it, then you don't have to worry about it being deleted/removed :)

Edited by magico13
Link to comment
Share on other sites

Yeah, if I could just disable that pop up entirely then I'd be happy. It doesn't look like it has its own GameEvent.onGUI**Spawn method either, so no doing anything there. I'm not a huge fan of doing the auto revert (1: no epic crashes during simulations, 2: reloading the editor scene just to do another test flight is unnecessarily annoying, 3: it just feels really out of place), so when I do some more work on simulations I may come up with a different method (probably manually backing up the save, then people can do pretty much anything and if they choose any of the other options on that popup it will just load my backup)

Just saw your comment on the reverting with the pop up. Even going to space center reverts? Are you sure, because then how would Kerbals stay dead? I'll have to do more tests with it. If that's the case, then it makes my job a lot easier.

Nope, it will just create it with the default values and it will be there next time you look! If you never change anything in it, then you don't have to worry about it being deleted/removed :)

It was the only thing I could come up with, for the reason that science gets reset to what you had before launch.

Mission Controller has a Crash Goal.. Objective is to crash a vessel into the planet and you gain science and Money. Well when you crash that window pops up, and no matter what I did when you used any button on that screen the science points that MCE gives you for completing the mission, gets reset when you go to the next screen (any of them) using that Pop up. If you exit out of the screen and just Esc out of it. Then the science points are rewarded to you. MCE bypasses the whole Data Points and just gives you a direct Supplement to your science points in the persistent file. So the only explanation for the science points being reset is that the persistent file is being reset. At least the science part is. Not sure about the dead kerbals. That would not make sense I guess then... But something is funky with that screen.

Link to comment
Share on other sites

At least the science part is. Not sure about the dead kerbals. That would not make sense I guess then... But something is funky with that screen.

It should be pretty easy to check, just gotta check the UT before/after. I have also noticed issues with science and reverting, though not confirmed, during my normal play. I think if you perform an experiment and transmit it, then crash and revert, the value of the same experiment goes down (so crew reports are useless) but you don't get to retain the science. I haven't actually confirmed this is the case, but when I was doing testing with planes around KSC I could swear it was happening.

Link to comment
Share on other sites

It works by checking the drag and mass of each part and for parachutes it checks the module for the maximum drag. Real chutes has it's own module and so is currently incompatible, but I may try to add compatibility soon. The stock chutes will still work properly with real chutes installed (I also use real chutes, I tested it yesterday). I'm out of town this whole weekend (I'm in the car right now most of the way through a 7 hour drive. 2 hours left!...) So I won't get to it until next week at the earliest.

Also, I think they don't actually have to be activated for it yo work :P

Link to comment
Share on other sites

It works by checking the drag and mass of each part and for parachutes it checks the module for the maximum drag. Real chutes has it's own module and so is currently incompatible, but I may try to add compatibility soon. The stock chutes will still work properly with real chutes installed (I also use real chutes, I tested it yesterday). I'm out of town this whole weekend (I'm in the car right now most of the way through a 7 hour drive. 2 hours left!...) So I won't get to it until next week at the earliest.

Also, I think they don't actually have to be activated for it yo work :P

ok, I'll try that, tho that's another rocket you've cost me :wink::kiss: Lol and I need chutes to pop either way, DRE gets might hungry right around there.

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