ModularFuelSystem icon indicating copy to clipboard operation
ModularFuelSystem copied to clipboard

Tweakscale compatibility issue

Open svm420 opened this issue 9 years ago • 20 comments

Well i seem to have found a major issue with using realfuels with tweakscale. Using latest tweakscale, realfuels, MFI, and dev version of solverengines Windows 7 64bit KSP 1.0.4 32 bit outside program files folder

Steps to reproduce.

  1. create new craft in vab. I used mk1 inline cockpit
  2. Place stock septron SRM on cockpit
  3. Tweakscale to non default value
  4. Save craft
  5. Reload craft while still in editor
  6. Select another septron SRM from build list and errors begin. Attach the septron to the cockpit. Try to open engine GUI. Mass log spam. Trying to launch results in more errors of a different nature.

Logs! MM cache!

Hope that helps! :)

svm420 avatar Jul 19 '15 22:07 svm420

Still an issue with latest releases of RF and SolverEngines

svm420 avatar Jul 20 '15 22:07 svm420

Thanks for this! Love the steps/log/cache! :)

I can't promise to get to it very soon, but I will do it...

NathanKell avatar Jul 20 '15 22:07 NathanKell

That's all could ask for :). Thank you!

svm420 avatar Jul 21 '15 17:07 svm420

Aaaand 3.5 months later I finally look into this. @pellinor0 this appears to be a loop between Tweakscale and RF, namely Tweakscale will call its rescale method whenever setup is called, which getmodulecost calls.

Relevant stack trace: [TweakScale Warning] Exception on Rescale: System.StackOverflowException: The requested operation caused a stack overflow.

at (wrapper managed-to-native) UnityEngine.Transform:INTERNAL_set_localScale (UnityEngine.Vector3&)

at UnityEngine.Transform.set_localScale (Vector3 value) [0x00000] in :0

at TweakScale.TweakScale.UpdateByWidth (Boolean moveParts, Boolean absolute) [0x00000] in :0

at TweakScale.TweakScale.Setup () [0x00000] in :0

at TweakScale.TweakScale.GetModuleCost (Single defaultCost) [0x00000] in :0

at Part.GetModuleCosts (Single defaultCost) [0x00000] in :0

at RealFuels.ModuleEngineConfigs.CostTL (Single cost, .ConfigNode cfg) [0x00000] in :0

at RealFuels.ModuleEngineConfigs.DoConfig (.ConfigNode cfg) [0x00000] in :0

at RealFuels.ModuleEngineConfigs.SetConfiguration (System.String newConfiguration, Boolean resetTechLevels) [0x00000] in :0

at RealFuels.TweakScaleModularEnginesUpdater.OnRescale (ScalingFactor factor) [0x00000] in :0

at TweakScale.TweakScale.Setup () [0x00000] in :0

at TweakScale.TweakScale.GetModuleCost (Single defaultCost) [0x00000] in :0

at Part.GetModuleCosts (Single defaultCost) [0x00000] in :0

at RealFuels.ModuleEngineConfigs.CostTL (Single cost, .ConfigNode cfg) [0x00000] in :0

at RealFuels.ModuleEngineConfigs.DoConfig (.ConfigNode cfg) [0x00000] in :0

at RealFuels.ModuleEngineConfigs.SetConfiguration (System.String newConfiguration, Boolean resetTechLevels) [0x00000] in :0

at RealFuels.TweakScaleModularEnginesUpdater.OnRescale (ScalingFactor factor) [0x00000] in :0

at TweakScale.TweakScale.Setup () [0x00000] in :0

at TweakScale.TweakScale.GetModuleCost (Single defaultCost) [0x00000] in :0

at Part.GetModuleCosts (Single defaultCost) [0x00000] in :0

at RealFuels.ModuleEngineConfigs.CostTL (Single cost, .ConfigNode cfg) [0x00000] in :0

at RealFuels.ModuleEngineConfigs.DoConfig (.ConfigNode cfg) [0x00000] in :0

at RealFuels.ModuleEngineConfigs.SetConfiguration (System.String newConfiguration, Boolean resetTechLevels) [0x00000] in :0

at RealFuels.TweakScaleModularEnginesUpdater.OnRescale (ScalingFactor factor) [0x00000] in :0

NathanKell avatar Nov 14 '15 05:11 NathanKell

:D :D :D Can not wait!!! Will this be part of the 1.0.5 update?

svm420 avatar Nov 15 '15 00:11 svm420

Thanks for the analysis! I'll resolve the issue within TweakScale.

Calling Setup in getModuleCost is a construction that forces an early setup if the module cost is called before the regular initialization. Which is probably a bad idea to do at all.

pellinor0 avatar Nov 15 '15 21:11 pellinor0

Awesome, thanks! :) And yeah, probably a bad idea in the big picture...

Do let me know if there's anything I can do to help RF-side!

NathanKell avatar Nov 15 '15 21:11 NathanKell

@NathanKell @pellinor0 Seems there is still an issue. Steps to repro

  1. Enter VAB and place mk1 pod.
  2. Choose rcs or any engine with a tweakscale module.
  3. Attach to pod, tweakscale to non default size and save craft.
  4. Try to reload craft. Game locks up till it crashes. No NREs present in log or any other relevant info. Just crashes to desktop. That was latest RF, tweakscale, solver engines. On 1.0.5 latest build. Let me know if you want MM.cache or logs didn't include them as not very relevant, but will if they are desired. Thanks!

svm420 avatar Dec 10 '15 19:12 svm420

Oh, looks like I haven't released since fixing this. Could you try the dev version of TweakScale? https://github.com/pellinor0/TweakScale/archive/dev.zip (you only need the GameData folder)

pellinor0 avatar Dec 10 '15 20:12 pellinor0

<____< You were right I thought I had grabbed the latest dev version seems in my massive install moving/updating I somehow ended up with an older version. Thanks for the quick responce. I will close it now that i verified it is fixed Thanks to both of you once again :)

svm420 avatar Dec 10 '15 21:12 svm420

@NathanKell @pellinor0 Well there is another issue now. RCS thrusterpower is not scaling with size. It definitely should it is listed in the ScaleExponent.cfg file. Engines are working fine, but not RCS. Maybe related, but after scaling and playing with it for a bit I got a NRE that lead to the RealFuels GUI for the RCS part breaking. This was on my full linux 1.05 install heavy modded, so LMK if you want me to verify with a minimal install. Log. Will upload the cache to if desired LMK. Thanks!

Aborting
  at UnityEngine.GUILayoutGroup.GetNext () [0x00000] in <filename unknown>:0 
  at UnityEngine.GUILayoutUtility.BeginLayoutGroup (UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options, System.Type LayoutType) [0x00000] in <filename unknown>:0 
  at UnityEngine.GUILayout.BeginHorizontal (UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) [0x00000] in <filename unknown>:0 
  at UnityEngine.GUILayout.BeginHorizontal (UnityEngine.GUILayoutOption[] options) [0x00000] in <filename unknown>:0 
  at RealFuels.ModuleEngineConfigs.engineManagerGUI (Int32 WindowID) [0x00000] in <filename unknown>:0 
  at UnityEngine.GUILayout+LayoutedWindow.DoWindow (Int32 windowID) [0x00000] in <filename unknown>:0 
  at UnityEngine.GUI.CallWindowDelegate (UnityEngine.WindowFunction func, Int32 id, UnityEngine.GUISkin _skin, Int32 forceRect, Single width, Single height, UnityEngine.GUIStyle style) [0x00000] in <filename unknown>:0 

(Filename:  Line: 4294967295)

NullReferenceException: Object reference not set to an instance of an object
  at RealFuels.ModuleEngineConfigs.TLTInfo () [0x00000] in <filename unknown>:0 
  at RealFuels.ModuleEngineConfigs.engineManagerGUI (Int32 WindowID) [0x00000] in <filename unknown>:0 
  at UnityEngine.GUILayout+LayoutedWindow.DoWindow (Int32 windowID) [0x00000] in <filename unknown>:0 
  at UnityEngine.GUI.CallWindowDelegate (UnityEngine.WindowFunction func, Int32 id, UnityEngine.GUISkin _skin, Int32 forceRect, Single width, Single height, UnityEngine.GUIStyle style) [0x00000] in <filename unknown>:0 

svm420 avatar Dec 10 '15 23:12 svm420

Reopened.

NathanKell avatar Dec 11 '15 04:12 NathanKell

@NathanKell Any chance you will be back to this before the holidays/turn of the year? Thanks!

svm420 avatar Dec 13 '15 21:12 svm420

Yep, I plan to work on this when RP-0 is done.

NathanKell avatar Dec 13 '15 21:12 NathanKell

@NathanKell Did you mean when RP-0 is completely finished, or were you going to come back to this sometime soon? Just waiting on this fix for my career Thanks!

svm420 avatar Jan 01 '16 16:01 svm420

@NathanKell Any clarification would greatly be appreciated. Thanks!

svm420 avatar Jan 09 '16 18:01 svm420

Sorry, thought I commented here. Per the last devnotes I spent pretty much all the time from Christmas to last weekend in the hospital with my mom; I'm now (and was before, which made that awkward) very busy on KSP dev work. I will certainly get to this when I can, and I was intending to come back to it now that RP-0 is working 'well enough', but...afraid it'll be awhile yet unless you can scrape up someone else to look into why it's failing.

NathanKell avatar Jan 09 '16 18:01 NathanKell

What IS the current status of this? Can I close this? Trying to do some serious pruning of the 30ish or so issues outstanding.

Starwaster avatar Jan 12 '19 03:01 Starwaster

Just did some quick testing. The last issue I mentioned still exists. RCS using RealFuels does not scale thrust power with resizing. There are no NREs or other errors. It just doesn't work. Engines work fine, and scale thrust with size. I can do testing if needed. Would really appreciate this finally being fixed :) Thanks!

svm420 avatar Jan 12 '19 16:01 svm420

@svm420 can you get me a fresh log file for this? The old one is AWOL and probably was no longer relevant since it was for a different issue? Thanks.

Starwaster avatar Jan 15 '19 01:01 Starwaster