9 ms·
For those wondering why this game about factory management keeps showing up on the front page of HN, it’s because the gameplay reminds its fans of software engi
by nindalf 5y ago
For those wondering why this game about factory management keeps showing up on the front page of HN, it’s because the gameplay reminds its fans of software engineering in subtle ways. People who are good at one are likely to be good at the other. More about this here - https://blog.nindalf.com/posts/factorio-and-software-engineering/ https://blog.nindalf.com/posts/factorio-and-software-enginee...
- derefr 5y agoAn interesting thing about Factorio to me (beyond what’s stated in the linked article), is that it contains a nearly a perfect 1:1 analogy to software concurrency. • Belts are blocking CSP channels, as seen in e.g. Golang (where N producers have to share — or eventually “merge onto” — one channel representing the blocking-receive point of the consumer; which are best only used to transport messages of a single type, or if not, then the sum-typed channel must be demultiplexed at the end, with this tending to lower throughput; where messages of a given type “queue up” until the channel is full, and then all producers block when attempting to write to the channel; where if you’ve got producers producing at different rates, then the fastest ones can hog the capacity of the channel, decreasing throughput and unevenly spending input resources such that some components fail long before others; where the solution to this is to give each producer its own bounded outbox channel that multiplexes onto the consumer’s channel, such that the producer will block itself rather than blocking its siblings; etc.) • Logistics robots are message-queue topics (where N producers can publish messages of a given type, without worrying about how they’ll get to a consumer; where consumers [demand chests] subscribe to specific event message types; where the bus itself can get overloaded, causing delivery failures of unrelated topics as delivery-threads sit around holding a message unable to deliver it; where the solution to this is to add reliable MQ-internal storage [network-linked storage chests] for the agents to offload produced messages to until demand comes for them.) (Sadly there’s no exact equivalent to Erlang-style message-passing, where producers target messages of arbitrary type at a specific consumer, which all go to the consumer’s single inbox; and where, if that inbox is full, then the message just “evaporates” en route, since the passed message has async semantics where the producer isn’t linked to its delivery. But, interestingly, that type of concurrency totally could be added, with a not-even-very-complex mod — just add a “outbox” chest object that can be configured to “target” a specific “inbox” chest somewhere else; and a second type of logistics robot that only moves stuff from outbox chests to inbox chests, not according to “demand” but just because anything currently sitting in an outbox chest is “intended to be” in the corresponding targeted inbox chest; and then ensure that this alternate type of logistics robots have non-reliable delivery semantics, where if the “inbox” chest signals to the network that it’s full, then all active delivery-threads targeting that inbox will literally “drop their messages on the ground”.) IMHO it’s actually possible to learn how to be an effective distributed-systems engineer, just by playing Factorio and trying to scale the throughput of a resource-constrained system. In the process, you’ll likely re-invent many real-world concurrent software design patterns. Doing this first, and then reading a Distributed Systems textbook, will have a much more visceral impact on you, because you’ll have already faced these problems, struggled with them, and now you’re being handed all the techniques for solving them on a silver platter.
- TOGoS 5y agoI wanted, but never got around to, creating a mod that accepts some kind of data outside the game (lines of text, JSON objects, packets from the TUN driver, whatever), wraps them up as Factorio objects, and plops them onto a belt, and another that reads them and sends them back out. The idea being that this could be (A) a cool hack (belt speed factoring into ping time, lmao), but (B) a way to visualize data flow in complex queue systems.
- Buttons840 5y agoOh, that would be cool. You could implement sorting algorithms and such.
- FredPret 5y agoHell, why not turn Factorio into a programming language? If you can translate a real-world problem to in-game problems, it'd be so much fun to solve them that you'd probably launch a new epoch in human history - the Factorio Age
- kortex 5y agoSounds a lot like clustorio. https://mods.factorio.com/mods/Danielv123/clusterio https://mods.factorio.com/mods/Danielv123/clusterio
- m0ngr31 5y agoI've seen this said literally hundreds of times and can only imagine that these comments are hyperbole now. I've given Factorio dozens of shots now, and have played for hours and hours with people who are great at the game, but it just isn't for me. I get bored in the monotony of the early game, and I'm too stupid to keep things going in the mid game.
- scrollaway 5y agoI don't think there's a statement in there about enjoying the game, just the shared skillset and mindset. :)
- m0ngr31 5y agoMaybe that's why I don't enjoy it... Feels like I could be getting work done on any of my side projects when I play. Don't have that same feeling when I'm playing other games. That being said, I do enjoy it at LAN parties because I just build walls and hunt biter nests
- scubbo 5y agoThe comment that really made it click for me is that there are two diametrically opposed responses for engineers playing Factorio: * "This game is scratching the same itches as my day job, but with more dopamine and less bureaucracy - how can I play this all the time?" * "This game requires me to expend the same brain-effort as my work/side-projects, but I don't even get anything tangible out of it? Why would I ever 'play' this?" Neither of them are wrong - and I suspect that the same person might even have different reactions at different points in their life.
- imiric 5y agoI'm square in the second group. Factorio is fun for a while, but after somewhere around mid-game you realize that it's much more frustrating and less enjoyable than actual programming. I can't easily "refactor" parts of my factory without fearing it will break some pipeline that depends on the changes. I wish there was a way to "write" "tests" or do mass changes safely. Blueprints and robots help automate things, but it's not that flexible. I wish I could use a "debugger" and step through the execution and play with changes to see how it affects the factory. And then I finally get to the conclusion that this would all be easier from a text editor using proper programming tools, and more enjoyable to work on a real project that could have tangible benefits (and then never finish that either...).
- RangerScience 5y agoThere are two kinds of programmers, Those who look at Factorio and go: "That's my day job! Why would I do it for fun?" and those who look at Factorio and go: "That's my day job! You mean I can do it for fun?!"
- nthj 5y agoMy day job is getting alignment and approvals on fixing things. Factorio is deciding to fix something and then doing it.
- erjiang 5y agoHave you tried Factorio multiplayer? I tried it with some other people and it really is like real life. Somebody put in an ugly hack to deal with scaling rather than rearchitect? Well, I'd like to fix it but it'll mean downtime that'll interrupt player 2's OKR of getting the rocket control units made. Plus, we didn't allocate enough space, so I need to talk to player 3 who owns the adjacent area (and whose functionality I don't understand). Player 3 doesn't like the idea of moving or redesigning that area, so I'm going to try asking Player 2 or Player 4 to help me rebuild it in an undeveloped area. Building the new section while the old section is still running has overdrawn on our electricity capacity, which has been oversubscribed for a while but we just kept accumulating tech debt on electrical with ugly hacks. Which brings me back to step 1.
- organsnyder 5y agoExactly. I can completely disrupt my factory to refactor it for hours without worrying about pesky end-users and other stakeholders.
- munchbunny 5y agoHaving a PM to help me stay focused would not be a bad thing when I play Factorio. However, that would probably come bundled with having a PM constantly ask me to half-ass (I mean MVP) three different new projects in the factory in the time it would normally take me to full-ass one project.
- DonHopkins 5y agoProgrammer Crack
- taneq 5y agoSubtle and not so subtle. I'm pretty sure someone's implemented Tetris in it.