October 18th, 2024

Factorio – Visualizing construction material dependencies

The discussion highlights Factorio's gameplay, focusing on resource automation and complex dependencies. Sander Huisman shares code for visualizing these relationships using Mathematica, emphasizing the game's addictive nature.

Read original articleLink Icon
Factorio – Visualizing construction material dependencies

The discussion focuses on the game Factorio, where players must build a factory to create a rocket and escape a planet. The game involves mining resources, automating production, and managing complex dependencies among various materials and components. The author, Sander Huisman from the University of Twente, shares code that interprets the Factorio wiki to visualize these dependencies. By using Mathematica's graph technology, the code generates dependency trees for different science packs and other components, illustrating the intricate relationships between items needed for production. The complexity of the game is highlighted through examples of various science packs and the satellite, which requires numerous resources to create. The post concludes with a warning about the game's addictive nature and encourages exploration of its various elements.

- Factorio requires players to automate resource production to build a rocket.

- The game features complex dependencies among materials and components.

- Mathematica's graph technology is used to visualize these dependencies.

- The author provides code to generate dependency trees for different items.

- Factorio is noted for its addictive gameplay.

Link Icon 18 comments
By @dimava - 6 months
The most advanced calculator for Factorio is definitely YAFC, "Yet Another Factorio Calculator", based on Google's OrTools solvers [https://github.com/shpaass/yafc-ce] (gifs readme at [https://github.com/shpaass/yafc-ce/blob/master/Docs/Gifs.md])

The flowcharts are generally made with Foreman2 [https://github.com/DanielKote/Foreman2], yet another external tool

Both the calculator websites, https://factoriolab.github.io and https://kirkmcdonald.github.io also have both Sankey and Box-line flow diagrams

In-game calculator mods are Rate Calculator (that just shows the production ratios of selection), Helmod and Factory planner, don't have flow diagrams afaik

---

But with the new 2.0 DLC Quality and Recycling mechanics which makes every graph connection quintuple and bidirectional, the difficulty to calculate what's the best way to craft something of high quality is going to skyrocket

By @karamanolev - 6 months
Side note, Factorio 2.0 + Space Age is coming in a few days (Monday, the 21st). Ardent players, be ready to press the pause button on your non-factory life and dive deep.
By @jnwatson - 6 months
There are several Factorio dependency trackers and calculators already. Importantly, there are several mods that make the vanilla game's graph look like child's play.

The real innovation was just teased at the end. Balancers (systems of belts and splitters than evenly distribute the contents of n belts to m belts) are tricky to get right and compact and so far as I know are only human-designed. A mechanism to automatically design them would be very interesting.

By @dmurray - 6 months
When I saw the domain I assumed it would be Stephen Wolfram's blog and he'd soon be detailing how, instead of writing a dozen books and developing a new kind of science and changing the way all of computing works, he'd spent 5 years building the bestest Pyanodon megabase.
By @perihelions - 6 months
For those unfamiliar, there's alternatively a standard FOSS tool, graphviz, that's roughly equivalent to what these Wolfram examples do. It has a trivial syntax: this is a complete example that draws exactly what it says,

    digraph { a -> b -> c -> a }
Here's minimal syntax for drawing directed graphs with image nodes, in the style the Wolfram example uses:

    digraph {
        node [label="", style="none", shape="plaintext",
              fixedsize="true", imagescale="false",
              width=1.0, height=1.0]
        copper_plate [image="Copper_plate.png"]
        copper_cable [image="Copper_cable.png"]
        copper_plate -> copper_cable [label=" 50 trillion"]
    }
By @MaxikCZ - 6 months
By @nusl - 6 months
With Satisfactory's recent 1.0 release and Factorio 2.0's upcoming release, I'm really loving that factory games are being recognised more widely. They're incredibly fun, addictive, and rewarding. I've sunk quite a lot of time into Satisfactory but less into Factorio. Perhaps 2.0 is a good time to start.

Satisfactory has a range of useful tools like this to plan your factory (if you don't want to do it manually), and they can quickly explode in complexity.

At first it's mind-bogglingly daunting but breaking it down into smaller parts then addressing them down the DAG makes it more digestible. When you finally complete an end goal it's very satisfying.

By @Seb-C - 6 months
I am developing a game called Astral Divide, which has in common with Factorio to have factories and a tech tree.

Until this week, I had a fancy tree visualization similar to the article's content (except that the location of the nodes was hardcoded). I spent quite some time to implement it and get it right, and it was difficult to maintain and update when adding new content.

Also, one feedback that I got from early testers is that this is confusing, and they didn't know how to read it.

I think that the main problem is that in such a graph, it is difficult to know if a branch means "A is an ingredient to make B" or "A is a machine that you can use to make B".

I spent time this week replacing it with a dumb list showing individual recipes in the form of an equation like "A = B + C", and I find it not only easier to understand, but also way cheaper to maintain.

You can see the previous version in one of the screenshots (fifth thumbnail): https://store.steampowered.com/app/2597060/Astral_Divide/

And the first draft of the new version: https://mastodon.gamedev.place/@sebc/113327870376150885

By @red_admiral - 6 months
Good graphs, but if possible I'd have put labels on the edges showing resource required per second or something like that to keep the production line running. Some of these need a lot more iron than others.

Then you can go figure out how many iron ore mining drills you need to keep a purple science factory running.

By @jeffhuys - 6 months
Oooh, I love Factorio, code, and graphs. What a treat! This'll come in handy soon; JUST finished my starterbase and want to use it to create a "megabase" (or probably "mediumbase" since it's my first time).

Thank you for sharing!

By @teekert - 6 months
Those are Directed Acyclic Graphs (DAGs), like used in make, and Snakemake. No mention of that word though. There are some nice libraries and visualization tools for DAGs.
By @fergie - 6 months
Is Factorio HNs favourite game or is it Civ V?
By @seanhunter - 6 months
This is perfect timing - just when Space Age is about to come out.
By @cetu86 - 6 months
Wow, looks nice! Can you do that for SE and add quantities?
By @ilrwbwrkhv - 6 months
Wolfram and Mathematica are such interesting tools. Maybe one of the only two tech companies that won capitalism along with Valve.
By @Nihal_rg - 6 months
Where can I buy/install this game?