DanielKote / Foreman2

Visual planning tool for Factorio
Other
158 stars 14 forks source link

Ratios not being calculated. #65

Closed IIIPhoto closed 1 year ago

IIIPhoto commented 1 year ago

After importing my Bob's mods save, and attepting to build out my first graph, after importing the first recipe this error pops up. When pulling from a recipe node this error comes up for each ingredient. Some of the recipies end up wrong, saplings are added to some of them. Some of the recipies will carry items over that are not part of the product.

Continuing pass these errors is ok and the program still works, but the calculation of the ratios isn't present. Pausing all calulations stops the error occuring.

See the end of this message for details on invoking just-in-time (JIT) debugging instead of this dialog box.

** Exception Text ** System.TypeInitializationException: The type initializer for 'Google.OrTools.LinearSolver.operations_research_linear_solverPINVOKE' threw an exception. ---> System.TypeInitializationException: The type initializer for 'SWIGExceptionHelper' threw an exception. ---> System.DllNotFoundException: Unable to load DLL 'google-ortools-native': The specified module could not be found. (Exception from HRESULT: 0x8007007E) at Google.OrTools.LinearSolver.operations_research_linear_solverPINVOKE.SWIGExceptionHelper.SWIGRegisterExceptionCallbacks_operations_research_linear_solver(ExceptionDelegate applicationDelegate, ExceptionDelegate arithmeticDelegate, ExceptionDelegate divideByZeroDelegate, ExceptionDelegate indexOutOfRangeDelegate, ExceptionDelegate invalidCastDelegate, ExceptionDelegate invalidOperationDelegate, ExceptionDelegate ioDelegate, ExceptionDelegate nullReferenceDelegate, ExceptionDelegate outOfMemoryDelegate, ExceptionDelegate overflowDelegate, ExceptionDelegate systemExceptionDelegate) at Google.OrTools.LinearSolver.operations_research_linear_solverPINVOKE.SWIGExceptionHelper..cctor() --- End of inner exception stack trace --- at Google.OrTools.LinearSolver.operations_research_linear_solverPINVOKE.SWIGExceptionHelper..ctor() at Google.OrTools.LinearSolver.operations_research_linear_solverPINVOKE..cctor() --- End of inner exception stack trace --- at Google.OrTools.LinearSolver.operations_research_linear_solverPINVOKE.Solver_CreateSolver(String jarg1) at Google.OrTools.LinearSolver.Solver.CreateSolver(String solver_id) at Foreman.GoogleSolver..ctor() in D:\software\Factorios\Foreman 2\Foreman\Models\Solver\GoogleSolver.cs:line 20 at Foreman.ProductionSolver..ctor(Boolean pullOutputNodes, Double outputObjectiveC, Double factoryObjectiveC, Double overflowObjectiveC, Double errorObjectiveC, Double lowPriorityMultiplier) in D:\software\Factorios\Foreman 2\Foreman\Models\Solver\ProductionSolver.cs:line 80 at Foreman.ProductionSolver..ctor(Boolean pullOutputNodes, Double pullPower, Double minRecipeOutRate, Double lowPriorityMultiplier) in D:\software\Factorios\Foreman 2\Foreman\Models\Solver\ProductionSolver.cs:line 70 at Foreman.ProductionGraph.OptimiseNodeGroup(IEnumerable`1 nodeGroup) in D:\software\Factorios\Foreman 2\Foreman\Models\Solver\GraphOptimisation.cs:line 28 at Foreman.ProductionGraph.OptimizeGraphNodeValues() in D:\software\Factorios\Foreman 2\Foreman\Models\Solver\GraphOptimisation.cs:line 16 at Foreman.ProductionGraph.UpdateNodeValues() in D:\software\Factorios\Foreman 2\Foreman\Models\ProductionGraph.cs:line 313 at Foreman.ProductionGraphViewer.<>c__DisplayClass108_0.g__ProcessNodeRequest|0(Object o, RecipeRequestArgs recipeRequestArgs) in D:\software\Factorios\Foreman 2\Foreman\ProductionGraphView\ProductionGraphViewer.cs:line 287 at Foreman.RecipeChooserPanel.IRButton_MouseUp(Object sender, MouseEventArgs e) in D:\software\Factorios\Foreman 2\Foreman\Controls\IRChooserPanel.cs:line 652 at System.Windows.Forms.Control.OnMouseUp(MouseEventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

** Loaded Assemblies ** mscorlib Assembly Version: 4.0.0.0 Win32 Version: 4.8.4515.0 built by: NET48REL1LAST_C CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll

Foreman Assembly Version: 2.0.12.0 Win32 Version: 2.0.12.0 CodeBase: file:///C:/Users/Admin/Desktop/Release/Foreman.exe

System.Windows.Forms Assembly Version: 4.0.0.0 Win32 Version: 4.8.4550.0 built by: NET48REL1LAST_C CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

System Assembly Version: 4.0.0.0 Win32 Version: 4.8.4536.0 built by: NET48REL1LAST_C CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll

System.Drawing Assembly Version: 4.0.0.0 Win32 Version: 4.8.4390.0 built by: NET48REL1LAST_C CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

System.Configuration Assembly Version: 4.0.0.0 Win32 Version: 4.8.4190.0 built by: NET48REL1LAST_B CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll

System.Core Assembly Version: 4.0.0.0 Win32 Version: 4.8.4590.0 built by: NET48REL1LAST_B CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll

System.Xml Assembly Version: 4.0.0.0 Win32 Version: 4.8.4084.0 built by: NET48REL1 CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll

Accessibility Assembly Version: 4.0.0.0 Win32 Version: 4.8.4084.0 built by: NET48REL1 CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll

Newtonsoft.Json Assembly Version: 10.0.0.0 Win32 Version: 10.0.1.20720 CodeBase: file:///C:/Users/Admin/Desktop/Release/Newtonsoft.Json.DLL

System.Numerics Assembly Version: 4.0.0.0 Win32 Version: 4.8.4084.0 built by: NET48REL1 CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll

Google.OrTools Assembly Version: 9.1.9490.0 Win32 Version: 9.1.9490.0 CodeBase: file:///C:/Users/Admin/Desktop/Release/Google.OrTools.DLL

System.Runtime.Serialization Assembly Version: 4.0.0.0 Win32 Version: 4.8.4536.0 built by: NET48REL1LAST_C CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Serialization/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Serialization.dll

System.Data Assembly Version: 4.0.0.0 Win32 Version: 4.8.4584.0 built by: NET48REL1LAST_B CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_64/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll

** JIT Debugging ** To enable just-in-time (JIT) debugging, the .config file for this application or computer (machine.config) must have the jitDebugging value set in the system.windows.forms section. The application must also be compiled with debugging enabled.

For example:

When JIT debugging is enabled, any unhandled exception will be sent to the JIT debugger registered on the computer rather than be handled by this dialog box.

mrozpara commented 1 year ago

(changed my mind - preset is not required) it seems that the problem is with DLL file. Do you have all files downloaded? Maybe you shoud try to download/unzip Foreman again. IMHO file: Google.OrTools.dll is missing

IIIPhoto commented 1 year ago

After redownloading. Same error when adding recipes to the graph.

https://1drv.ms/f/s!AmU-5daOPF-Sh0zkgV-xhPpNpNzM?e=3cxNQY

mrozpara commented 1 year ago

have you tried with default preset (vanillia)? The one that you shared is working fine on my local env...

IIIPhoto commented 1 year ago

Same error with default preset after initial redownload.

I deleted and redownloaded a second time, this time I did not direct it to my game files. Same error.

DanielKote commented 1 year ago

could you provide a few more details about the install and your system?

For dot net frameworks: press the windows key type out <> (without << and >>) on the right side select 'run as administrator' type out <<reg query "HKLM\SOFTWARE\Microsoft\Net Framework Setup\NDP" /s>> (without << and >>) copy the result text into the answer

The two possible issues I have found while searching for similar errors are:

  1. The install directory was placed in too many folders (so the path length was too long) - so in addition to the details above, could you try making a 'foreman 2' folder directly on your c (or whatever letter) drive (so it would be c:\foreman 2\) and try to launch foreman from there.
  2. You are missing the dot net runtime necessary to run the program (would be weird due to the program starting, but ok...). Try downloading the v4 microsoft dot net runtime? You can find it here: https://dotnet.microsoft.com/en-us/download/dotnet-framework/net48
IIIPhoto commented 1 year ago

WIndows 10 Install directory is on the desktop, but I did move it to the programs folder to see if it would work from there. No success even with the vanilla preset. Path for foreman install directory: C:\Users\Admin\Desktop google-ortools-natiive.dll is installed in the directory Net frameworks installed: v4.0.30319, v2.0.50727, v1.1.4322, v1.0.3705

  1. The install directory was placed on the desktop originally, but was moved to the programs folder to test for resolution. Same error. 2.After clicking the link, I got the message that the framework is already installed.

Please let me know if you need more information.

mrozpara commented 1 year ago

based on google search - my guess would be: Microsoft Visual C++ Redistributable is missing Try to download and install: https://aka.ms/vs/17/release/vc_redist.x64.exe (link from: https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170

IIIPhoto commented 1 year ago

That fixed the calculation issue. Thank you! Makes sense. This older laptop I'm using went througha factory reset.