YAFC - Factorio calculator/analyser for modded games

Calculate optimal ratios for feeding recipes, search through the research-tree, specialized tools to view game-information.
ShadowTheAge
Inserter
Inserter
Posts: 30
Joined: Fri Mar 04, 2016 12:58 pm
Contact:

YAFC - Factorio calculator/analyser for modded games

Post by ShadowTheAge »

After playing a bunch of Pyanodon and struggling with its deeply recursive recipes when Helmod were not enough, I have decided to make my own calculator / analyser tool. As usual it took a lot longer than expected (almost 2 months) but it was a lot of fun!

Image

More gifs here (traffic warning!)

YAFC is written with two primary goals: To work with modded games, and to help the user to make educated choices while exploring unknown mod packs.

So YAFC is not just a calculator, it contains multiple complex analysis tools and really tries to understand what is going on in the modpack. It even estimates the amount of resources generated by the map generator, and it also simulates hypothetical late-game base to understand how much of everything do you need, what is the best recipe to make what, what are locked behind different science packs, how much of everything do you need, etc.

For example YAFC also contains "Never Enough Items Explorer" tool that (similar to FNEI) shows you how to produce and consume everything, but with additional information like recipe efficiency, and how "important" the recipe is (For vanilla game example, it knows that about 80% of petroleum gas is going to plastic, and about 80% of plastic is going to advanced circuits)

As a calculator, the two main features are great handling of recursive recipes and the ability to organise recipes in nested sheets so that (for example) green circuits can have its own copper cable production, not mixing with copper cables for other uses.

There is also a cool small "auto-module" feature that assigns productivity modules to recipes that benefit the most from them with a single slider "How many modules do you want?"

It is the first beta release. I have found and fixed a lot of incompativilities with Factorio mods, but probably not all of them, so it is expected that YAFC may not work with some (especially less popular) mods. But hopefully I could fix more incompatibilities in the following weeks. Other bugs are also possible!

YAFC is a desktop app for Windows, and there are also Linux and OSX experimental builds!

You can read more, look at more gifs, and download it on Github
salbris
Inserter
Inserter
Posts: 43
Joined: Sun May 24, 2015 4:50 am
Contact:

Re: YAFC - Factorio calculator/analyser for modded games

Post by salbris »

Holy shit! Excellent work the UI looks slick!

It looks like a bunch of us keep writing the same code to parse mod data. I wonder if the community should try to build a generic utility to generate item and recipe data...
ShadowTheAge
Inserter
Inserter
Posts: 30
Joined: Fri Mar 04, 2016 12:58 pm
Contact:

Re: YAFC - Factorio calculator/analyser for modded games

Post by ShadowTheAge »

Probably the reason is this looks like a quite simple task while it actually not at all because mods are relying on every implementation detail there is and crash when it changes.

However, I think I have advanced one of the fathest. I even have custom Lua build that emulates changes to Factorio next() iterator. I think that I have compatibility with at least 95% of the mods (Including all the popular ones like py, angel, bob, IR, omni, bio industries, krastorio, 5dim) and I have checked lots of them (Plus some users on github have added some more)

About the ui, it is 100% custom, written for this project, up to text editing cursor blinking. It is very simplistic (from the coding perspective), lacks functionality (e.g. multiline text editing does not exist) lacking in things like keyboard controls, but it is very easy to write code for.
Actually, the UI renderer can only draw colored rectangles, text, 32x32 icons and shadows. It also only knows about 24 colors (some of them are duplicates), however icons can be colorful.
salbris
Inserter
Inserter
Posts: 43
Joined: Sun May 24, 2015 4:50 am
Contact:

Re: YAFC - Factorio calculator/analyser for modded games

Post by salbris »

I've been discussing it a bit with some others here: https://github.com/factoriolab/factorio-lab/issues/72

I don't know which should become the "standard" but I like how the tool referenced in that thread is standalone and just produces JSON.
ShadowTheAge
Inserter
Inserter
Posts: 30
Joined: Fri Mar 04, 2016 12:58 pm
Contact:

Re: YAFC - Factorio calculator/analyser for modded games

Post by ShadowTheAge »

I think the standard should be "compatible with data.raw"
Even if it is json

so the result will be {raw:{item:{"electronic-circuit":{...}...}...}

So the format would be well-documented on Factorio wiki, and new fields will have well-known names
And also the parser could be reused both ways (just swap lua table with json or vise-versa)
User avatar
Impatient
Filter Inserter
Filter Inserter
Posts: 883
Joined: Sun Mar 20, 2016 2:51 am
Contact:

Re: YAFC - Factorio calculator/analyser for modded games

Post by Impatient »

Hey there,

great to see someone taking a new approach on a calculator. I am already testing YAFC. Here is some feedback:

Bugs

- The amount of assemblers is calculated wrongly. I observed this with vanilla assemb mk3 + 4 prodmods mk3, 8 beacons + 2 speedmods mk3. It gives almost double the amount of assemblers needed. For comparisson the results of kirks calculator: ( https://kirkmcdonald.github.io/calc.htm ... +zxRzSCw== ), which I tested and verified in-game.

- Pressing backspace in the item ammount input field when it is empty throws and catches an exception.
ShadowTheAge
Inserter
Inserter
Posts: 30
Joined: Fri Mar 04, 2016 12:58 pm
Contact:

Re: YAFC - Factorio calculator/analyser for modded games

Post by ShadowTheAge »

For beacons: Forgot to take in account the amount of modules per beacon, thanks :D (So, now the meaning is "beacon modules")
For exception: I wasn't able to reproduce with backspace, but I was able to reproduce with "left arrow", thanks
Both are fixed for the next release

BTW, I am monitoring issues on Github https://github.com/ShadowTheAge/yafc/issues if you find more you can post it there!
FritzHugo3
Fast Inserter
Fast Inserter
Posts: 133
Joined: Tue Jan 09, 2018 4:30 pm
Contact:

Re: YAFC - Factorio calculator/analyser for modded games

Post by FritzHugo3 »

I dont undrstand how i start the program, ony that i found are an "build.bat" with a dos window.
Why we can not have a setup.exe oder yafc.exe or something what shows the normal user click me to start the program.
Not userfreindly. And found no description on your Github site (for all are description but not for start the program).

But what i saw at the picture it is absolut great.


EDIt: Found out (with a friend) the startsite are not the workable windows version (click on "code" download zip (the normal usual way) are wrong.
Right the little "version" link are so hidden - please write a Link for the users in the description. Nowbody can find this simple.


Error by starting - Kux-BlueprintExtensions, module/actions.lua:22... a nil value
Is there no way to say if error ignore this?
So i have delete Kux but than YAFS say he want it ^^. So i must start Factorio and close it directly for this problem - After this the program loaded.

A big problem what i see here in this program. Why you can say use this savegame? You can have 500 Mods in the mod folder but use maybe only 50 in a savegame plus with configs in a save you chance thigs too. So this is for me the must reason that the program should read the data from a savegame and not the hole Mod folder.
Only with the directory from the mof folder YAFC cant now, which mods are active in a Player game.

The Windows "Add desired product" its verry smal and have no sorting. If ther are not mayble to get all this in game Categorys like ingame? If you dont now the right english name, you have no chance to find anything - so if you play in german, you dont now the englisch right words. Its absolut not userfreindly this "ad desired product"

Were are the button to expand all automaticle -yes there are multiple recipes so the program could ask for this. But why i must klick on all mittle step. I dont want to click manual alltime at green chip, than copper cable, ... i want say the end product and the calculator gives me the 100 steps (and if there are musliple recieps i want say this one time and the calculator shoul rembembr this). (And how i can say exclusiv a mod/Recieps).

For the ground idear and what the program all can do - absolut respect this is great. and i love sheets like this https://kirkmcdonald.github.io/calc.htm ... ircuit:f:1 maybe this are a thing for YAFC? It would be cool. For Mods this are not avaible now i thing. You could be the first.
User avatar
MEOWMI
Filter Inserter
Filter Inserter
Posts: 337
Joined: Wed May 22, 2019 12:21 pm
Contact:

Re: YAFC - Factorio calculator/analyser for modded games

Post by MEOWMI »

I have to say this is by far the best Factorio calculator I have seen.

Every other calculator seizes up after I throw a complex optimization problem at it, but not this tool. Admittedly sometimes I need to prod around a bit, when I get it stuck with impossible inputs, but the important part is that it just works.

Sometimes I use Foreman instead, since it allows me to do some graphical layouts of builds quickly, but even it freezes up completely when I give it a complex enough production line. For every other more simple situation, quick maths, or Rate Calculator, work perfectly. But this tool really is in a league of its own.

Thank you!
Post Reply

Return to “Cheatsheets / Calculators / Viewers”