As you might have heard me and my roommate (a CE and IE in training) are building a MRP system for factorio,
right now it can calculate any arbitrary demand for any item in vanilla, and soon will be able to calculate an "optimal" tech tree
however we're not happy with that, our plan from the get go, was to get this program able to read the mods folder, and pull recipes, techs, and resources from the mod and load it into itself...
We're having issues with the loading of resources, but other than that (meaning manually added) it plays nice with a few mods (most notably Dytech)
however, since there is no file path requirement for the mods (lua doesn't care as long as you know where they are) i have to do more work (I'm looking at you treefarm >.>)
we're a ways from release of a working version, but i wanted to know the demand (heh) for this, it's written is a bastard mix of C and VBA, ran from excel,
if you have a test case you want me to run from vanilla or dytech (e.g. 1 rocket-defence every 3600 seconds) it's output is in assembly speed (assembly 1 = .5 assembly 2 = 0.75 assembly 3 = 1.25)
if you want me to test whether a mod plays nice, if it has a mediafire link, i can't get to in on campus, and i'm here until dec 23, otherwise i'll give it a shot
finally if you are a mod owner, please for the love of my sanity, put recipes in /prototypes/recipes, tech is /prototypes/technology, and resources in /prototypes/entities like the base game (T_T)
Manufacturing Resource Planning tool
-
- Filter Inserter
- Posts: 310
- Joined: Fri Nov 07, 2014 3:46 am
- Contact:
-
- Filter Inserter
- Posts: 778
- Joined: Sun Sep 07, 2014 12:59 pm
- Contact:
Re: Manufacturing Resource Planning tool
You should never hardcode paths like this if it isn't strictly required. And it isn't required for factorio mods, because what is required is that there is a data.lua in the mod's root directory. This may directly contain all kinds of definitions, or it may contain include statements that will get processed by the game (and thus, should be processed by your tool).LordFedora wrote: finally if you are a mod owner, please for the love of my sanity, put recipes in /prototypes/recipes, tech is /prototypes/technology, and resources in /prototypes/entities like the base game (T_T)
I don't have OCD, I have CDO. It's the same, but with the letters in the correct order.
Re: Manufacturing Resource Planning tool
OFF-TOPIC
This is how the loader works:
1. Lookup in all relevant pathes. That can be normally only the local or user mods-dir and the game mods dir (installed Win version).
2. Give a list of the paths to the loader.
3. The loader unpacks and includes all data.lua in the right order (of dependencies)
4. and executes it in LUA.
5. Afterwards a big, nested variable is generated, which includes all the needed configuration information about the modules.
I point again to https://github.com/alexaulbach/FactorioLoaderLib
This does add some more info to this data-structure (about, which mods are loaded etc.) but it currently doesn't find all mod-paths (you need to give it over) and also cannot unzip the mods. But It works quite well for 0.11 on Mac (and should do also on Linux). I didn't test it on Win.
Example output is here for example json: https://github.com/alexaulbach/Factorio ... -data.json
But there is also XML, which is - together with XPATH really mighty. To output all reciepes:
My concrete current plan is to group all entities and join the different types of all entities together, so that there is not
* steam-engine :: smoke
* steam-engine :: generator
* steam-engine :: electric
* steam-engine :: recipe
but
* steam engine
*** smoke
*** generator
*** electric
*** recipe
More off-topic
I have time between the years, and develop now since more than half a year on this problem to generate useful output from this configs, and I use this also to learn about different new stuff, which is also important for my work.
My last 2 month I learned much about XSLT to find out, that the resulting code to do this job will look so complex, that nobody ever will maintain it.
(I showed the code of some example transisition to some experts in my company and they didn't understand it and after I explained the problem, they said, yes, this is a case, where XSLT really sucks.
) I switched now back to a "normal" programming language which is good in handling strings.
This is how the loader works:
1. Lookup in all relevant pathes. That can be normally only the local or user mods-dir and the game mods dir (installed Win version).
2. Give a list of the paths to the loader.
3. The loader unpacks and includes all data.lua in the right order (of dependencies)
4. and executes it in LUA.
5. Afterwards a big, nested variable is generated, which includes all the needed configuration information about the modules.
I point again to https://github.com/alexaulbach/FactorioLoaderLib
This does add some more info to this data-structure (about, which mods are loaded etc.) but it currently doesn't find all mod-paths (you need to give it over) and also cannot unzip the mods. But It works quite well for 0.11 on Mac (and should do also on Linux). I didn't test it on Win.
Example output is here for example json: https://github.com/alexaulbach/Factorio ... -data.json
But there is also XML, which is - together with XPATH really mighty. To output all reciepes:
Code: Select all
[~/Work/FactorioLoaderLib] > xpath tmpdata/factorio-data.xml //recipe
recipe>
<night-vision-equipment>
<enabled>false</enabled>
<type>recipe</type>
<name>night-vision-equipment</name>
<result>night-vision-equipment</result>
<energy_required>10</energy_required>
<ingredients>
<ingredients>
<ingredients>advanced-circuit</ingredients>
<ingredients>5</ingredients>
</ingredients>
<ingredients>
<ingredients>steel-plate</ingredients>
<ingredients>10</ingredients>
</ingredients>
....
* steam-engine :: smoke
* steam-engine :: generator
* steam-engine :: electric
* steam-engine :: recipe
but
* steam engine
*** smoke
*** generator
*** electric
*** recipe
More off-topic
I have time between the years, and develop now since more than half a year on this problem to generate useful output from this configs, and I use this also to learn about different new stuff, which is also important for my work.
My last 2 month I learned much about XSLT to find out, that the resulting code to do this job will look so complex, that nobody ever will maintain it.


Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
-
- Filter Inserter
- Posts: 310
- Joined: Fri Nov 07, 2014 3:46 am
- Contact:
Re: Manufacturing Resource Planning tool
ssilk, we have unziping down (c can't do it either, so my roommate does it in VBA)
and if your thing can categorize it by type (recipe, tech?, resource specifically
)
then i might need to a full refactor soonish (^_^)
and if your thing can categorize it by type (recipe, tech?, resource specifically

then i might need to a full refactor soonish (^_^)
Re: Manufacturing Resource Planning tool
I told that now three times, that I will soon have some converter, which can output technical wiki pages, but - well, there is the job and other interesting stuff, like XSLT.
So I won't promise it now again.
But yeah, I have some days time after Christmas, so yeah, I will try the best I can, but it will take a month or so, cause at the end of year there is really no time.
If you have special needs to the format you need just PM.


So I won't promise it now again.

But yeah, I have some days time after Christmas, so yeah, I will try the best I can, but it will take a month or so, cause at the end of year there is really no time.
If you have special needs to the format you need just PM.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...