Jump to content

[1.4.3 <= KSP <= 1.12.5] KSP Recall - 0.4.1.0- 2024-0407


Lisias

Recommended Posts

18 minutes ago, starfall22 said:

umm, question. The zip file contains communityresroucepack, communitytechtree, interstellarfuelswitch, modulemanagerwatchdog, patchmanager, tweakscale, 666_modulemanagerwatchdog.dll, 999_scale_redist.dll and modulemanager.4.1.4.dll
I have yet to install anything manually, do i just copy the interstellarfuelswitch folder or everything in the zip and overwrite?

Just he IFS one. And, later, the WarpPlugin. Leave everything else as is - or it may make things harder to diagnose later (too much changes at the same time makes things complicated to check)

Link to comment
Share on other sites

14 minutes ago, Lisias said:

Just he IFS one. And, later, the WarpPlugin. Leave everything else as is - or it may make things harder to diagnose later (too much changes at the same time makes things complicated to check)

uff... could have mentioned that 2 minutes ago... i already reinstalled the WarpPlugin and the rest, i only made a log with IFS before, now im launching with, well, everything. Also, id like to note, those downloads contained some folders that were not present in my gamedata... to be on the safe side, i included those. Since they are packaged together, i assumed they might be a dependancy and... maybe ckan is to blame for not installing those. Then again, i am a newbie so i dont know. Hope this wont make things go bonkers.
Edit: Also, how does the log work? Does it flush the log on every launch or? Since i had to restart the last launch because partvolume detected new parts and needed to restart the game to include those. Also, i didnt exactly install everything yet. The turism contracts or what it was, is still out of the folder.
Edit again: Also, do i allow MiniAVC to allow the addons to check for updates? apparently it is asking my permission for that.
More edits: The game is also now telling me to use earlier KSP version cause lots of the mods dont support 1.12.5, i suspect i can ignore that, mostly... for now.

Edited by starfall22
Link to comment
Share on other sites

18 minutes ago, Lisias said:

Just he IFS one. And, later, the WarpPlugin. Leave everything else as is - or it may make things harder to diagnose later (too much changes at the same time makes things complicated to check)

Anywho, here is the interstellar install run log https://drive.google.com/file/d/1g6Km2V1l-CNUQM4LbJcgeFOwXjqrFx3a/view?usp=sharing
and here is the one after warp and interstellar extended https://drive.google.com/file/d/1HaJeorK6zy_T334oPfcetH5M_FRgIeNU/view?usp=sharing

Link to comment
Share on other sites

10 minutes ago, starfall22 said:

uff... could have mentioned that 2 minutes ago... i already reinstalled the WarpPlugin and the rest, i only made a log with IFS before, now im launching with, well, everything. Also, id like to note, those downloads contained some folders that were not present in my gamedata... to be on the safe side, i included those. Since they are packaged together, i assumed they might be a dependancy and... maybe ckan is to blame for not installing those. Then again, i am a newbie so i dont know. Hope this wont make things go bonkers.
Edit: Also, how does the log work? Does it flush the log on every launch or? Since i had to restart the last launch because partvolume detected new parts and needed to restart the game to include those. Also, i didnt exactly install everything yet. The turism contracts or what it was, is still out of the folder.
Edit again: Also, do i allow MiniAVC to allow the addons to check for updates? apparently it is asking my permission for that.
More edits: The game is also now telling me to use earlier KSP version cause lots of the mods dont support 1.12.5, i suspect i can ignore that, mostly... for now.

Oh, well… :)

Anyway, if it works, then it works. Freeze everything and keep playing! :D

About your questions:

  • KSP.log is squashed every time you restart KSP. So you need to make copies before launching it again if you need a historic.
    • Also, the KSP.log is buffered to preventing writing to it to impact the game's performance - so it's usually better to quit KSP before the log, or you may get it truncated.
    • Usually, just quitting to the Main Menu is enough after playing a savegame - but if you didn't loaded a savegame and need the KSP.log, then quitting the game is the safest option.
  • Nope. You need to remove all MiniAVC.dll you find in your system - every single one of them.
    • ZeroMiniAVC is a tool that can help you on this, but you will need to restart KSP every time it kicks
    • And it have it's quirks too, so usually you will want to remove it after doing it's job, and then reinstalling if a MiniAVC popup kicks again.

 

3 minutes ago, starfall22 said:

Anywho, here is the interstellar install run log https://drive.google.com/file/d/1g6Km2V1l-CNUQM4LbJcgeFOwXjqrFx3a/view?usp=sharing
and here is the one after warp and interstellar extended https://drive.google.com/file/d/1HaJeorK6zy_T334oPfcetH5M_FRgIeNU/view?usp=sharing

The IFS one is clean, but the Warp+ISE one gave us this:

[LOG 08:21:34.966] [CompatibilityChecker] Running checker version 5 from 'MechJeb2'
[EXC 08:21:34.968] MissingMethodException: bool ModuleManagerWatchDog.SanityLib.IsEnforceable(int,int)
        UnityEngine.DebugLogHandler:LogException(Exception, Object)
        ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
        UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)
[EXC 08:21:34.968] MissingMethodException: bool ModuleManagerWatchDog.SanityLib.IsEnforceable(int,int)
        UnityEngine.DebugLogHandler:LogException(Exception, Object)
        ModuleManager.UnityLogHandle.InterceptLogHandler:LogException(Exception, Object)
        UnityEngine.Debug:CallOverridenDebugHandler(Exception, Object)

You had MechJeb installed on the previous KSP.log, so this is something new and was induced by something you just installed on the rig. :/

Well… This is what I was fearing. :D

First, install ZeroMiniAVC - it's possible that this is the reason MJ2 borked - some versions of it are known to trigger some very weird bugs inside KSP.

Once ZeroMiniAVC removes all the MiniAVC.dll from the rig, relaunch KSP and send me a new KSP.log so I can see if MJ2 is still borking!

 

Link to comment
Share on other sites

4 minutes ago, Lisias said:

Oh, well… :)

Anyway, if it works, then it works. Freeze everything and keep playing! :D

About your questions:

  • KSP.log is squashed every time you restart KSP. So you need to make copies before launching it again if you need a historic.
    • Also, the KSP.log is buffered to preventing writing to it to impact the game's performance - so it's usually better to quit KSP before the log, or you may get it truncated.
    • Usually, just quitting to the Main Menu is enough after playing a savegame - but if you didn't loaded a savegame and need the KSP.log, then quitting the game is the safest option.
  • Nope. You need to remove all MiniAVC.dll you find in your system - every single one of them.
    • ZeroMiniAVC is a tool that can help you on this, but you will need to restart KSP every time it kicks
    • And it have it's quirks too, so usually you will want to remove it after doing it's job, and then reinstalling if a MiniAVC popup kicks again.

 

Gotchya, got the zerominiAVC, so it will fire on next launch. As for my game, shall i add the tourism expanded back or? Does everything look adequate or do we need to do something else?

Link to comment
Share on other sites

21 minutes ago, starfall22 said:

Gotchya, got the zerominiAVC, so it will fire on next launch. As for my game, shall i add the tourism expanded back or? Does everything look adequate or do we need to do something else?

As long you have a stable KSP rig that makes you happy, backup everything.

Then install the things you wanna try one by one. If anything go south, rollback. 

Rinse. Repeat. :)

The most important thing to remember is to backup things before trying something new. Just ZIP the kraken damned whole KSP folder (why not?) and copy that huge basket of bytes to another disk for safe keeping.

About Tourism Expanded, I can't say for sure - did you remember doing any missions that you now were generated by it? I think it will not hurt installing it, because the Exception I detected from it appears to be harmless - but, as I said, better safe than sorry: backup everything and try it! :)

Let me know if you need further assistance - I'm calling a day, however, I need to get some sleep around here. I will check this once I'm awaken!

Cheers!

Link to comment
Share on other sites

Just now, Lisias said:

As long you have a stable KSP rig that makes you happy, backup everything.

Then install the things you wanna try one by one. If anything go south, rollback. 

Rinse. Repeat. :)

The most important thing to remember is to backup things before trying something new. Just ZIP the kraken damned whole KSP folder (why not?) and copy that huge basket of bytes to another disk for safe keeping.

About Tourism Expanded, I can't say for sure - did you remember doing any missions that you now were generated by it? I think it will not hurt installing it, because the Exception I detected from it appears to be harmless - but, as I said, better safe than sorry: backup everything and try it! :)

Let me know if you need further assistance - I'm calling a day, however, I need to get some sleep around here. I will check this once I'm awaken!

Cheers!

Will do. thanks for everything. I will take a sleep too. Ive been at it for 9 hours now :D

Link to comment
Share on other sites

  • 2 weeks later...

Moved from TweakScale thread:

10 hours ago, GoAHead said:

hi @Lisias and here i am again :-) certainly with some things going  bad.
but this time i already made a clean  basicinstallation to reproduce

it is about KSPIE and at least one KSPIE-reactor which ends up with negative refunds on recovery but only as soon it is scaled down (didn't try up).

what happened on my original install was after i recovered my vessel i had 0.000 money left. i found out a negative refund of a part with ~  -36,000,000 was the cause. I now had to declare bankruptcy and a lot of kerbals lost their jobs

How to reproduce:

  • open SPH
  • Load the Vessel "rbug"
  • Proceed to runway
  • recover

results in negative refunds

all logs data,ckan-file,craft  and images can be found here => https://1drv.ms/u/s!Am0PDmGqv17_iroEwGwOHWpKz7xcAw?e=6tgnlx

So, this is what I did:

On a "standard" KSP 1.12.5 test bed with the following preinstalled addons, all at the latest versions at this time

  1. KSPe
  2. KSP-Recall
  3. DistantObject (I forgot to remove it)
  4. ModuleManager/L
  5. Module Manager Watch Dog
  6. TweakScale
  7. TweakScale Companion the ÜberPaket

I downloaded the latest KSPIE from SpaceDock (1.29.6) and installed it on that rig (without overwriting anything that was already there). I forgot to remove all MiniAVC DLLs, but whatever - most people also does it so perhaps this was for the best.

I loaded your "bug" savegame and checked for the problem you reported.

And got busted, as the part Interstellar-Technologies-ICFSC-Reactor was not found on the GameDataKrap, booting KSP 1.12.5 is pain where the sun doesn't shine on this machine. So I tried to salvage the situation using another reactor, the Antimater Initiated Micro Fusion Reactor, scaling it up to 7.5M and launched it at a cost of 3,689,359 :funds:. I confirmed the Funds were deducted from the KSC's account, then I recovered it. And the money were refunded as expected.

So everything is working fine on a "Stock" (or nearly) installation, and so we have something else screwing you on your rig.

Now that I know where the problem is not, I will start to update things on this rig to match yours and find who is stealing money from your Agency. I'm working on it.

Link to comment
Share on other sites

42 minutes ago, Lisias said:

Moved from TweakScale thread:

So, this is what I did:

On a "standard" KSP 1.12.5 test bed with the following preinstalled addons, all at the latest versions at this time

  1. KSPe
  2. KSP-Recall
  3. DistantObject (I forgot to remove it)
  4. ModuleManager/L
  5. Module Manager Watch Dog
  6. TweakScale
  7. TweakScale Companion the ÜberPaket

I downloaded the latest KSPIE from SpaceDock (1.29.6) and installed it on that rig (without overwriting anything that was already there). I forgot to remove all MiniAVC DLLs, but whatever - most people also does it so perhaps this was for the best.

I loaded your "bug" savegame and checked for the problem you reported.

And got busted, as the part Interstellar-Technologies-ICFSC-Reactor was not found on the GameDataKrap, booting KSP 1.12.5 is pain where the sun doesn't shine on this machine. So I tried to salvage the situation using another reactor, the Antimater Initiated Micro Fusion Reactor, scaling it up to 7.5M and launched it at a cost of 3,689,359 :funds:. I confirmed the Funds were deducted from the KSC's account, then I recovered it. And the money were refunded as expected.

So everything is working fine on a "Stock" (or nearly) installation, and so we have something else screwing you on your rig.

Now that I know where the problem is not, I will start to update things on this rig to match yours and find who is stealing money from your Agency. I'm working on it.

hi, you need interstellar technologies. the reaktor is part of it and extends the KSPIE part list. that was the reason i also providesd the ckan mod file :-)

 

Link to comment
Share on other sites

On 2/19/2023 at 7:10 PM, GoAHead said:

hi, you need interstellar technologies. the reaktor is part of it and extends the KSPIE part list. that was the reason i also providesd the ckan mod file :-)

I know. But I need to do the tests progressivelly, otherwise I would had a really harsh time diagnosing the problem.

For starters, I detected that Interstellar Technologies 0.4.1 (the latest available on SpaceDock), has some outdated add'ons compared with KSPIe latest (1.29.6 on SpaceDock). If you just unzipped IT0.4.1 over KSPIE1.29.6, you downgraded the following add'ons:

  • CommunityResourcePack
  • CommunityTechTree
  • InterstellarFuelSwitch
  • KerbalEngineer
  • WarpPlugin
  • Waterfall

What can be the source of your problems. Right now I'm firing up KSP 1.12.5 with KSPIE and IT installed in order to check your case. Outdated add'ons weren't installed, I'm using whatever KSPIE installed on my rig. I also didn't updated IFS to 3.30, as I have words that 3.30 somehow broke TS or something else that sou broke TS, and I will utilize this test session to check it too.

I will update this post as soon as I have some results.

— POST EDIT — 

Unsurprisingly, TweakScale wasn't able to check some parts due errors on them:

[LOG 02:53:19.454] [TweakScale] "TweakScale warning" about check failures was displayed
<...>
[LOG 02:53:19.225] [TweakScale] ERROR: part=Interstellar-Technologies.AMCatGasdynamicMirror (KSPIT KR-342 AM Cat. Gasdynamic Mirror Cell Fusion Drive) Exception on Sanity Checks: System.NullReferenceException: Object reference not set to an instance of an object
  at ConfigNode.CopyToRecursive (ConfigNode node, System.Boolean overwrite) [0x00000] in <106570632fc343a784fad39e75e877bf>:0 
  at ConfigNode.CopyToRecursive (ConfigNode node, System.Boolean overwrite) [0x0014a] in <106570632fc343a784fad39e75e877bf>:0 
  at ConfigNode.CopyToRecursive (ConfigNode node, System.Boolean overwrite) [0x0014a] in <106570632fc343a784fad39e75e877bf>:0 
  at ConfigNode.CreateCopy () [0x00006] in <106570632fc343a784fad39e75e877bf>:0 
  at GameDatabase.GetConfigNode (System.String url) [0x0002f] in <106570632fc343a784fad39e75e877bf>:0 
  at TweakScale.PrefabDryCostWriter.GetMeThatConfigNode (Part p) [0x0002a] in <62ab179107a144c5a3808f0cd36a9f76>:0 
  at TweakScale.PrefabDryCostWriter.checkForOverrules (Part p) [0x00000] in <62ab179107a144c5a3808f0cd36a9f76>:0 
  at TweakScale.PrefabDryCostWriter+<WriteDryCost>d__3.MoveNext () [0x00417] in <62ab179107a144c5a3808f0cd36a9f76>:0  at error:0
[LOG 02:53:19.227] [TweakScale] ERROR: part=Interstellar-Technologies.AM-Catalyzed-ICFE (KSPIT KR-250 Antimatter Catalyzed Inertial Confinement Fusion Drive) Exception on Sanity Checks: System.NullReferenceException: Object reference not set to an instance of an object
  at ConfigNode.CopyToRecursive (ConfigNode node, System.Boolean overwrite) [0x00000] in <106570632fc343a784fad39e75e877bf>:0 
  at ConfigNode.CopyToRecursive (ConfigNode node, System.Boolean overwrite) [0x0014a] in <106570632fc343a784fad39e75e877bf>:0 
  at ConfigNode.CopyToRecursive (ConfigNode node, System.Boolean overwrite) [0x0014a] in <106570632fc343a784fad39e75e877bf>:0 
  at ConfigNode.CreateCopy () [0x00006] in <106570632fc343a784fad39e75e877bf>:0 
  at GameDatabase.GetConfigNode (System.String url) [0x0002f] in <106570632fc343a784fad39e75e877bf>:0 
  at TweakScale.PrefabDryCostWriter.GetMeThatConfigNode (Part p) [0x0002a] in <62ab179107a144c5a3808f0cd36a9f76>:0 
  at TweakScale.PrefabDryCostWriter.checkForOverrules (Part p) [0x00000] in <62ab179107a144c5a3808f0cd36a9f76>:0 
  at TweakScale.PrefabDryCostWriter+<WriteDryCost>d__3.MoveNext () [0x00417] in <62ab179107a144c5a3808f0cd36a9f76>:0  at error:0
[LOG 02:53:19.229] [TweakScale] ERROR: part=Interstellar-Technologies.AM-Catalyzed-MIFE (KSPIT KR-129 Antimatter Catalyzed Magneto Inertial Fusion engine) Exception on Sanity Checks: System.NullReferenceException: Object reference not set to an instance of an object
  at ConfigNode.CopyToRecursive (ConfigNode node, System.Boolean overwrite) [0x00000] in <106570632fc343a784fad39e75e877bf>:0 
  at ConfigNode.CopyToRecursive (ConfigNode node, System.Boolean overwrite) [0x0014a] in <106570632fc343a784fad39e75e877bf>:0 
  at ConfigNode.CopyToRecursive (ConfigNode node, System.Boolean overwrite) [0x0014a] in <106570632fc343a784fad39e75e877bf>:0 
  at ConfigNode.CreateCopy () [0x00006] in <106570632fc343a784fad39e75e877bf>:0 
  at GameDatabase.GetConfigNode (System.String url) [0x0002f] in <106570632fc343a784fad39e75e877bf>:0 
  at TweakScale.PrefabDryCostWriter.GetMeThatConfigNode (Part p) [0x0002a] in <62ab179107a144c5a3808f0cd36a9f76>:0 
  at TweakScale.PrefabDryCostWriter.checkForOverrules (Part p) [0x00000] in <62ab179107a144c5a3808f0cd36a9f76>:0 
  at TweakScale.PrefabDryCostWriter+<WriteDryCost>d__3.MoveNext () [0x00417] in <62ab179107a144c5a3808f0cd36a9f76>:0  at error:0
[LOG 02:53:19.230] [TweakScale] ERROR: part=Interstellar-Technologies.AM-Catalyzed-ICFE-Afterburning (KSPIT KN-162 Afterburning AM Cat ICFE) Exception on Sanity Checks: System.NullReferenceException: Object reference not set to an instance of an object
  at ConfigNode.CopyToRecursive (ConfigNode node, System.Boolean overwrite) [0x00000] in <106570632fc343a784fad39e75e877bf>:0 
  at ConfigNode.CopyToRecursive (ConfigNode node, System.Boolean overwrite) [0x0014a] in <106570632fc343a784fad39e75e877bf>:0 
  at ConfigNode.CopyToRecursive (ConfigNode node, System.Boolean overwrite) [0x0014a] in <106570632fc343a784fad39e75e877bf>:0 
  at ConfigNode.CreateCopy () [0x00006] in <106570632fc343a784fad39e75e877bf>:0 
  at GameDatabase.GetConfigNode (System.String url) [0x0002f] in <106570632fc343a784fad39e75e877bf>:0 
  at TweakScale.PrefabDryCostWriter.GetMeThatConfigNode (Part p) [0x0002a] in <62ab179107a144c5a3808f0cd36a9f76>:0 
  at TweakScale.PrefabDryCostWriter.checkForOverrules (Part p) [0x00000] in <62ab179107a144c5a3808f0cd36a9f76>:0 
  at TweakScale.PrefabDryCostWriter+<WriteDryCost>d__3.MoveNext () [0x00417] in <62ab179107a144c5a3808f0cd36a9f76>:0  at error:0
[LOG 02:53:19.232] [TweakScale] ERROR: part=Interstellar-Technologies.AM-Fusion-Engine ("Compression" Antimatter Catalyzed Fusion Engine) Exception on Sanity Checks: System.NullReferenceException: Object reference not set to an instance of an object
  at ConfigNode.CopyToRecursive (ConfigNode node, System.Boolean overwrite) [0x00000] in <106570632fc343a784fad39e75e877bf>:0 
  at ConfigNode.CopyToRecursive (ConfigNode node, System.Boolean overwrite) [0x0014a] in <106570632fc343a784fad39e75e877bf>:0 
  at ConfigNode.CopyToRecursive (ConfigNode node, System.Boolean overwrite) [0x0014a] in <106570632fc343a784fad39e75e877bf>:0 
  at ConfigNode.CreateCopy () [0x00006] in <106570632fc343a784fad39e75e877bf>:0 
  at GameDatabase.GetConfigNode (System.String url) [0x0002f] in <106570632fc343a784fad39e75e877bf>:0 
  at TweakScale.PrefabDryCostWriter.GetMeThatConfigNode (Part p) [0x0002a] in <62ab179107a144c5a3808f0cd36a9f76>:0 
  at TweakScale.PrefabDryCostWriter.checkForOverrules (Part p) [0x00000] in <62ab179107a144c5a3808f0cd36a9f76>:0 
  at TweakScale.PrefabDryCostWriter+<WriteDryCost>d__3.MoveNext () [0x00417] in <62ab179107a144c5a3808f0cd36a9f76>:0  at error:0
[LOG 02:53:19.233] [TweakScale] ERROR: part=Interstellar-Technologies.Antiproton-Catalyzed-Microfission (KSPIT NK-52 Antiproton catalyzed microfission drive) Exception on Sanity Checks: System.NullReferenceException: Object reference not set to an instance of an object
  at ConfigNode.CopyToRecursive (ConfigNode node, System.Boolean overwrite) [0x00000] in <106570632fc343a784fad39e75e877bf>:0 
  at ConfigNode.CopyToRecursive (ConfigNode node, System.Boolean overwrite) [0x0014a] in <106570632fc343a784fad39e75e877bf>:0 
  at ConfigNode.CopyToRecursive (ConfigNode node, System.Boolean overwrite) [0x0014a] in <106570632fc343a784fad39e75e877bf>:0 
  at ConfigNode.CreateCopy () [0x00006] in <106570632fc343a784fad39e75e877bf>:0 
  at GameDatabase.GetConfigNode (System.String url) [0x0002f] in <106570632fc343a784fad39e75e877bf>:0 
  at TweakScale.PrefabDryCostWriter.GetMeThatConfigNode (Part p) [0x0002a] in <62ab179107a144c5a3808f0cd36a9f76>:0 
  at TweakScale.PrefabDryCostWriter.checkForOverrules (Part p) [0x00000] in <62ab179107a144c5a3808f0cd36a9f76>:0 
  at TweakScale.PrefabDryCostWriter+<WriteDryCost>d__3.MoveNext () [0x00417] in <62ab179107a144c5a3808f0cd36a9f76>:0  at error:0
[LOG 02:53:19.235] [TweakScale] ERROR: part=Interstellar-Technologies.BeamCoreFusion (KSPIT KR-523 Beam Core Fusion Drive) Exception on Sanity Checks: System.NullReferenceException: Object reference not set to an instance of an object
  at ConfigNode.CopyToRecursive (ConfigNode node, System.Boolean overwrite) [0x00000] in <106570632fc343a784fad39e75e877bf>:0 
  at ConfigNode.CopyToRecursive (ConfigNode node, System.Boolean overwrite) [0x0014a] in <106570632fc343a784fad39e75e877bf>:0 
  at ConfigNode.CopyToRecursive (ConfigNode node, System.Boolean overwrite) [0x0014a] in <106570632fc343a784fad39e75e877bf>:0 
  at ConfigNode.CreateCopy () [0x00006] in <106570632fc343a784fad39e75e877bf>:0 
  at GameDatabase.GetConfigNode (System.String url) [0x0002f] in <106570632fc343a784fad39e75e877bf>:0 
  at TweakScale.PrefabDryCostWriter.GetMeThatConfigNode (Part p) [0x0002a] in <62ab179107a144c5a3808f0cd36a9f76>:0 
  at TweakScale.PrefabDryCostWriter.checkForOverrules (Part p) [0x00000] in <62ab179107a144c5a3808f0cd36a9f76>:0 
  at TweakScale.PrefabDryCostWriter+<WriteDryCost>d__3.MoveNext () [0x00417] in <62ab179107a144c5a3808f0cd36a9f76>:0  at error:0
[LOG 02:53:19.237] [TweakScale] ERROR: part=Interstellar-Technologies.Daedalus-ICF (KSP-IT Daedalus Fusion Drive) Exception on Sanity Checks: System.NullReferenceException: Object reference not set to an instance of an object
  at ConfigNode.CopyToRecursive (ConfigNode node, System.Boolean overwrite) [0x00000] in <106570632fc343a784fad39e75e877bf>:0 
  at ConfigNode.CopyToRecursive (ConfigNode node, System.Boolean overwrite) [0x0014a] in <106570632fc343a784fad39e75e877bf>:0 
  at ConfigNode.CopyToRecursive (ConfigNode node, System.Boolean overwrite) [0x0014a] in <106570632fc343a784fad39e75e877bf>:0 
  at ConfigNode.CreateCopy () [0x00006] in <106570632fc343a784fad39e75e877bf>:0 
  at GameDatabase.GetConfigNode (System.String url) [0x0002f] in <106570632fc343a784fad39e75e877bf>:0 
  at TweakScale.PrefabDryCostWriter.GetMeThatConfigNode (Part p) [0x0002a] in <62ab179107a144c5a3808f0cd36a9f76>:0 
  at TweakScale.PrefabDryCostWriter.checkForOverrules (Part p) [0x00000] in <62ab179107a144c5a3808f0cd36a9f76>:0 
  at TweakScale.PrefabDryCostWriter+<WriteDryCost>d__3.MoveNext () [0x00417] in <62ab179107a144c5a3808f0cd36a9f76>:0  at error:0
[LOG 02:53:19.238] [TweakScale] ERROR: part=Interstellar-Technologies-Kugelblitz-Drive (IT-547 Kugelblitz Drive) Exception on Sanity Checks: System.NullReferenceException: Object reference not set to an instance of an object
  at ConfigNode.CopyToRecursive (ConfigNode node, System.Boolean overwrite) [0x00000] in <106570632fc343a784fad39e75e877bf>:0 
  at ConfigNode.CopyToRecursive (ConfigNode node, System.Boolean overwrite) [0x0014a] in <106570632fc343a784fad39e75e877bf>:0 
  at ConfigNode.CopyToRecursive (ConfigNode node, System.Boolean overwrite) [0x0014a] in <106570632fc343a784fad39e75e877bf>:0 
  at ConfigNode.CreateCopy () [0x00006] in <106570632fc343a784fad39e75e877bf>:0 
  at GameDatabase.GetConfigNode (System.String url) [0x0002f] in <106570632fc343a784fad39e75e877bf>:0 
  at TweakScale.PrefabDryCostWriter.GetMeThatConfigNode (Part p) [0x0002a] in <62ab179107a144c5a3808f0cd36a9f76>:0 
  at TweakScale.PrefabDryCostWriter.checkForOverrules (Part p) [0x00000] in <62ab179107a144c5a3808f0cd36a9f76>:0 
  at TweakScale.PrefabDryCostWriter+<WriteDryCost>d__3.MoveNext () [0x00417] in <62ab179107a144c5a3808f0cd36a9f76>:0  at error:0
[LOG 02:53:19.240] [TweakScale] ERROR: part=Interstellar-Technologies.Laser-Core-Antimatter ("Pion" Laser core Antimatter Engine) Exception on Sanity Checks: System.NullReferenceException: Object reference not set to an instance of an object
  at ConfigNode.CopyToRecursive (ConfigNode node, System.Boolean overwrite) [0x00000] in <106570632fc343a784fad39e75e877bf>:0 
  at ConfigNode.CopyToRecursive (ConfigNode node, System.Boolean overwrite) [0x0014a] in <106570632fc343a784fad39e75e877bf>:0 
  at ConfigNode.CopyToRecursive (ConfigNode node, System.Boolean overwrite) [0x0014a] in <106570632fc343a784fad39e75e877bf>:0 
  at ConfigNode.CreateCopy () [0x00006] in <106570632fc343a784fad39e75e877bf>:0 
  at GameDatabase.GetConfigNode (System.String url) [0x0002f] in <106570632fc343a784fad39e75e877bf>:0 
  at TweakScale.PrefabDryCostWriter.GetMeThatConfigNode (Part p) [0x0002a] in <62ab179107a144c5a3808f0cd36a9f76>:0 
  at TweakScale.PrefabDryCostWriter.checkForOverrules (Part p) [0x00000] in <62ab179107a144c5a3808f0cd36a9f76>:0 
  at TweakScale.PrefabDryCostWriter+<WriteDryCost>d__3.MoveNext () [0x00417] in <62ab179107a144c5a3808f0cd36a9f76>:0  at error:0
[LOG 02:53:19.241] [TweakScale] ERROR: part=Interstellar-Technologies.Multi-Mode-Fusion-Engine ("Pressure" Multi-Mode Fusion Engine) Exception on Sanity Checks: System.NullReferenceException: Object reference not set to an instance of an object
  at ConfigNode.CopyToRecursive (ConfigNode node, System.Boolean overwrite) [0x00000] in <106570632fc343a784fad39e75e877bf>:0 
  at ConfigNode.CopyToRecursive (ConfigNode node, System.Boolean overwrite) [0x0014a] in <106570632fc343a784fad39e75e877bf>:0 
  at ConfigNode.CopyToRecursive (ConfigNode node, System.Boolean overwrite) [0x0014a] in <106570632fc343a784fad39e75e877bf>:0 
  at ConfigNode.CreateCopy () [0x00006] in <106570632fc343a784fad39e75e877bf>:0 
  at GameDatabase.GetConfigNode (System.String url) [0x0002f] in <106570632fc343a784fad39e75e877bf>:0 
  at TweakScale.PrefabDryCostWriter.GetMeThatConfigNode (Part p) [0x0002a] in <62ab179107a144c5a3808f0cd36a9f76>:0 
  at TweakScale.PrefabDryCostWriter.checkForOverrules (Part p) [0x00000] in <62ab179107a144c5a3808f0cd36a9f76>:0 
  at TweakScale.PrefabDryCostWriter+<WriteDryCost>d__3.MoveNext () [0x00417] in <62ab179107a144c5a3808f0cd36a9f76>:0  at error:0
[LOG 02:53:19.243] [TweakScale] ERROR: part=Interstellar-Technologies.Muon-Cat-Large (KSPIT MN-620 Muon Catalyzed Fusion Drive) Exception on Sanity Checks: System.NullReferenceException: Object reference not set to an instance of an object
  at ConfigNode.CopyToRecursive (ConfigNode node, System.Boolean overwrite) [0x00000] in <106570632fc343a784fad39e75e877bf>:0 
  at ConfigNode.CopyToRecursive (ConfigNode node, System.Boolean overwrite) [0x0014a] in <106570632fc343a784fad39e75e877bf>:0 
  at ConfigNode.CopyToRecursive (ConfigNode node, System.Boolean overwrite) [0x0014a] in <106570632fc343a784fad39e75e877bf>:0 
  at ConfigNode.CreateCopy () [0x00006] in <106570632fc343a784fad39e75e877bf>:0 
  at GameDatabase.GetConfigNode (System.String url) [0x0002f] in <106570632fc343a784fad39e75e877bf>:0 
  at TweakScale.PrefabDryCostWriter.GetMeThatConfigNode (Part p) [0x0002a] in <62ab179107a144c5a3808f0cd36a9f76>:0 
  at TweakScale.PrefabDryCostWriter.checkForOverrules (Part p) [0x00000] in <62ab179107a144c5a3808f0cd36a9f76>:0 
  at TweakScale.PrefabDryCostWriter+<WriteDryCost>d__3.MoveNext () [0x00417] in <62ab179107a144c5a3808f0cd36a9f76>:0  at error:0
[LOG 02:53:19.245] [TweakScale] ERROR: part=Interstellar-Technologies.Muon-Catalyzed-Fusion-Drive (KSP-IT KN-142 "Flare" Muon Catalyzed Fusion engine) Exception on Sanity Checks: System.NullReferenceException: Object reference not set to an instance of an object
  at ConfigNode.CopyToRecursive (ConfigNode node, System.Boolean overwrite) [0x00000] in <106570632fc343a784fad39e75e877bf>:0 
  at ConfigNode.CopyToRecursive (ConfigNode node, System.Boolean overwrite) [0x0014a] in <106570632fc343a784fad39e75e877bf>:0 
  at ConfigNode.CopyToRecursive (ConfigNode node, System.Boolean overwrite) [0x0014a] in <106570632fc343a784fad39e75e877bf>:0 
  at ConfigNode.CreateCopy () [0x00006] in <106570632fc343a784fad39e75e877bf>:0 
  at GameDatabase.GetConfigNode (System.String url) [0x0002f] in <106570632fc343a784fad39e75e877bf>:0 
  at TweakScale.PrefabDryCostWriter.GetMeThatConfigNode (Part p) [0x0002a] in <62ab179107a144c5a3808f0cd36a9f76>:0 
  at TweakScale.PrefabDryCostWriter.checkForOverrules (Part p) [0x00000] in <62ab179107a144c5a3808f0cd36a9f76>:0 
  at TweakScale.PrefabDryCostWriter+<WriteDryCost>d__3.MoveNext () [0x00417] in <62ab179107a144c5a3808f0cd36a9f76>:0  at error:0
[LOG 02:53:19.246] [TweakScale] ERROR: part=Interstellar-Technologies.Multi-Mode-SSTO-Engine ("Hybrid" Multi-Mode SSTO Fusion Engine) Exception on Sanity Checks: System.NullReferenceException: Object reference not set to an instance of an object
  at ConfigNode.CopyToRecursive (ConfigNode node, System.Boolean overwrite) [0x00000] in <106570632fc343a784fad39e75e877bf>:0 
  at ConfigNode.CopyToRecursive (ConfigNode node, System.Boolean overwrite) [0x0014a] in <106570632fc343a784fad39e75e877bf>:0 
  at ConfigNode.CopyToRecursive (ConfigNode node, System.Boolean overwrite) [0x0014a] in <106570632fc343a784fad39e75e877bf>:0 
  at ConfigNode.CreateCopy () [0x00006] in <106570632fc343a784fad39e75e877bf>:0 
  at GameDatabase.GetConfigNode (System.String url) [0x0002f] in <106570632fc343a784fad39e75e877bf>:0 
  at TweakScale.PrefabDryCostWriter.GetMeThatConfigNode (Part p) [0x0002a] in <62ab179107a144c5a3808f0cd36a9f76>:0 
  at TweakScale.PrefabDryCostWriter.checkForOverrules (Part p) [0x00000] in <62ab179107a144c5a3808f0cd36a9f76>:0 
  at TweakScale.PrefabDryCostWriter+<WriteDryCost>d__3.MoveNext () [0x00417] in <62ab179107a144c5a3808f0cd36a9f76>:0  at error:0

These parts will probably cause some problems to you, but the "Interstellar-Technologies-ICFSC-Reactor" the rbug.craft uses is not there, so you have yet another problem to cope with.

Anyway, I redid the test using the rbug.craft and, yes, I detected an underrefunding on it.

However, and we need to make things clear here, this is not a problem on TweakScale neither with KSP-Recall. This is something on the Interstellar Techonologies - these parts have the problem. TS and Recall are working fine with everything else.

I'm now checking what's wrong on these parts.

— — POST POST EDIT — — 

To avoid losing time, I redid the test using the "Antimater Initiated Micro Fusion Reactor" on the same savegame where the Interstellar-Technologies-ICFSC-Reactor part is borking. I need to know if this is something confined into IT parts only or if it infected everything else. 

Well, the KSPIE parts are still being refunded without problems.

This settle the matter, whatever is wrong, is affecting IT parts only.

— — POST POST POST EDIT — —

Interesting. Apparently, something is messing up the chain of events that ends up calling the `Refunding`'s `IPastCostModifier` interface. The best way to check for it is to remove `Refunding` and see what happens.

So I applied this patch:

@PART[Interstellar-Technologies-ICFSC-Reactor]:FINAL
{
	!MODULE[Refunding] { }
}

to remove `Refunding` from the part to see what happens - and, as expected, I started to get mis-refunded (the problem `Refunding` was intended to fix at first place).

Digging around the config cache and the craft files, I realised that the affected part has Refunding installed before TweakScale, where the funcional parts have it after TweakScale. I really don't remember if this can do a difference or not (I have some faint remembrance of being worried about this issue, but really don't really remember now), so I injected back the thing on the same patch so it would shove `Refunding` later on the patching process:

@PART[Interstellar-Technologies-ICFSC-Reactor]:FINAL
{
        !MODULE[Refunding] { }
}
@PART[Interstellar-Technologies-ICFSC-Reactor]:FINAL
{
        %MODULE[Refunding]
        {
                active = True
        }
}

And this patch gave me the intended result on the ConfigCache, the `Refunding` module is now after TweakScale's. But it didin't solved the problem, so the order of the `Refunding` module is not an issue. (need to take note of that somewhere).

At the present time, I don't have an explanation for only the IT parts being affected by the problem.

The only thing I can say for sure is that neither TweakScale neither KSP-Recall are the culprits for the problem. They are involved on it, for sure, but they are not causing it.

Wondering what to do next.

— POST POST POST POST EDIT — 

Updating IFS to 3.30 didn't changed anything. No new problems, no change on the current ones. I don't understand why rolling back IFS solved anything for another user.

More interesting yet, I reinstalled everything from scratch, starting with KSPIE and then I just shoved the InterstellarTechnologies directory into the GameData, completely ignoring anything else from the IT's zip package. The problem happens the same...

So whatever is happening on the IT parts, is something being triggered on the Config, as everything else is the same for KSPIE parts - that are working as expected.

Oh, dear… I'm going to debug parts now.

— POST POST POST POST POST EDIT — 

So… It's Part Config debugging time.

Since it was already stablished that this is not being caused (directly) by a PartModule (being it TS, Recall, or whatever), it's something on the ICFSCReactor.cfg file.

In order to simplify the number of variables on this equation, I removed a lot of things from the test bed, leaving installed only:

  • 000_FilterExtensions
  • 000_FilterExtensions_Configs
  • 000_KSPe
  • CommunityResourcePack
  • InterstellarFuelSwitch
  • Interstellar_Redist.dll
  • ModuleManager
  • ModuleManagerWatchDog
  • MyPatches.cfg
  • Squad
  • SquadExpansion
  • TweakScale
  • __LOCAL
    • A customized copy of the Interstellar-Technologies-ICFSC-Reactor part is here for debugging.
  • 000_KSPe.dll
  • 666_ModuleManagerWatchDog.dll
  • 999_KSP-Recall
  • 999_Scale_Redist.dll
  • ModuleManager.dll

Of course the part will be butchered on launch, as the following PartModules will not be there for it:

  • InertialConfinementReactor
  • IntegratedThermalElectricPowerGenerator
  • IntegratedRadiator

This will allow me to check if the problem still happens or not on this reduced setup and… Well, the problem didn't happened ANYMORE.

So the problem must be being triggered by one of the PartModules listed above. Working on it.

Edited by Lisias
post post post post edit
Link to comment
Share on other sites

Well.. So I removed the 

  • InterstellarFuelSwitch

and added back

  • WarpPlugin

IFS is not needed by this part (so it was ruled out of the problem anyway), and the WarpPlugin have the PartModules needed by the part. Unsurprisingly, the problem is back. So, yeah, we have our suspect, WarpPlugin - more specifically, one of above mentioned PartModule.

So I removed IntegratedThermalElectricPowerGenerator from the part and tried again to see what happens. Bull's eye! The problem is gone. So we found the culprit. But why this is affecting only IT? Follows the KSPIE parts also using it:

./WarpPlugin/Parts/BeamedPower/PhasedArray/phasedArray1/MunSeeker_ZZZ_RadioTelescope_Contracts.cfg
./WarpPlugin/Parts/BeamedPower/Thermal/OversizeFoldingDishAluminium/SIGINT.cfg
./WarpPlugin/Parts/BeamedPower/Thermal/OversizeFoldingDishAluminium/SIGINT_End.cfg
./WarpPlugin/Parts/BeamedPower/Thermal/OversizeFoldingDishGold/SIGINT.cfg
./WarpPlugin/Parts/BeamedPower/Thermal/OversizeFoldingDishGold/SIGINT_End.cfg
./WarpPlugin/Parts/BeamedPower/Thermal/OversizeFoldingDishGold/SIGINTEnd.cfg
./WarpPlugin/Parts/BeamedPower/Thermal/SolarPowerMoltenSalt/SolarPower_MoltenSalt.cfg
./WarpPlugin/Parts/BeamedPower/Thermal/InlineThermalReceiverPanel/MW_TR_DI.cfg
./WarpPlugin/Parts/Electrical/AntimatterCore/WarpCoreUnit2.cfg
./WarpPlugin/Parts/Electrical/AntimatterCore/WarpCoreUnit.cfg
./WarpPlugin/Parts/Electrical/FissionReactor/fissionreactor.cfg
./WarpPlugin/Parts/Electrical/QuantumSingularityReactor2/QuantumSingulaityReactor.cfg
./WarpPlugin/Parts/Electrical/IXSMainHull/IXSMainHull.cfg
./WarpPlugin/Parts/Electrical/MuonCatFusionReactor2/StnSciSpectro.cfg
./WarpPlugin/Parts/Engines/SURGE/OPT_SURGE.cfg

So, why nobody complained about this problem before? Logic suggests that these parts are also affected. So I reinstalled things back and tried one of these parts too.

I randomly choose "Antimatter Catalyzed Fusion Reactor", the kspiWarpCoreUnit2 on WarpCoreUnit2.cfg. I took the very same rbug.craft file, and replaced the Interstellar-Technologies-ICFSC-Reactor with the kspiWarpCoreUnit2 and then scaled it up to 5M. No problem detected, the refunding happened exactly as expected.

@GoAHead, this settles the matter: Interstellar Technologies appears to be at fault here. The very same PartModule that is triggering the problem on IT parts works fine on KSPIE ones. There's something missing on their parts, perhaps? Or perhaps they are using something that is broken on the IntegratedThermalElectricPowerGenerator PartModule and by plain luck (or knowledge) it's not used on KSPIE.

In a way or another, I suggest you reach the IT guys and talk about the problem.  I can't further help on this by myself.

Good luck!

Edited by Lisias
Hit Save too soon.
Link to comment
Share on other sites

Moving back from the KSPIE thread.

— — — 

50 minutes ago, GoAHead said:

finally i found parts originating from KSPI-E which  also has refund issues

IXSMainHullReactor and MuonCatFusionReactor2

they both use the module  "InertialConfinementReactor"  same as the IT part Interstellar-Technologies-ICFSC-Reactor

maybe this helps. i have no clue..:lol:

@Lisias jfyi

the "IXSMainHullReactor" worked fine (or almost) on my rig, the refunding were happening almost perfectly. I'm recovering almost all the 44.5M Funds, with an error of less than 1K Funds (I started with 45.000K and ended with 44.999K). The problem appears to be related to the huge amounts of Funds involved, I think we may be handling a float rounding error on this one.

In time, it's the reason using floats on currency in Real Life™.

I also tried the "MuonCatFusionReactor2", but scaling it down to the 1.25M of the Command Pod Mk1. Interestingly, I got the same problem on this one - I started with 100.000F and ended up with 99.999F - an 1F error.

@GoAHead I think this is not a "problem" neither on KSPIE, IT or even Recall - this appears to be related to using floats for currency calculations!

I can mitigate a bit the problem on Recall (by using decimals while handling currency), but I can fix it 100% because KSP itself uses floats, so this is beyound my reach: I can't fix it, all I can do is to minimize my role on the problem.

I'm working on it.

My apologies to FreeThinker by polluting his thread, I genuinely though this was a IT problem. @GoAHead, lets keep this on the Recall thread, please!

Link to comment
Share on other sites

ANNOUNCE

KSP Recall 0.3.0.11 on the Wild, featuring:

  • Rework Refunding to use decimal when handling currency to minimize losses due inaccuracies related to float point math.
    • Kudos to GoAhead for the heads up! 
  • Closes issue:
    • #60 Weird Misbehaviour on Interstellar Technologies

This releases mitigates (besides not solving) a problem related to KSP using floating point math when handling currency, reported by the Fellow Kerbonaut @GoAHead(thanks a lot, dude!). The problem happens because floating point math induces inaccuracies when numbers are big (or small) enough and the whole number can't be stored into the Mantissa anymore.

Refunding, the component working around a bug on KSP while recovering crafts, was updated to use decimal instead of doubles while handling currency, eliminating such problems internally. This makes things better (or less worse), but doesn't completely solve the problem as the IPartCostModifier, the interface used by KSP to ask the PartModule for its cost, is still using float - so, in the end, really big or really small values are still going to get screwed. But at least I could remove some inaccuracy, as they are not being pilled up inside Refunding anymore.

— — — — — 


This Release will be published using the following Schedule:

  • GitHub, reaching manual installers and users of KSP-AVC first. Right Now.
  • CurseForge. Will not be published due a new release.
  • SpaceDock (and CKAN users). Will not be published due a new release.

I would like some early adopters to install this thing and use for some time to be sure the stunt I pulled while persisting the current PartModule cost on the Config File will really work in all the use cases.

Edited by Lisias
Aborting the scheduled updates.
Link to comment
Share on other sites

hi @Lisias

hi. i already installed your fix

then i loaded my save where my craft  was already landed and awaiting recovery.

after recovery it substracted over 330 millions of credits. (i guess quite the same amount as before the fix)

does this fix only work on new deployed craft?

y4mch-qdNFVxmxjqt2gq4w4XIL7bhzNuFUDB_w3K

 

so i deployed a new craft

my starting funds where (thx @cheatmenue) 12.000.000

deployed the craft and recovered it

y4m19lbHWrcEobvvEFjjX4UIL4L818d4zjjJp0RE

so in this case 12.000.000 -9.925.530 = 2.074.470 to less :-(

there seems still something fishy

 

running out of ideas so my fix will be not scale those parts at all or don't use it on recoverable crafts like sstos

Edited by GoAHead
Add info about new deployed craft
Link to comment
Share on other sites

1 hour ago, GoAHead said:

then i loaded my save where my craft  was already landed and awaiting recovery.

after recovery it substracted over 330 millions of credits. (i guess quite the same amount as before the fix)

<…>

so in this case 12.000.000 -9.925.530 = 2.074.470 to less :-(

there seems still something fishy

The Refunding stunt is, well, a bit fishy by itself. I'm (ab)using the resources to counter-screw the KSP's failure on correctly calling the iPartCostModifier interface of the PartModules on recovery - at the same time preventing screwing up with other code that is doing it, so when the Refunding resource is active, the PartModule's IPartCostModifier returns the negative value of it to prevent 3rd parties from being fooled about the cost of the craft. I'm, literally, leveraging the KSP's bug against itself.

And over it, yes, we have this float on currency happening. What I can say for sure is that, now, Refunding is definitively out of the loop of the troublemakers. The only enemy left is the unhappy use of floats when handling IPartCostModifier.

What doesn't means I can't try to do something else - but I need to do it carefully, because I may inject undesired side-effects on 3rds parties as it happened with MAS. I'm over my toes now.

Well, back to the designing table. Please send me your craft file (you can zip it and drag'n'drop it on a post on the github issue, if you have a github account: https://github.com/net-lisias-ksp/KSP-Recall/issues/60 ) so I have something concrete to work with.

I have some new crazy ideas… But I need to figure out what of them are just plain stupid.

Link to comment
Share on other sites

7 minutes ago, Lisias said:

Please send me your craft file (you can zip it and drag'n'drop it on a post on the github issue

thats not as easy cause the craft is part of my maininstall.. means i have to make a minimal-install out of it, otherwise your rig is flying off in space. takes a while.. guess tomorrow.. have to leave now

Link to comment
Share on other sites

4 hours ago, GoAHead said:

thats not as easy cause the craft is part of my maininstall.. means i have to make a minimal-install out of it, otherwise your rig is flying off in space. takes a while.. guess tomorrow.. have to leave now

Don't bother, I already have the minimals. Now I need something concrete in order to know when I reach a good enough result - the usefulness of the minimals was expired.

Whatever is the craft you are getting the misbehaviour, is the one I need now to use as benchmark. Don't mind the add'ons you used, this time I need to get my pawns dirty the hard way to get the results I aim.

— — POST EDIT — — 

Oukey, I did what I do best: I tortured different versions of KSP about the issue until they talked. :sticktongue:

The whole test session starts with this comment: https://github.com/net-lisias-ksp/KSP-Recall/issues/60#issuecomment-1445226847

TL;DR: KSP 1.11.2 with Recall is recovering more funds than KSP 1.9.1 without, where there's no one trying to workaround the fund recovering problems. On 1.9.1, I lost 779 Funds on the sample craft. On 1.11.2 with Refunding, I got an extra 61. :cool:

I wish I could install Refunding on my bank account.

Serious now, it's really a float inaccuracy problem now. I put WarpPlugin in check, and it passed with flying colours - it is using doubles on the currency computing, what's really good enough for the amounts we are handling now (decimals would be the perfection, but double is good enough and, well, are faster).

@GoAHead, I'm pretty convinced that you are being bitten by KSP now. Please just zip your savegame the way it is now, and then tell me the name of the craft where you are being screwed. I don't need to load the savegame, I know where to look now by screening the files.

What I need to do is, as I said, get the current values being used by your savegame so I can benchmark them on my development rig. I will forge a simple savegame but using the values I find in yours, and then I will try to fix the float robbery by trying to steal back the error to your agency's account.

As it happened on my tests using 1.11.2, I probably won't be able to steal back the right value because the float's mantissa will not be able to represent it, but a little extra funds are better than too much less, right? ;) 

— — TECHINICAL MAMBO JAMBO — — 

To simplify things, I will explain how a floating point number works by using decimal numbers, way more easy to cope than binary or hexadecimals. A FP number has two numbers, the Exponent and the Mantissa - let's suppose we have a type of decimal floating points that can hold 4 decimal digits, 3 for the Mantissa, and 1 for the Exponent.

The number one would be stored in memory like 001.0 - where the dot is just to separate the mantissa from the exponent so we can easily work with them. In Scientific Notation (science stuff!), we would write 1e0 , or one to the zero power.

Interesting enough, since anything to the power of 0 is 1, the very same number can be represented in memory as:

  • 111.0
  • 100.0
  • 010.0
  • etc

So, we now had established that this representation can be somewhat wasteful. But it has its merits, because with only 4 digitis I can write some really big numbers using only 4 digits, as 1e9 or 1,000,000,000 and not using 10 digits as I did now.

But there's a catch: I can't represent 1,000,000,001 !! Because I have only 3 digits for the Mantissa!! Using a 9 as exponent, I can only represent the following numbers:

  • 001.9 = 1,000,000,000
  • 002.9 = 2,000,000,000
  • ...
  • 999.9 = 999,000,000,000

You see, everything under 999,999,999 is squashed - you lose precision.

Now, on real word, since the floats uses 4 bytes in binary notation, the standard says that for 4 bytes floats (32 bits), we represent things as:

S.eeeeeeee.mmmmmmmmmmmmmmmmmmmmmmm

1 bit for the signal (positive or negative), 8 bit for the exponent (-127 to +128) and 23 bits for the mantissa. We use base 2 for this representation, i.e., our numbers have only 0 e 1.

The same way we can count from 0 to 20 in decimal this way:

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20

In binary we count:

0, 1, 10, 11, 100, 101, 110, 111, 1000, 1001, 1010, 1011, 1100, 1101, 1110, 1111, 10000, 10001, 10010, 10011, 10100

Both lines are the same numbers, but on decimal we have more digits to play before a "carry 1" when we reach 9 (i.e., when we run out of symbols).

With doubles we have more bits for exponent and mantissa, so bigger numbers with better precision. But since GPUs cards are optimized to handle floats e not doubles, Unity choose to stick with floats internally. KSP uses doubles for the physics - converting between them all the time can lead to problems, but this is another subject.

Understanding floats in binary is a bit scary, but someone had this excellent idea: https://bartaz.github.io/ieee754-visualization/

You can flip the bits, or type numbers, and see how they are stored in memory. You will understand, by toying with it, why some numbers can't be accurately represented on floats.

The way I solved the problem on Refunding, was by using a C# datatype called decimal. This thing is a huge bitstream with 128 bits, being 96 bits representing a binary integer value and the remaining 32 bits are flags and the Scaling Exponent. These numbers are different from the Mantissa/Exponent used on IEEE 754 (the IEEE standard almost everybody uses for floating points), but they play similar roles. The end result is a way slower computing, but with way better accuracy.

Since the number ends up squashed to a float by the IPartCostModifier interface, Refunding can't assure the  accurate value will propagate into KSP - but at least Refunding is not pilling up inaccuracies itself. It was using doubles before, but part of the computations were scaled down to floats due this begin the datatype used by the Resources's amount and cost, and this was an error (as I was pilling up inaccuracies while cimputing the resource's costs).

Things are better now because the inaccuracy happens only once, when the final (good) result is squashed to a float by IPartCostModifier. But depending on the value, it will be enough to still screw up the recovery.

I will try to calculate this loss, and then compensate for it on the process.

 

Edited by Lisias
POST EDIT.
Link to comment
Share on other sites

14 hours ago, Lisias said:

Please just zip your savegame the way it is now, and then tell me the name of the craft where you are being screwed

hi @Lisias.. ok i already prepared everything before reading your last post. so here is my share which contains the gamadata and savegame with the craft file => https://1drv.ms/u/s!Am0PDmGqv17_irozNctLS4tCfhzBaQ?e=1x9bVW

the savegame is important cause.. if you load this you can recover a craft  on the landingstrip which causes millions of wrong substracted credits. but the craft is the same as provided within the savegamefolder. This is the craft i noticed it the first time due to running completely out of credits

if you newly deploy the craft and recover it it also  generates misfunding but not as mutch as the specific savegame

EDIT:

it might be the craftfile has currently a non scaled reactor atteched to it. just scale it down to reproduce.

Edited by GoAHead
Link to comment
Share on other sites

3 hours ago, GoAHead said:

the savegame is important cause.. if you load this you can recover a craft  on the landingstrip which causes millions of wrong substracted credits. but the craft is the same as provided within the savegamefolder. This is the craft i noticed it the first time due to running completely out of credits

if you newly deploy the craft and recover it it also  generates misfunding but not as mutch as the specific savegame

EDIT:

it might be the craftfile has currently a non scaled reactor atteched to it. just scale it down to reproduce.

Thank you!

And, yes, the savegame is the important thing now. You are confirming my diagnosing, by the way.

You are being bitten by how KSP computes currency, using floats (singles) instead of decimal or BCD (BigNumber on some languages). Using double mitigates the problem for now, because it have twice the size of the single's mantissa and so it takes a lot more to loose accuracy - but theoretically, it will dot it eventually. When handling currency, BCD or similar are, really, the only safe way. You can get yourself in legal trouble in some legislations by using floating point math on currency. :)

I will download your savegame and inspect it soon™ (have some domestic duties to carry on), but the scenario appears to be clear by now: you have a certain amount on Funds that, once stored on a float, overflow the mantissa's resolution and so the general magnitude of the value is simulated using the exponents, at the expenses of accuracy (see my example on my previous post). When recovering the craft, the value of it, after being squashed to fit your wallet's exponent, loses some bits of its own mantissa and this is the reason you are losing Funds - "unholy" roundings happening while KSP sums things up while squashing everything into a mere float instead of something more robust.

There's no real fix for this one, other than rewriting KSP's handling of Funds. Changing the IPartCostModifier interface would be ideal, but not strictly needed (the losses at this point is about less than 1K Funds for vessels costing more than 100.000.000 F), so the burden of recompiling the World will not be worth the pain - as long the Agency's Account is handled on a more robust datatype, things would be fine in the long run.

This is beyound what can be done by a PartModule, however. I'm going to need some bigger guns to tackle down this one. I'm afraid I will not be able to offer you a fix as fast as you would want. But I'm working on it - somehow. :P 

— — POST EDIT — — 

I was wrong! Funding is being handled as doubles by KSP!

https://www.kerbalspaceprogram.com/ksp/api/class_funding.html

I fail to understand why IPartCostModifier is using floats, however. But since the problem is not inherent to KSP guts, it's again something I can try to tackle down from my side.

Edited by Lisias
Link to comment
Share on other sites

9 minutes ago, Lisias said:

I'm afraid I will not be able to offer you a fix as fast as you would want. But I'm working on it - somehow. :P 

thx for every minute you spend time at it. at this point this bug forces me to stop playing KSP... so  some other games in my steam list gets some attention. no need to hurry.

thx again for all you great work

Link to comment
Share on other sites

23 minutes ago, GoAHead said:

thx for every minute you spend time at it. at this point this bug forces me to stop playing KSP... so  some other games in my steam list gets some attention. no need to hurry.

thx again for all you great work

I will keep you informed about my findings.

In time, digging on the KSP API, I found that the Funding class is using double, so the problem is not inherent to KSP guts - it's something between me and the Funding class. I will still need to bash my SAS on the problem, but now it appears to be on my reach without unholily shenanigans.

On the other side, why in Kraken's name the IPartCostModifer is still under float is a mystery to me.

Link to comment
Share on other sites

Hi

I'm a Steam Deck user, and I have just installed the newest version of Tweakscale.

It didn't do this before but now at startup I'm getting this error:

https://imgur.com/N6IOAKO

I'm not sure how to handle this, here is my KSP.log: https://drive.google.com/file/d/15bzpUygxetHWjhDzirx1uc-wDh9-zB3H/view?usp=sharing

(Also I cant for the life of me figure out where player.log is located on Steam Deck, it may not exist. please let me know if I'm not eligible for support because of that.)

Thanks

Link to comment
Share on other sites

10 hours ago, AZZlyTheAZZome said:

I'm a Steam Deck user, and I have just installed the newest version of Tweakscale.

It didn't do this before but now at startup I'm getting this error:

https://imgur.com/N6IOAKO

I'm not sure how to handle this, here is my KSP.log: https://drive.google.com/file/d/15bzpUygxetHWjhDzirx1uc-wDh9-zB3H/view?usp=sharing

Hi.

Yeah, something changed on the way things work on SteamDeck, as it appears:

[LOG 18:10:07.074] [KSP-Recall] ERROR: pwd != Application Root! -- pwd=/home/deck/.local/share/Steam/steamapps/common/Kerbal Space Program/ ; AppRot=/home/deck/.steam/steam/steamapps/common/Kerbal Space Program/ at error:0
[LOG 18:10:07.079] [KSP-Recall] "Houston, we have a problem!" about "Your 'pwd' doesn't match KSP's 'Application Root'!" was displayed

Historically, a thingy called "PWD" (Program Working Directory, or Default Directory on Windows) is set to the same place where the KSP's binary file is. Things on KSP get slightly bonkers when this doesn't happens (KSP.log is placed on the wrong place, your UserLoadingScreens are ignored, and some other misbehaviours).

In your case, your KSP is installed on the directory:

/home/deck/.steam/steam/steamapps/common/Kerbal Space Program/

But that PWD thingy os being set to:

/home/deck/.local/share/Steam/steamapps/common/Kerbal Space Program/

So, in theory, you are now susceptible to that misbehavirours I talked about.

But this is linux - if one of the directories I mentioned is mounted as a BIND into the other (or a symbolic link), then we would have two different pathnames pointing to the same place, but since the KSPe thingy (a shared component of mine that takes care of some internal business) can't tell, it warns you about this weirdness so you can do something about - as asking me here what the hell is happening.

When was the last time you did installed TweakScale before getting this message? Do you know how to open a X11 terminal on your deck? (if you can open a remote shell on it from your computer, is even better).

 

10 hours ago, AZZlyTheAZZome said:

(Also I cant for the life of me figure out where player.log is located on Steam Deck, it may not exist. please let me know if I'm not eligible for support because of that.)

The meaning of this warning is to be aware of any change that can affect KSP's behaviours, so I can check what's happening and be able to do something about, as to update KSPe (that internal business thingy of mine) in order to cope with this.

Until recently, this KSPe library (used directly or indirectly by everything I maintain) was using the PWD in order to locate needed data, as well to write settings. This is standard Windows behaviour, but it was consistently used too on Linux and MacOS.

UNIX way of life, however, usually dictates that we use the program directory ("AppRoot") to read readonly data (the GameData) and use the PWD for read/write data (settings, savegames, etc) and apparently SteamDeck is pursuing this Modus Operandi. As far as I know, everything and the kitchen's sink on KSP uses what the message calls AppRoot for everything but, if SteamDeck is really pursuing an UNIX way of life on the file system, backups on the Deck are going to be challenging now because everybody is writing things on the "wrong place".

Can you check in your Deck where the KSP.log is located? In the AppRoot? In the PWD? Or in both?

And, yeah, you are elligible for support - your current installation is not fully supported yet because I don't know what's happening, but as soon as we figure it out, KSPe will be update and so your installation will be fully supported. Eventually… :P 

In the mean time, you can ignore the message - but keep an eye on anything weird happening while playing KSP. How the savegame is being handled is partially concerning for me in this moment.

— — POST EDIT — — 

@AZZlyTheAZZome, I opened a support ticked for easier follow up: https://github.com/net-lisias-ksp/KSPe/issues/48

BOTH paths appears to be valid in SteamDeck, but not a the same time!

Edited by Lisias
POST EDIT
Link to comment
Share on other sites

10 hours ago, AZZlyTheAZZome said:

Hi

I'm a Steam Deck user, and I have just installed the newest version of Tweakscale.

Dude, I'm still unsure but if what I had read until this moment is true, you are on a daring situation!

SteamDeck **used** to install things on ~/.local/share/Steam , but recently they start to use ~/.steam/steam/ instead. So, if this information is correct, you are launching one copy of KSP, but the PWD is being set to another (and probably older) copy of KSP.

think this is a bug on the Steam Launcher that failed to correctly migrate your shortcuts to the proper place after the new Launcher version was installed. I suggest you contact the Deck Support line and ask about. Pinpoint this post and the github one too for reference.

I'm tracking your case here: https://github.com/net-lisias-ksp/KSPe/issues/48

And please let me know whatever they say to you!

Edited by Lisias
fixing paths
Link to comment
Share on other sites

ANNOUNCE

KSP Recall 0.3.0.12 on the Wild, featuring:

  • Reworks Refunding (again), this time with a better workaround for the really expensive parts, the preferential targets.
    • Kudos to GoAhead for the heads up!
  • Reworks issue:
    • #60 Weird Misbehaviour on Interstellar Technologies

This release reworks to Work Around published in the last one, with a better (or less worst) approach for refunding really , really expensive parts (and. boy, I'm talking expensive here). I can't prevent inaccuracies on recovering because I can't coerce KSP to use doubles on IPartCostModifier (and even if I could, this would break everybody), so I took the less friction path and decided to err in favour of the user: once a float inaccuracy is detected, I mangle the refunding to over-refund you instead of under-refunding.

At the very least, you will be able to relaunch the same craft for sure if you recover it immediately. Since the values involved are absolutely insane (and, boy, I really mean INSANE), I would not consider a too much of a cheating this extra funds you will get due the stunt.

@GoAHead, I could not check your savegame on my rig - it just can't run your modpack by some reason, probably related but some PartModule on the add'ons - I had launched way heavier GameDatas in the past on this punny excuse of computer I call a Mac Mini.

In a way or another, I eye balled what I could and I'm optimist about the results for you. Please give this a try.

And since we are here… :)

221460008-061cfe5d-73dd-4005-9e3a-c3fe8c

— — — — — 


This Release will be published using the following Schedule:

  • GitHub, reaching manual installers and users of KSP-AVC first. Right Now.
  • CurseForge. Soon™
  • SpaceDock (and CKAN users). Also Soon™

I would like some early adopters to install this thing and use for some time to be sure the stunt I pulled while persisting the current PartModule cost on the Config File will really work in all the use cases.

Edited by Lisias
tyop! Surprised?
Link to comment
Share on other sites

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