Page 1 of 1

YAFC - Factorio calculator/analyser for modded games

Posted: Sat May 23, 2020 4:20 pm
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!


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

Re: YAFC - Factorio calculator/analyser for modded games

Posted: Tue May 26, 2020 2:36 pm
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...

Re: YAFC - Factorio calculator/analyser for modded games

Posted: Tue May 26, 2020 10:12 pm
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.

Re: YAFC - Factorio calculator/analyser for modded games

Posted: Tue May 26, 2020 11:32 pm
by salbris
I've been discussing it a bit with some others here:

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.

Re: YAFC - Factorio calculator/analyser for modded games

Posted: Wed May 27, 2020 11:24 am
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)

Re: YAFC - Factorio calculator/analyser for modded games

Posted: Wed May 27, 2020 12:31 pm
by Impatient
Hey there,

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


- 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: ( ... +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.

Re: YAFC - Factorio calculator/analyser for modded games

Posted: Wed May 27, 2020 4:12 pm
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 if you find more you can post it there!