Jump to content

Kerbal Construction Time/StageRecovery Dev Thread


magico13

Recommended Posts

Update on the funkiness I'm getting though; it seems that Kerbals have been experimenting with cloning. Jeb's getting cloned somehow; which opens the possible culprit up to Final Frontier and KSP Renaissance Compilation; as they both affect Kerbals.

KCT's actual code related to normal recovery of vessels is pretty minimal. It doesn't actually do anything with kerbals (except checking if the recovered vessel is a kerbal), it just goes through the part list and adds the parts to the inventory. If you can get me a log of it happening when you get the chance, preferably with as few steps as possible to make it easier to sort through (loading a game, going to the trackingstation and recovering a vessel, then exiting the game). Take your time, but I don't know what else I could do until then. I'm including the recovery code below, so you can see exactly what KCT does with recovery.

 public void vesselRecoverEvent(ProtoVessel v)
{
if (!KCT_GameStates.settings.enabledForSave) return;
if (!KCT_GameStates.flightSimulated && !v.vesselRef.isEVA)
{
Debug.Log("[KCT] Adding recovered parts to Part Inventory");
foreach (ProtoPartSnapshot p in v.protoPartSnapshots)
{
//Debug.Log(p.partInfo.name);
KCT_Utilities.AddPartToInventory(p.partInfo.name);
}
}
}

I was thinking instead of paying the same price for each upgrade point, make the cost for upgrading each of the various items scale based on the current level of the item.

In some ways I like this, but it likely would require rewriting a large portion of the upgrade system. If I didn't provide the option of resetting the spent upgrades it would be easier, but I'd rather keep that option there. For simplicity I will likely just make it so you can spend funds directly on upgrade points like you can with science. I am a fan of the increasing cost idea though, so perhaps you can purchase upgrades at an initially low cost and the cost increases as you buy them.

Heres an idea to magico. Have a means of selling outdated parts from your inventory to get some funds back from it ( even at 25-50% rate anything would be nice).

Seems like a reasonable suggestion, except there are problems. The issue I can see with getting funds for the parts is that you get funds back from recovery of parts already, so if you, for example, build a 1 part ship for X funds, then recover it from the launchpad then you will get X funds back and the part added to the inventory, where you could then sell the part for y*X funds, meaning you would get y*X funds for free. I could avoid this by making it so once you buy a part for a build, you don't get funds back until you sell the part (meaning you don't have to pay for that part in a build, so a reusable craft would be completely free to launch, minus fuel costs). That's non-trivial to do though, as I would have to take back the funds that KSP gives you for recovery of parts (but not fuel), and also any given by mods such as StageRecovery or DebRefund (and disable KCT's own funds recovery). I will consider it, because otherwise there's basically no reason to remove parts from the inventory. The cost listed in the editor would also be wrong, since inventory parts wouldn't cost anything. Also, the distance to KSC thing (on recovery) would likely be reworked so that you would pay money to recover things that are far from KSC.

It's definitely doable, but it doesn't fit in with stock KSP well at all. All the GUIs would be wrong (cost in editor, recovery window). It feels like it's too much of a change to me :/

I'll try to think of a way to implement similar behavior without completely redoing how Stock does funds, and that also wouldn't allow you to get free money, but no promises.

If you really want to remove parts from the inventory, you can go into the persistence and remove them. You'd have to remove two lines per part, one is the part name and the line following it is the number of those parts in the inventory.

Link to comment
Share on other sites

In some ways I like this, but it likely would require rewriting a large portion of the upgrade system. If I didn't provide the option of resetting the spent upgrades it would be easier, but I'd rather keep that option there. For simplicity I will likely just make it so you can spend funds directly on upgrade points like you can with science. I am a fan of the increasing cost idea though, so perhaps you can purchase upgrades at an initially low cost and the cost increases as you buy them.

Makes sense. Maybe do the same for Science with linearly increasing costs in science and/or funds to buy points.

Link to comment
Share on other sites

I found a fun bug that I can reproduce. :) If the 'Simulation Configuration' dialog 'simulate' button is overtop of the 'Kerbal Construction Time' window at the time you press the button then once you go into the flight mode you cannot control the camera with the right mouse button.

I tested this in a clean install of 0.24.2 32bit with only KCT PR 7.0.5 installed. output_log

Steps to reproduce:

Startup the VAB and create a ship.

Click the 'simulate' button in the 'Kerbal Construction Time' window.

Note where the 'Simulation Configuration' window appears.

Move the 'Kerbal Construction Time' window so that the 'Simulation Configuration' window will appear over it.

Click the 'simulate' button in the 'Kerbal Construction Time' window.

The 'Simulation Configuration' window should now be over top of the 'Kerbal Construction Time' window.

Click the 'simulate' button to go into flight mode.

Once in flight mode acknowledge the KCT dialog and note that you cannot move the camera with the right mouse button.

Javascript is disabled. View full album
Edited by Qberticus
Link to comment
Share on other sites

I am getting a bug using KCT since updating to 0.24.2.

On loading a previous save everything works ok, but after a certain period of game-time (just a few minutes), as soon as the tracking station is entered, all the graphics are mis-placed (icons & text off-set in the wrong place) and the exit button does not work. I have to close the game process in task manager.

A similar problem happens when trying to move between vessels in map view, every gets all messed up and I end up looking at the Sun only and cannot move.

The logs screen does open, and shows alot of NullReferenceException but I cannot scroll the list as it does not respond to mouse clicks.

This is 64bit with other mods installed, but does not happen when KCT is removed. Does it need to be recompiled to the latest version?

Edited by themongoose
Link to comment
Share on other sites

I found a fun bug that I can reproduce. :)

I do like reproducible bugs! I'll try this out myself and will likely have it fixed in the next version. I wonder how related this is to the bugs other people were getting with camera lockups in simulations in previous versions. I never could figure that out.

Also, thank you. That was a perfectly laid out bug report. I should put a section in the OP saying how to do bug reports, and will likely link to this one if that's ok with you.

Edit: It was an issue with the mouseover lock not being disengaged. A pretty simple fix, which is in place for next release. It might be a little while before then, though.

I am getting a bug using KCT since updating to 0.24.2.

Unfortunately this bug is going to be more difficult. You probably can't scroll through the log window because it resets to the bottom when new things are logged, and the NRE's are probably continuously firing. A bug that manifested this way was fixed a while ago with the booster recovery code, so that could be that acting up again. Can you get me the KSP_x64_Data/output_log.txt file from a play session after the bug happened? It's likely a bigger issue than a recompile, as little to nothing changed between 0.24.1 and 0.24.2.

If you can get this to happen just by entering the trackingstation, then try to only load the game, go into the tracking station, and exit the game (assuming the bug occurred). The smaller the log the easier it is to read and the less variables there are.

Edited by magico13
Link to comment
Share on other sites

A+ for the mod magico13. I examined the mod thinking it would be a tiny mod that would do something cheesy like make me wait a week between launches, but this mod is much more than that. It's fleshed out, fun, and adds a new feature to the game. It's a tad buggy, but I'm sure you'll squash them for upcoming releases.

There's a bug with starting simulations in orbit for me. Once I configure a simulation to start in an orbit around any body, the first simulation will always be on the launch pad-- I need to restart the simulation at least once to get it into the orbit I want it to be in. Any subsequent restarts will put me in orbit. I'm using 64bit.

Link to comment
Share on other sites

A+ for the mod magico13. I examined the mod thinking it would be a tiny mod that would do something cheesy like make me wait a week between launches, but this mod is much more than that. It's fleshed out, fun, and adds a new feature to the game. It's a tad buggy, but I'm sure you'll squash them for upcoming releases.

There's a bug with starting simulations in orbit for me. Once I configure a simulation to start in an orbit around any body, the first simulation will always be on the launch pad-- I need to restart the simulation at least once to get it into the orbit I want it to be in. Any subsequent restarts will put me in orbit. I'm using 64bit.

The funny thing is, I just discovered that bug myself a couple days ago and have already fixed it! How I saw it is a bit different from your description, though. The very first simulation in orbit after starting KSP will work fine, but after reverting to the editor any new simulations won't start in orbit. If you use the KCT restart simulation button then it will start in orbit, like it should. The problem was that it wasn't setting the "moved" variable back to false, which meant that it thought it had already put the craft in orbit. I just made it set that to false whenever the simulation backup file is used, so that should fix it. But thank you for letting me know! There are a lot of little bugs that I, or the testers, don't catch.

When the mod first started it wasn't much more than that, but since then I've been trying to flesh it out more and it's taken on a much larger scope than I had originally intended, and it keeps growing! Which is one of the primary reasons I haven't done an official release yet. There's always more that I want to add, or that people suggest. The two "big" new features for the next version are simulations costing money based on where they start and how long they last, and launchpad reconditioning. Both were ideas submitted by users.

Link to comment
Share on other sites

Crash report here on 0.24 64-bit. I installed a number of mods updated for 0.24.2 and confirmed that it worked (didn't do anything besides let the KSC load). Then I installed this, started Kerbal, loaded the existing save, and got a crash before the KSC even appeared.

This poisoned the save file and it crashes even after removing KCT. However! Deleting that save, reinstalling KCT, and making a new save lets the KSC load correctly!

Looks like a little error checking is in need or else you always have to make a new save. I get the impression that the 64-bit version is more ready to crash on errors than trying to keep on truckin'. If you need any logs, give a shout.

Edited by TomatoSoup
Link to comment
Share on other sites

If you need any logs, give a shout.

If you've got them, I would appreciate seeing them. There's so many elements to this mod that I wouldn't even know where to start looking, as others appear to have used existing saves without issues. Making a new stock save, then adding KCT and loading the save doesn't generate any issues on my end with PR7.0.5. If you're able to reproduce it consistently I'd love to see the logs and a list of mods with versions (Or, perhaps, a compressed version of your GameData folder without the Squad and NASAmission folders, but you should PM that to me if you do that).

Link to comment
Share on other sites

Sometimes when I load a craft in the VAB the games starts acting weird on me. It will have all the buttons in top right greyed out and unavailable except for the quit button which is highlighted (but still unclickable). If I simulate the craft, the mouse refuses to move the camera around like it normally does (works fine in map view though). If I go back to the Space Center from the simulation, the camera that is normally overlooking the space center that allows you to select a building is shifted to right next to the VAB, facing towards the runway, low to the ground. The game doesn't crash, but it persists even if I quit all the way back to the main menu and try to reload the save. The only way to fix it is to restart the game.

Link to comment
Share on other sites

Sometimes when I load a craft in the VAB the games starts acting weird on me.

I think I know what the problem is. It sounds like one of the locks is persisting through scenes that it shouldn't be. I may have already fixed that in the next version. The buttons will be disabled whenever you put the mouse cursor over the GUI in the editor, so make sure that when you press the simulation button (after configuring around what body and what orbit height) that the editor window is not behind the configuration window when you press "simulate". If it's just the bug mentioned here: http://forum.kerbalspaceprogram.com/threads/69310-WIP-0-24-1-Kerbal-Construction-Time-PreRelease-7-0-5-%287-24-14%29?p=1307617&viewfull=1#post1307617 then I have already fixed that but in the mean time you just have to work around it. (also if you load up the editor and mouse over the window and then move the mouse off of it, it should reset.)

Link to comment
Share on other sites

I've encountered a serious problem with KCT:

I've not been able to reproduce this all the time, but during a simulation, if I use the "Restart flight" instead of "Restart Simulation", my game goes haywire. The menu after "Restart flight" is not shown, only the gray box with some text, but no buttons and the game stops/only resumes if I manage to open the KCT panel and return to VAB. After that, "Restart Simulation" doesn't work at all, flight data window is broken too, and if I start a normal flight, "Restart flight" brings me back to the simulation. Sometimes the game locks up completely (was not able to access any building in KSC, game did not respond).

Unfortunately, this makes my game nearly unplayable :(

I'll try to reproduce this and send you the logs (and maybe screenshots), and my list of other mods I'm using. I'm using quite a bunch of mods, maybe there's a conflict.

Regards,

Stage

Edited by Stage
Link to comment
Share on other sites

I'll try to reproduce this and send you the logs (and maybe screenshots), and my list of other mods I'm using. I'm using quite a bunch of mods, maybe there's a conflict.

If you see this again, please send me the logs (and screenshots/video would be helpful too if you can). That isn't a bug that I've seen before (myself or reported) but it sounds pretty bad :/

I'm sure this has been asked before but I don't see it mentioned on the main page: does this still work with the new MCE2?

It actually hasn't been asked until now. Looking through the OP of the new MCE I don't see anything that would cause an incompatibility. MCE is essentially like any other mod now so KCT doesn't have any special interactions with it like it did prior to 0.24. If you notice an incompatibility though, let me know.

Link to comment
Share on other sites

New update! Not as many features as I wanted to add (no launchpad reconditioning yet). Additionally, this update wasn't tested by my testers so there is a chance of bugs in the new features.

Major change to settings! A majority of the settings have been moved into the Game Settings tab. You will likely need to make changes to your settings if you weren't using the defaults. You can now set the defaults for these game specific settings in the new Defaults tab of the settings menu.

New feature: Simulations cost funds (can be disabled in the settings). The cost is dependent on a few things:

1. Distance of the body from Kerbin (compares Semi-Major axis of the parent orbits)

2. Presence of an atmosphere (atmospheres are hard to simulate for Kerbals. All those weird air particle interactions)

3. If the body is a moon (like Ike, or Gilly, or any of Jool's moons). Moons take the cost of their parent and then cost extra (atmosphere on the moon also comes into play, Laythe is very expensive)

4. The length of time multiplies the cost (based on a weird stepping that doesn't follow a formula, see list below)

Special cases:

Starting on Kerbin: 100x(Time Modifier)

Orbiting the sun: 10000x(Time Modifier)

Additional new feature: "Warp To" any ship or tech node completion. It will keep warping past anything that finishes before it unless the Force Stop Warp on Completion setting is enabled.

If you're using StageRecovery with KCT: Make sure to update StageRecovery as well! I made major changes to the API which KCT uses.

New feature if using StageRecovery: Parts on stages that are recovered with a velocity between the Variable Recovery Rate's lower and upper velocity cutoffs have a chance of being damaged beyond repair and will not be added to the part inventory (funds will still be recovered)! Currently there isn't a nice little notification alerting you to this, but I plan on adding one. It is mentioned in the Alt-F2 log if a part is not kept. This is the first major new feature implementation with StageRecovery!

Specifics of the simulation costs:

The cost formula has a couple steps but it is basically this:

Parent cost: (ratio of kerbin orbit to planet orbit)^2 x 1000 x (1.25 if atmosphere)

-moon: planet cost x 1.25 x (1.5 if atmosphere)

time multipliers:

hours; multiplier; note

.25; x1; 15 minutes

.5; x1.5; 30 minutes

1; x2

2; x3

6; x4; 1 kerbin day

12; x5

24; x6; 1 earth day

48; x7

168; x8; 1 earth week

672; x9; 1 earth month

8760; x10; 1 earth year

43800; x11; 5 earth years

87600; x12; 10 earth years

unlimited; x13

Ok, now pretend this post isn't terribly formatted.

Edited by magico13
Link to comment
Share on other sites

It actually hasn't been asked until now. Looking through the OP of the new MCE I don't see anything that would cause an incompatibility. MCE is essentially like any other mod now so KCT doesn't have any special interactions with it like it did prior to 0.24. If you notice an incompatibility though, let me know.

Well specifically, MCE has it's own revert button vs KCTs simulation resets, and now that you've added a cost for sims, that may interact with MCEs own cost...

Link to comment
Share on other sites

Well specifically, MCE has it's own revert button vs KCTs simulation resets, and now that you've added a cost for sims, that may interact with MCEs own cost...

KCT doesn't care how you exit a simulation, so using MCE's revert button shouldn't break anything (though you may not have to pay anything). If using MCE's revert AND KCT's costly simulations then you may be charged for both. The solution there would just to not use MCE's revert or not use costs with KCT's simulations. It may cause some unexpected issues with funds, but it shouldn't totally break anything, and you should be able to get around any funds issues by not using one or the other (not MCE vs KCT, just the revert button vs simulation costs)

Link to comment
Share on other sites

Really liking the addition of cost to Simulations! Just adds that much more to the realism. One question/request: could you factor the cost of the vehicle into the equation? I like to think of it as extra costs for the Kerbal engineers to factor in all those extra "rocket-y complications" as they would put it.

Link to comment
Share on other sites

If you see this again, please send me the logs (and screenshots/video would be helpful too if you can). That isn't a bug that I've seen before (myself or reported) but it sounds pretty bad :/

An update on my problem: it does not seem to be caused by KCT (alone?), got it in a game without KCT too, but here a picture how it looks:

L74IafG.png

I don't know why this happens, but I can regain control by disabling the "Revert to launch" option via the debug menu. After that I get the "Return to VAB" option back.

As seen in the picture below, even with the locked up KSP menu I still can access your mod control panel:

DEIfAm7.png

What's also not possible is to revert to launch.

I don't know if this is somehow related to this problem, but I've some issues with simulations aswell:

The black background in the picture above should be the orbital map (just didn't render anymore, standard view was as usual).

If the "Revert to launch" button is available and works, and I use it (no matter if it's the stock one or yours), every flight I start will get revertet to that first one, no matter if it's a simulation or not. If I return to VAB, I get my launched rocket back.

This persists even if I overwrite the savegame and start a new one with the same name (got a "Revert to launch (-6d 5m) message on a day one save).

Here's the log of my last game (I've a ton of mods, I hope this will help): https://dl.dropboxusercontent.com/u/39184853/KSP.log

Regards,

Stage

Link to comment
Share on other sites

If it's happening without KCT then it's probably not directly KCT related, but I'll take a look anyway. Is there any way you can get me the output_log.txt file from the KSP_Data folder (or KSP_Data_x64 or similar if you're using 64 bit). Unfortunately the KSP.log file doesn't print stack traces so it's only mildly useful for debugging.

I'm not really sure where to begin with this, and without the stack traces all I can see is that errors occurred (a pretty good number of them) but I can't see what mod caused it or where it occurred within the mod. I know AGX reported errors itself pretty early in the flight scene, but they may not be related. Are all of the mods you're using updated for 024? I saw an error where a mod (don't know which one) was trying to access a CrewRoster but those don't exist in 0.24 (they're now KerbalRoster since Squad has added new types of Kerbals (i.e. tourists, unused as of this moment)).

Link to comment
Share on other sites

Here you go: https://dl.dropboxusercontent.com/u/39184853/output_log.txt

I was not able to capture the bug with the non-appearing buttons, but I had the ..."Revert to Simulation" bug in this one.

I guess that all my mods work with 0.24, but I'll recheck them (maybe there's something that does not like the 0.24.2 update).

Thank you for helping me!

Link to comment
Share on other sites

I would start by removing mods that may be causing issues. From looking at the log these are the ones that may have problems: KAS (lots of the same error being spammed), AlignedCurrencyIndicator (this one is getting upset about KCT changing funds levels so I would definitely try removing this one), AGX, Station Science, KCT. Additionally, I would try not starting a simulation by clicking on the Launchpad or Runway. It's not impossible that something is messed up with simulating that way, I need to go back and double check the latest update didn't cause problems with that.

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