KSP-RO / RealFuels

Modular fuel tanks and engines, with real fuels and realistic performance.
55 stars 66 forks source link

Tweakscale compatibility issue #94

Open svm420 opened 9 years ago

svm420 commented 9 years ago

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 commented 9 years ago

Still an issue with latest releases of RF and SolverEngines

NathanKell commented 9 years ago

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

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

svm420 commented 9 years ago

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

NathanKell commented 8 years ago

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

svm420 commented 8 years ago

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

pellinor0 commented 8 years ago

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.

NathanKell commented 8 years ago

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!

svm420 commented 8 years ago

@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!
pellinor0 commented 8 years ago

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)

svm420 commented 8 years ago

<____< 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 commented 8 years ago

@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 
NathanKell commented 8 years ago

Reopened.

svm420 commented 8 years ago

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

NathanKell commented 8 years ago

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

svm420 commented 8 years ago

@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 commented 8 years ago

@NathanKell Any clarification would greatly be appreciated. Thanks!

NathanKell commented 8 years ago

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.

Starwaster commented 5 years ago

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

svm420 commented 5 years ago

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!

Starwaster commented 5 years ago

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