Jump to content

Terlisimo

Members
  • Posts

    1
  • Joined

  • Last visited

Reputation

0 Neutral
  1. Hi! There is a small problem with KAS 0.6.4 and how it affects the resource consumption/generation on unloaded vessels. I am trying to fix it or work around it. The problem is this: - I have pieced together a surface mining vessel out of 3 smaller vessels. Main part has ore tanks, an ISRU, and generates electric charge. Second part is a big Lf+Ox tank. The third one is just 8 mining drills and a small fuel tank that holds them together. The main part has winches that plug into the CC-R2 ports on the other two. - the problem happens when I turn on the Lf+Ox ISRU, the ore drill, and then leave the scene. Come back 5 days later, and the resources will have gone up as if only 1-2 hours have passed. Some remarks on the problem: - both winches and link connections are affected - same thing happens with resource types other than Lf/Ox, like printing rocket parts and building vessels with EPL. If I want to generate resources efficiently, I need to either babysit the vessel and do the time warp with the vessel loaded, or switch back to the vessel every 2 hours so it replugs and reactivates mining - same thing happens even if the winches were connected/docked in the VAB and never disconnected into separate vessels since launch. - none of this happens if the vessel is built in one piece. Also does not seem to happen if the vessel is connected with stock docking ports instead of KAS. This is my speculation on what is happening, please confirm or correct my assumptions: - the resource consumption/generation is handled by the KSP stock game logic and does not actually work in the background for unloaded vessels. The game probably just reads the values it had when the vessel was unloaded, and how much you are using/generating per second. It extrapolates new values from the elapsed time and resource generation/usage rate. - when a scene loads, it loads with KAS-joined parts loaded as separate vessels and undocked - KAS somehow keeps track of these separate vessels and knows they are connected with links or winches. It assembles/docks them into one vessel only after the physics start to kick in. This takes 2-3 seconds. - because of this, the game calculates resource usage for each of 3 sub-vessels separately - when this happens, the ore drill is disconnected from the ore tank and the power source. The game decides that no ore was mined because the drills ran out of power immediately after I unloaded the vessel (since the drill part has zero charge capacity). The ISRU will only convert as much ore as it had in the ore tank. Different ideas for possible solutions: - make the game delay resource recalculation until after KAS completes reassembly - have KAS force a new game-native resource recalculation after the craft is reassembled - have KAS take over and do its own resource recalculation. Complicated, but could work if the first two methods fail. - make KAS connect parts like the stock docking port does. Not sure if this is feasible or even possible. Could be a few lines of code, could also be a major refactoring. I realize that making major changes to an old version of the plugin is probably not among the top priorities for the mainainter, so I am keen on trying to fix this myself I have some .NET and Unity programming experience but I'm fairly new to KSP plugin development so my domain knowledge here is pretty weak. If anyone has any pointers/suggestions, they will be appreciated Like how is KAS docking different from regular stock port docking? BTW I'm using KAS=0.6.4 on KSP=1.3.1. I did not test how KAS=1.0+ behaves but I will soon. Thanks!
×
×
  • Create New...