allista / ConfigurableContainers

This is a plugin for KSP mod development.
MIT License
8 stars 7 forks source link

Resources are being doubled on active vessel when quicksaving and reverting flights on 1.8 #32

Closed aidygus closed 4 years ago

aidygus commented 4 years ago

I've noticed an issue where resources are being doubled on all tanks on the active vessel when quick saving games or reverting a flight to launch. I noticed the problem as I use KCT to reuse vessels such as shuttles and SSTOs and on the 4th flight the FPS would go into the yellow then on the 5th would crash KSP when launching craft due to each tank having sometimes hundreds of resources assigned per tank due to quicksaving during flight then being recovered and stored by KCT. My space station also started suffering from FPS drops as I quick save there a lot. Manually editing the .sfs file to remove the excess tanks returned FPS to normal but I now have to regularly prune the resources from the tanks to keep it up as I do save a lot at the station.

allista commented 4 years ago

Thanks for the report. This is a known issue which unfortunately was discussed only in private messages on the forum.

What we found out is that it's the bug in Remote Tech that causes the duplication, so there's nothing I can do.

Here's the issue in RT tracker that explains the problem: https://github.com/RemoteTechnologiesGroup/RemoteTech/issues/805

aidygus commented 4 years ago

That explains one of my polar satellites. It had 4096 defined resources across 3 tanks and added over 10 Mb to the save file size when I first started pruning. It's in a similar altitude to my space station so every time it loaded when in range the tanks were duplicating. I was wondering how it had so many as after launching it and collecting science I haven't flown it again. Lets hope RT fix the issue soon

KSP-TaxiService commented 4 years ago

Hi @allista,

Just to be sure I follow the reproduction steps correctly.

Reproduction steps:

  1. Launch a vessel with initial resource amounts
  2. Press F5 (Quicksave)
  3. Open the "Manage tanks" dialog to confirm the amounts are unchanged (visual only)
  4. Press F9 (Quickload)
  5. Open the dialog again to observe the amounts are increased by 2 factors, like this picture below 2

It seems that this issue (doubling resource amounts and excessive save size) only happens when RemoteTech and Configurable Containers are installed together. Is it correct?

Thanks.

allista commented 4 years ago

@KSP-TaxiService correct; except that not the amount of resources increases, but the tanks themselves are duplicated.

KSP-TaxiService commented 4 years ago

Hi @allista,

I eliminated the relevant codes and verified that it does not generate duplicate configuration values in my tests. Kindly assist to verify the fixed DLL at your side. RemoteTech_DLL.zip

I believe this issue was causing the few other issues I encountered outside "Configurable Containers" mod.

Thanks.

allista commented 4 years ago

@KSP-TaxiService thanks! The dll you provided does fix the problem with CC tanks.

allista commented 4 years ago

Closing, as it is fixed on the RT side: https://github.com/RemoteTechnologiesGroup/RemoteTech/commit/5956a6beaed98a89107436bdd89e970f63874f53