Foreman 0.1.9 - A factory optimisation tool.

Calculate optimal ratios for feeding recipes, search through the research-tree, specialized tools to view game-information.
Blackence
Fast Inserter
Fast Inserter
Posts: 109
Joined: Thu Jun 05, 2014 4:03 pm
Contact:

Re: A tool to help you optimise your production lines.

Post by Blackence »

Code: Select all

$ ./FactorioLoader.lua /home/xxx/factorio/data/base/
This runs for a very long time, but never prints anything to stdout. The stacktrace when ctrl+c-ing the script after a few seconds indicates that it's at "./library/loader/loader.lua:98". Maybe an infinite loop, or is it really that slow?

Anyway, the good news is that I managed to add compatibility lua code to Foreman, so now it works for me. I also added support for the new zip-file mod format. I want to publish the source code somewhere and test if it works on windows, then I can post an updated version here.

Edit/Update: I've verified that the Foreman.exe file works on Windows for Factorio 0.11.6 after adding a fix for a long-standing bug that Nicksaurus fixed a long time ago, but I forgot to do the same in my source copy. I have not tested if it still works after downloading a zip file mod. It might crash because it can't find SharpZipLib. See attachment. :-)

For Ubuntu Trusty, I've uploaded a new package earlier today. That one should work with zip file mods, at least it works for me. Maybe you need apt-get dist-upgrade instead of apt-get upgrade.

Almost forgot this: The code for this updated version is now at github: https://github.com/w-flo/Foreman
Attachments
Foreman_20141214.zip
Updated Foreman
(157 KiB) Downloaded 1636 times

User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12889
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: A tool to help you optimise your production lines.

Post by ssilk »

Blackence wrote:

Code: Select all

$ ./FactorioLoader.lua /home/xxx/factorio/data/base/
This runs for a very long time, but never prints anything to stdout. The stacktrace when ctrl+c-ing the script after a few seconds indicates that it's at "./library/loader/loader.lua:98". Maybe an infinite loop, or is it really that slow?
Interesting. Well, the "base"-mode searches for it's dependencies, which is "core". It reads the info.json-file to solve those conflicts. I haven't built in a check for this kind of endless loop yet.

This lib (loader.lua, see link) is thought so, that you can use it in any lua-program, it just needs the base directories as base params and it will fill the global data-array for you. The FactorioLoader.lua itself is just a wrapper, which does the xml, json and other output, so that you can see, how must be used.

So use instead

Code: Select all

$ ./FactorioLoader.lua /home/xxx/factorio/data/base/ /home/xxx/factorio/data/core/
(or the other way around) and it should work as expected. :)

I will make a fix for that (https://github.com/alexaulbach/Factorio ... loader.lua around line 100), so that it uses a counter and throws useful error messages.
Edit/Update: I've verified that the Foreman.exe file works on Windows for Factorio 0.11.6 after adding a fix for a long-standing bug that Nicksaurus fixed a long time ago, but I forgot to do the same in my source copy. I have not tested if it still works after downloading a zip file mod. It might crash because it can't find SharpZipLib. See attachment. :-)
Nice to hear that. :)
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...

YuokiTani
Smart Inserter
Smart Inserter
Posts: 1037
Joined: Thu May 08, 2014 7:57 pm
Contact:

Re: A tool to help you optimise your production lines.

Post by YuokiTani »

any idea why it crashes with factorio 11.8 and with 10.X works fine - or only my factorio-version with mods ?

User avatar
Omgalof
Burner Inserter
Burner Inserter
Posts: 8
Joined: Sat Jan 17, 2015 4:30 pm
Contact:

Re: A tool to help you optimise your production lines.

Post by Omgalof »

ludsoe wrote:Image

I get this error, with and without mods installed.
i get the same error using v0.1.5 but if i build it from source i get no error at all

and for some reason is is not showing mod items icons
image
and here is the error log(if it is of any use)
log
just my 2 cents but the entity lua files that it are not loading might be because they may need to be loaded after the core game files.

GopherAtl
Fast Inserter
Fast Inserter
Posts: 177
Joined: Sat Jan 31, 2015 7:54 pm
Contact:

Re: A tool to help you optimise your production lines.

Post by GopherAtl »

quick scan of the thread and I didn't see anyone reporting it already, apologies if I missed it.

Trying to run the app crashes with a .net exception "Could not find a part of the path [...]" where the path is in ~AppData\Roaming. I'm using the portable version of factorio (the .zip rather than .exe download), so there is no factorio directory in AppData on my system, which is probably the problem.
My Mods:
Nixie Tubes - numeric displays for your circuit networks!
Logistic Combinators - use logistics values in circuit logic! -
Autowire - automate red/green wire connections

Nicksaurus
Long Handed Inserter
Long Handed Inserter
Posts: 55
Joined: Thu Aug 28, 2014 12:56 pm
Contact:

Re: A tool to help you optimise your production lines.

Post by Nicksaurus »

Right. I'm releasing a new version. Sorry about the delay (I wish I had an excuse for abandoning the project for 4 months, but I don't. Sorry).
GopherAtl wrote:quick scan of the thread and I didn't see anyone reporting it already, apologies if I missed it.

Trying to run the app crashes with a .net exception "Could not find a part of the path [...]" where the path is in ~AppData\Roaming. I'm using the portable version of factorio (the .zip rather than .exe download), so there is no factorio directory in AppData on my system, which is probably the problem.
This should be fixed in the new version (I say 'should' because I haven't actually tested it with the zip package).

Nemoricus
Fast Inserter
Fast Inserter
Posts: 214
Joined: Mon Jan 19, 2015 7:48 am

Re: Foreman - A factory optimisation tool. Now 11.X compatib

Post by Nemoricus »

How can I tell the program to look for directories other than the Program Files one? I'm using the .zip downloads for Factorio now, and I can't tell the 1.6 version of Foreman to use those directories instead.

Koub
Global Moderator
Global Moderator
Posts: 7739
Joined: Fri May 30, 2014 8:54 am
Contact:

Re: Foreman - A factory optimisation tool. Now 11.X compatib

Post by Koub »

Hi,

I'm giving a try to that awesome looking tool, and I can't get to run it ... I have read all the thread, and all the open issues on bitbucket, and didn't fint the exact same as mine (even if one looks like) :
Foreman - lua52.JPG
Foreman - lua52.JPG (29.5 KiB) Viewed 22589 times
And the details :

Code: Select all

Consultez la fin de ce message pour plus de détails sur l'appel du débogage
juste-à-temps (JIT) à la place de cette boîte de dialogue.

************** Texte de l'exception **************
System.DllNotFoundException: Impossible de charger la DLL 'lua52': Le module spécifié est introuvable. (Exception de HRESULT : 0x8007007E)
   à KeraLua.NativeMethods.LuaLNewState()
   à NLua.Lua..ctor()
   à Foreman.DataCache.LoadRecipes()
   à Foreman.MainForm.Form1_Load(Object sender, EventArgs e)
   à System.Windows.Forms.Form.OnLoad(EventArgs e)
   à System.Windows.Forms.Form.OnCreateControl()
   à System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
   à System.Windows.Forms.Control.CreateControl()
   à System.Windows.Forms.Control.WmShowWindow(Message& m)
   à System.Windows.Forms.Control.WndProc(Message& m)
   à System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   à System.Windows.Forms.ContainerControl.WndProc(Message& m)
   à System.Windows.Forms.Form.WmShowWindow(Message& m)
   à System.Windows.Forms.Form.WndProc(Message& m)
   à System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   à System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   à System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Assemblys chargés **************
mscorlib
    Version de l'assembly : 4.0.0.0
    Version Win32 : 4.0.30319.18444 built by: FX451RTMGDR
    CodeBase : file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
Foreman
    Version de l'assembly : 0.0.1.1
    Version Win32 : 0.0.0.0
    CodeBase : file:///F:/Factorio/Foreman%200.1.6/Foreman.exe
----------------------------------------
System.Windows.Forms
    Version de l'assembly : 4.0.0.0
    Version Win32 : 4.0.30319.18408 built by: FX451RTMGREL
    CodeBase : file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
    Version de l'assembly : 4.0.0.0
    Version Win32 : 4.0.30319.18408 built by: FX451RTMGREL
    CodeBase : file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System
    Version de l'assembly : 4.0.0.0
    Version Win32 : 4.0.30319.34238 built by: FX452RTMGDR
    CodeBase : file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Core
    Version de l'assembly : 4.0.0.0
    Version Win32 : 4.0.30319.18408 built by: FX451RTMGREL
    CodeBase : file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Configuration
    Version de l'assembly : 4.0.0.0
    Version Win32 : 4.0.30319.18408 built by: FX451RTMGREL
    CodeBase : file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
    Version de l'assembly : 4.0.0.0
    Version Win32 : 4.0.30319.34234 built by: FX452RTMGDR
    CodeBase : file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
NLua
    Version de l'assembly : 1.3.0.0
    Version Win32 : 1.3.0
    CodeBase : file:///F:/Factorio/Foreman%200.1.6/NLua.DLL
----------------------------------------
KeraLua
    Version de l'assembly : 1.3.0.0
    Version Win32 : 1.3.0.0
    CodeBase : file:///F:/Factorio/Foreman%200.1.6/KeraLua.DLL
----------------------------------------
mscorlib.resources
    Version de l'assembly : 4.0.0.0
    Version Win32 : 4.0.30319.18408 built by: FX451RTMGREL
    CodeBase : file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/mscorlib.resources/v4.0_4.0.0.0_fr_b77a5c561934e089/mscorlib.resources.dll
----------------------------------------
System.Windows.Forms.resources
    Version de l'assembly : 4.0.0.0
    Version Win32 : 4.0.30319.18408 built by: FX451RTMGREL
    CodeBase : file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms.resources/v4.0_4.0.0.0_fr_b77a5c561934e089/System.Windows.Forms.resources.dll
----------------------------------------

************** Débogage JIT **************
Pour activer le débogage juste-à-temps (JIT), le fichier de configuration pour cette
application ou cet ordinateur (machine.config) doit avoir la valeur
jitDebugging définie dans la section system.windows.forms.
L'application doit également être compilée avec le débogage
activé.

Par exemple :

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

Lorsque le débogage juste-à-temps est activé, les exceptions non gérées
seront envoyées au débogueur JIT inscrit sur l'ordinateur
plutôt que d'être gérées par cette boîte de dialogue.
Are there prerequisites, of a mandatory configuration for it to work ?

I run Win 7 SP1, I use the installer version of Factorio, updated to latest (0.11.13) unstable version
Koub - Please consider English is not my native language.

Nicksaurus
Long Handed Inserter
Long Handed Inserter
Posts: 55
Joined: Thu Aug 28, 2014 12:56 pm
Contact:

Re: Foreman - A factory optimisation tool. Now 11.X compatib

Post by Nicksaurus »

Koub wrote:---Errors and stuff---
Someone on reddit had the same problem, and he managed to fix it by doing a clean install of visual c++ 2012. Could you let me know if that works for you?
Nemoricus wrote:How can I tell the program to look for directories other than the Program Files one? I'm using the .zip downloads for Factorio now, and I can't tell the 1.6 version of Foreman to use those directories instead.
So you have one installation in program files and one in the zip location? Yeah, currently it only asks you which directory to use if it can't find one in program files.

It's inconvenient, but the workaround until I add an option to change it manually is just to delete or rename the factorio directory in program files. Sorry. (It's on the list though!)

GopherAtl
Fast Inserter
Fast Inserter
Posts: 177
Joined: Sat Jan 31, 2015 7:54 pm
Contact:

Re: A tool to help you optimise your production lines.

Post by GopherAtl »

Nicksaurus wrote:Right. I'm releasing a new version. Sorry about the delay (I wish I had an excuse for abandoning the project for 4 months, but I don't. Sorry).
GopherAtl wrote:quick scan of the thread and I didn't see anyone reporting it already, apologies if I missed it.

Trying to run the app crashes with a .net exception "Could not find a part of the path [...]" where the path is in ~AppData\Roaming. I'm using the portable version of factorio (the .zip rather than .exe download), so there is no factorio directory in AppData on my system, which is probably the problem.
This should be fixed in the new version (I say 'should' because I haven't actually tested it with the zip package).
Well, has now been tested on the .zip package, and it works! :D
My Mods:
Nixie Tubes - numeric displays for your circuit networks!
Logistic Combinators - use logistics values in circuit logic! -
Autowire - automate red/green wire connections

ares0027
Long Handed Inserter
Long Handed Inserter
Posts: 65
Joined: Sun May 04, 2014 6:48 pm
Contact:

Re: Foreman - A factory optimisation tool. Now 11.X compatib

Post by ares0027 »

I LOVE YOU!

thank you for updating it :) it works perfect (so far :P )


edit: why does it ignore all the addons now?

edit2: here is the errorlog.txt

Code: Select all

The following files could not be loaded due to errors:
D:\Program Files\Factorio\data\base\prototypes\entity\demo-enemies.lua (...es\Factorio\data\base\prototypes\entity\demo-enemies.lua:29: attempt to call global 'make_unit_melee_ammo_type' (a nil value))
D:\Program Files\Factorio\data\base\prototypes\entity\demo-turrets.lua (D:\Program Files\Factorio\data\core\lualib\util.lua:2: attempt to call global 'module' (a nil value))
D:\Program Files\Factorio\data\base\prototypes\entity\entities.lua (D:\Program Files\Factorio\data\core\lualib\util.lua:2: attempt to call global 'module' (a nil value))
D:\Program Files\Factorio\data\base\prototypes\entity\turrets.lua (D:\Program Files\Factorio\data\core\lualib\util.lua:2: attempt to call global 'module' (a nil value))
mods i am using are;

Image

n9103
Smart Inserter
Smart Inserter
Posts: 1067
Joined: Wed Feb 20, 2013 12:09 am
Contact:

Re: Foreman - A factory optimisation tool. Now 11.X compatib

Post by n9103 »

I... do not envy your load time. :?
Colonel Failure wrote:You can lose your Ecologist Badge quite quickly once you get to the point of just being able to murder them willy-nilly without a second care in the world.

Nicksaurus
Long Handed Inserter
Long Handed Inserter
Posts: 55
Joined: Thu Aug 28, 2014 12:56 pm
Contact:

Re: Foreman - A factory optimisation tool. Now 11.X compatib

Post by Nicksaurus »

ares0027 wrote:I LOVE YOU!

thank you for updating it :) it works perfect (so far :P )


edit: why does it ignore all the addons now?

edit2: here is the errorlog.txt

Code: Select all

The following files could not be loaded due to errors:
D:\Program Files\Factorio\data\base\prototypes\entity\demo-enemies.lua (...es\Factorio\data\base\prototypes\entity\demo-enemies.lua:29: attempt to call global 'make_unit_melee_ammo_type' (a nil value))
D:\Program Files\Factorio\data\base\prototypes\entity\demo-turrets.lua (D:\Program Files\Factorio\data\core\lualib\util.lua:2: attempt to call global 'module' (a nil value))
D:\Program Files\Factorio\data\base\prototypes\entity\entities.lua (D:\Program Files\Factorio\data\core\lualib\util.lua:2: attempt to call global 'module' (a nil value))
D:\Program Files\Factorio\data\base\prototypes\entity\turrets.lua (D:\Program Files\Factorio\data\core\lualib\util.lua:2: attempt to call global 'module' (a nil value))
mods i am using are;

Image
The code that reads the game data files is pretty broken at the moment. Fortunately, there's a fixed version on my computer that I'll be uploading soon.

ares0027
Long Handed Inserter
Long Handed Inserter
Posts: 65
Joined: Sun May 04, 2014 6:48 pm
Contact:

Re: Foreman - A factory optimisation tool. Now 11.X compatib

Post by ares0027 »

Nicksaurus wrote: The code that reads the game data files is pretty broken at the moment. Fortunately, there's a fixed version on my computer that I'll be uploading soon.

thank you, i will be checking the thread/bitbucket every 5 minutes now :D

Koub
Global Moderator
Global Moderator
Posts: 7739
Joined: Fri May 30, 2014 8:54 am
Contact:

Re: Foreman - A factory optimisation tool. Now 11.X compatib

Post by Koub »

Nicksaurus wrote:
Koub wrote:---Errors and stuff---
Someone on reddit had the same problem, and he managed to fix it by doing a clean install of visual c++ 2012. Could you let me know if that works for you?
Tried it, but doesn't change anything unfortutnately. Do you have another idea ?
Koub - Please consider English is not my native language.

Nicksaurus
Long Handed Inserter
Long Handed Inserter
Posts: 55
Joined: Thu Aug 28, 2014 12:56 pm
Contact:

Re: Foreman - A factory optimisation tool. Now 11.X compatib

Post by Nicksaurus »

New version!

Here: https://bitbucket.org/Nicksaurus/foreman/downloads
Koub wrote:
Nicksaurus wrote:
Koub wrote:---Errors and stuff---
Someone on reddit had the same problem, and he managed to fix it by doing a clean install of visual c++ 2012. Could you let me know if that works for you?
Tried it, but doesn't change anything unfortutnately. Do you have another idea ?
Hmm... did you install the x86 or x64 version? x86 is the one you need (sorry for not specifying that, if that's the issue).

First, you should probably try the version I just uploaded though, since it makes some improvements to the lua code.

Koub
Global Moderator
Global Moderator
Posts: 7739
Joined: Fri May 30, 2014 8:54 am
Contact:

Re: Foreman - A factory optimisation tool. Now 11.X compatib

Post by Koub »

Just tried with 1.7, exactly the same behaviour.

Of course, I installed the x64 version of the Visual C++ 2012 redistribuable :mrgreen:.
I'm downloading the x86 version, and I'll tell you what as soon as it's installed.

[Edit] That was it : Visual C++ 2012 x86 redist seems to be a prerequisite. Thanks a lot :).

Maybe would it be useful to add it in your initial post, so that other people know it's a prerequisite ^^.
Koub - Please consider English is not my native language.

ares0027
Long Handed Inserter
Long Handed Inserter
Posts: 65
Joined: Sun May 04, 2014 6:48 pm
Contact:

Re: Foreman - A factory optimisation tool. Now 11.X compatib

Post by ares0027 »

Nicksaurus wrote:New version!

Here: https://bitbucket.org/Nicksaurus/foreman/downloads

yay for the new version, nay for the fix :( it still does not recognize any of the mods :(

as you can see here, there are no other plates (tin etc) and no upgraded furnaces/drills

Image

User avatar
Omgalof
Burner Inserter
Burner Inserter
Posts: 8
Joined: Sat Jan 17, 2015 4:30 pm
Contact:

Re: Foreman - A factory optimisation tool. Now 11.X compatib

Post by Omgalof »

ares0027 wrote:
Nicksaurus wrote:New version!

Here: https://bitbucket.org/Nicksaurus/foreman/downloads

yay for the new version, nay for the fix :( it still does not recognize any of the mods :(

as you can see here, there are no other plates (tin etc) and no upgraded furnaces/drills
for me it is working fine, using bobo's mods that is.
image

Nicksaurus
Long Handed Inserter
Long Handed Inserter
Posts: 55
Joined: Thu Aug 28, 2014 12:56 pm
Contact:

Re: Foreman - A factory optimisation tool. Now 11.X compatib

Post by Nicksaurus »

ares0027 wrote:
Nicksaurus wrote:New version!

Here: https://bitbucket.org/Nicksaurus/foreman/downloads

yay for the new version, nay for the fix :( it still does not recognize any of the mods :(

as you can see here, there are no other plates (tin etc) and no upgraded furnaces/drills

Image

Are you using the zip versions of the mods? I should have said that won't work, sorry.

Post Reply

Return to “Cheatsheets / Calculators / Viewers”