rybadour / foreman Goto Github PK
View Code? Open in Web Editor NEWVisual planning tool for the game Factorio
License: Other
Visual planning tool for the game Factorio
License: Other
When launching Forman the application crashes with a NullReferenceException.
Here is the output:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at Foreman.DataCache.ReadModSettings() in E:\Projects\ForemanGit\Foreman\DataCache.cs:line 392
at Foreman.DataCache.LoadAllData(List`1 enabledMods, CancellableProgress progress) in E:\Projects\ForemanGit\Foreman\DataCache.cs:line 223
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Foreman.ProgressForm.<ProgressForm_Load>d__4.MoveNext() in E:\Projects\ForemanGit\Foreman\Forms\ProgressForm.cs:line 44
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4341.0 built by: NET48REL1LAST_C
CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dllForeman
Assembly Version: 0.0.1.1
Win32 Version: 0.0.0.0
CodeBase: file:///C:/Users/Ryan%20Williams/Downloads/Foreman-Release/Foreman.exeSystem.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4341.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.dllSystem
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4300.0 built by: NET48REL1LAST_C
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dllSystem.Drawing
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.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dllSystem.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.dllSystem.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4341.0 built by: NET48REL1LAST_C
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dllSystem.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.dllNLua
Assembly Version: 1.3.2.0
Win32 Version: 1.3.2
CodeBase: file:///C:/Users/Ryan%20Williams/Downloads/Foreman-Release/NLua.DLLKeraLua
Assembly Version: 1.3.2.0
Win32 Version: 1.3.2.0
CodeBase: file:///C:/Users/Ryan%20Williams/Downloads/Foreman-Release/KeraLua.DLLAccessibility
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.dllNewtonsoft.Json
Assembly Version: 10.0.0.0
Win32 Version: 10.0.1.20720
CodeBase: file:///C:/Users/Ryan%20Williams/Downloads/Foreman-Release/Newtonsoft.Json.DLLMicrosoft.CSharp
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4084.0
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.CSharp/v4.0_4.0.0.0__b03f5f7f11d50a3a/Microsoft.CSharp.dllSystem.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.dllSystem.Dynamic
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4084.0
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Dynamic/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Dynamic.dllAnonymously Hosted DynamicMethods Assembly
Assembly Version: 0.0.0.0
Win32 Version: 4.8.4341.0 built by: NET48REL1LAST_C
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_64/mscorlib/v4.0_4.0.0.0__b77a5c561934e089/mscorlib.dllSystem.Data
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4270.0 built by: NET48REL1LAST_C
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_64/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dllSystem.Runtime.Serialization
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4250.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.dllSystem.IO.Compression.FileSystem
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4084.0
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.IO.Compression.FileSystem/v4.0_4.0.0.0__b77a5c561934e089/System.IO.Compression.FileSystem.dllSystem.IO.Compression
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.IO.Compression/v4.0_4.0.0.0__b77a5c561934e089/System.IO.Compression.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.
Foreman crashes when there is a mod-settings.dat file present in the factorio mod directory.
I reproduced this by installing the logistic train network mod v.1.13.1 (and dependencies). This mod will create the settings file on startup.
Alternatively I was also able to reproduce this with just an empty mod-settings.dat file.
I'm using Factorio v0.18.18
The crash does not produce an error log file.
You can find the error message from the exception window here:
I can try to translate parts of it if needed.
Foreman encountered an error while loading the Factorio data with these mods in the mods folder. I copied the text in the error popup unto errortext.txt and included the errorlog.txt from the Foreman folder. Interestingly, deactivating the mods and removing the .zips from my mods folder did not fix the problem.
errorlog.txt
errortext.txt
DiscoScience_1.0.2.zip
Todo-List_18.0.1.zip
mod-list.txt
Currently we only read settings data from mod-settings.dat which is generated by Factorio when it loads. This is problematic because some mods depend on these settings but if you enable mods which aren't currently "active" in Factorio then these mods can crash unexpectedly.
Settings data will have to read manually from each mods settings.lua file.
If while changing mods some of the mod specific nodes are present in the graph Foreman seems to crash. The user should probably be prompted if they want to save or discard their current graph.
For some reason the recipes/items of Bobs mods related to robot parts are showing up. Likely they are not being parsed correctly or are misidentified as something else?
This was noticed in 0.18.x
We should parse research data from mods and provide a way to choose which research is considered "unlocked". There should be a setting to filter all recipes and items based on unlocked research. Research should be divided into separate lists based on it's tier. Ex. Group all research that only requires red science into a group. Each group of research can be unlocked as a group with some sort of "select all" control.
Presently, when assemblers are shown the recipe of all nodes is hidden. We should either show both at the same time or put the assemblers only inside the popup that appears when you click a node.
Error occurs when starting up the application. No item will load following the error.
`See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at Foreman.DataCache.ReadModSettings() in E:\Projects\ForemanGit\Foreman\DataCache.cs:line 392
at Foreman.DataCache.LoadAllData(List`1 enabledMods, CancellableProgress progress) in E:\Projects\ForemanGit\Foreman\DataCache.cs:line 223
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Foreman.ProgressForm.<ProgressForm_Load>d__4.MoveNext() in E:\Projects\ForemanGit\Foreman\Forms\ProgressForm.cs:line 44
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
************** 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.`
The planner's "Automatically create missing nodes" feature assumes all products are available globally. This is not always true - for example, it is a common feature of blue circuit builds to include local green circuit production, or for copper wire for red circuits to be isolated from copper wire for green circuits.
Allow the creation of isolated sub-graphs where the outputs and inputs are defined by the user, and intermediate nodes within are not shared with the main graph or other sub-graphs.
This style of graph is possible to create manually, but the auto-layout will always destroy this kind of graph.
I'm fairly sure I'm not missing something - With just vanilla game files, no mods loaded, the suggested number of mining drills for a specified rate of output will be exactly double that which is actually required.
(ie, it takes 5 electric drills (at 0.5 ore per second) to feed 8 stone furnaces (each 0.3125 per second), but Foreman currently tells me it will require 10 electric drills to feed 8 stone furnaces)}
Rybadour: Hmm, If I recall 0.16 added hardness or something right? I have a feeling Foreman doesn’t yet read those values.
(user): I believe it’s actually the opposite. At some point they removed the notion of “hardness”, and recently just standardized the ore mining rates to 0.5/s (in electric drills) for all ores, except uranium which is 0.25/s.
Perhaps Foreman has some legacy hardness-related code that’s scaling up the values it’s reading in? (Probably not insightful, I’m no coder 🙂)
Edit: ok, somehow this functionality is there, but it is not used automatically and somehow productivity modules, assemblers are not read correctly from the Factorio directory?!
What really would be best would be to globally set the furnace type, assembler type and productivity module type to be selected (defaulting to electric furnace, assembler 3 and prod. module 3, as this is the standard late game setup for which this tool is used), and automatically applied to all new nodes ...
User would like to configure which modules Foreman uses globally rather than on a per-recipe basis.
Some mods such as Bobs Mod have a second Iron Plate recipe (and others). Seems like their iron plate isn't being associated the other iron plate recipes. It seems to work fine in-game so hopefully there is a way for Foreman to detect and "merge" the different recipes?
Some of the liquid items in Seablock cause visual bugs in Foreman. The icons are blank and the lines that connect nodes are white instead of grey. In the attached screenshot the white space between "Solid Fuel" and "Biomass Refining" contains a white line. Each of the recipes contains the item "Fuel Oil".
Mods such as ZRecycling include a copy of almost every single recipe from all compatible mods. These recipes cause UI slowdowns and difficulty in searching for the correct recipe. These mods should be excluded automatically. If possible, we should detect them. Otherwise, just a hardcoded list of known mods would be sufficient.
This is the first in a series of issues to track work related to ensuring Foreman supports Factorio 0.18.
We should load up Foreman with the base and core mods and ensure it loads without issue and can used to create a graph of some recipes from the base game.
Creating input nodes automatically doesn't seem to work how user might expect. I'm not really sure how the algorithm works exactly so I'll outline my opinion of how the graph should be generated. It often stops generating randomly and generates duplicate nodes instead of linking them together.
Ideally, I think it should generate all recipes for all the inputs recursively. It should only stop generating at raw resources such as ore, oil, or water. All recipes should be linked to common nodes. Connection between nodes should avoid overlapping if at all possible.
Is it possible to add a grid to the background so one can snap the diagrams to it?
People are reporting that the enabled mods list is empty when first opening Foreman with the 0.18 version. It's either unable to associate mod folders to enabled mods or it's no longer reading the enabled mods from the Factorio installation directory.
Load up Foreman with Factorio 0.18 and Bobs Mods updated to support Factorio 0.18. Verify that it works reasonably.
There are likely existing issue that have nothing to do with 0.18 compatibility so it may be difficult to differentiate between the two. Try to summarize the issues found and add them to this project.
Currently loading Foreman is extremely slow. It can take up to a minute for a large mod to load. A player with a few different (even disabled) mod packs can find themselves waiting a long time on both the load of Foreman and any time they change the enabled mods list.
Some suggestions for improvements:
When we find errors while loading mods we should tell the user and make it easy for them to create a GitHub issue about it.
Currently Foreman will use the directory/zip file first encountered and any other mods with the same name are ignored. We should change this to choose the one with the latest version by default and once mod dependencies are parsed to choose versions based on which versions are needed.
https://github.com/Rybadour/Foreman/blob/master/Foreman/Models/Solver/ProductionGraph.cs#L93-L106
Proposed:
currentNode.Inputs
and discard already-connected inputs.Part of #29
A couple mods that use the StdLib mod (https://mods.factorio.com/mod/stdlib) don't seem to be parsed correctly.
Example error message:
C:\Users\XXX\AppData\Local\Temp\pycoalprocessing_1.2.2\pycoalprocessing_1.2.2\data.lua ([string "chunk"]:13: module 'stdlib/stdlib/data/data' not found:
no field package.preload['stdlib/stdlib/data/data']
no file 'C:\XXX\Foreman\lua_stdlib_/stdlib/data/data.lua'
no file 'C:\XXX\Foreman\lua_stdlib_/stdlib/data/data\init.lua'
no file 'C:\XXX\Foreman_stdlib_/stdlib/data/data.lua'
no file 'C:\XXX\Foreman_stdlib_/stdlib/data/data\init.lua'
no file '._stdlib_/stdlib/data/data.lua'
no file 'C:\XXX\Factorio\data\core\lualib_stdlib_/stdlib/data/data.lua'
no file 'C:\Users\XXX\AppData\Local\Temp\pycoalprocessing_1.2.2\pycoalprocessing_1.2.2_stdlib_/stdlib/data/data.lua'
no file 'C:\XXX\Foreman_stdlib_/stdlib/data/data.dll'
no file 'C:\XXX\Foreman\loadall.dll'
no file '._stdlib_/stdlib/data/data.dll')
Recipes pertaining to barreling or unbarreling fluids should be excluded from the list by default and be made a toggleable option.
Include known list of Factorio installation directories in the popup that open when clicking "Factorio Directory..." from the main screen.
I am not 100% sure, since I am just quickly reading source code and not digging into exact bits as much as I would want before filing this, (may edit more later after feedback) but it seems you aren't intrinsically using anything that can't work on netcore3+ besides WinForms for UI so that Linux (and maybe other?) users can also use the application.
I might take a stab at a number of the first few steps sometime in the next few weeks via PRs, for me the killer will be UI work. Never been very good at that since I work systems stuff.
<PackageReference>
format instead of packages.config
dotnet publish
. Requires validation to be sure since runtime selection can be picky, so might have to document the correct CLI/VS magic to properly publish-with-native-deps.emscripten/C/C++
compiling the native Lua (+Others?) libraries. Or could we swap out NLua for MoonSharp? how compatible do we require? hrm. Very low priority this, because probably better for different approach when targeting web.The list of assemblers show in the "Enable/disable loaded objects" popup can get extremely long and difficult to use. A checkbox should be added allow the user to select (or unselect) all the assemblers at once.
Several mods, which work fine in the base game, give nonsensical error messages. The only one which I care about is Space Exploration WIP https://forums.factorio.com/viewtopic.php?f=190&t=68319&start=80
space-exploration requires ! but is missing. Others have a ? instead of a !
(Comment)
Error log, although it doesn’t appear related. None of the mods noted here alter recipes, and if I delete the error file and only enable recipe/item mods no errors occur.
Mod list
Vauge hover Error messages
My guess is that something is reading the prerequisites wrongly, and hence disabling them when it shouldn’t. Especially in that the ? implies it should be optional (since that is how factorio shows optional requirements) and also the lack of a name for the second and third.
Edit: After manually removing all prerequsites, it loads fine, mostly. but the recipes don’t show up normally. You have to go into the recipe tab and find them, instead of dragging ingredients/products. Also they get a red outline. And some icons are missing, which are not missing ingame. Also none of the mod assemblers show up.
It seems that "Display Assemblers" controls the display of the needed Miners for the resource outputs, as opposed to what I would assume is expected behavior of it displaying with "Display Miners/Pumpjacks".
There should be an option to draw graphs horizontally instead of vertically. The lines that connect nodes should go into the left and come out the right side.
The advantage of this is that screens are usually wider than they are tall so there would be more room to show larger graphs.
Hi
Trying load py-mods with lastest version 0.18.35 game working with mods but foreman not showing up.
Files meybe help debug-some errors.
Trying build Factorio sheet py-mods so easier know what is connected.
mod-list.zip
errorlog.zip
Allow user to select a save file from Factorio and use it's mod list to populate the list of mods to enable.
This should also include making Foreman use the mod list from the most recent save (or open game if possible) the default list of enabled mods.
Executing foreman.exe results in a JIT null reference exception. I've attached the error message (error_msg.txt) and the errorlog.txt.
Regarding errorlog.txt - the crash occurs even if I remove the TodoList mod.
Hi!
I'm getting an error on the recipe loading stage.
I've double checked that the game data folder and mods folder are correct.
Btw I love your work, I've used Foreman before and its easily the best Factorio tool I've come across. The ability to move the flowchart around makes it so much more user friendly and easy to understand, compared to other similar tools.
Oh yeah error text:
I hope it's just me being dumb and not figuring out what I did wrong.
************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at Foreman.DataCache.ReadModSettings() in E:\Projects\ForemanGit\Foreman\DataCache.cs:line 392
at Foreman.DataCache.LoadAllData(List`1 enabledMods, CancellableProgress progress) in E:\Projects\ForemanGit\Foreman\DataCache.cs:line 223
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Foreman.ProgressForm.<ProgressForm_Load>d__4.MoveNext() in E:\Projects\ForemanGit\Foreman\Forms\ProgressForm.cs:line 44
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.