Factorio Automated: A 1000SPM self-expanding factory built with bots and Lua

preview_player
Показать описание

The scenarios:

If you want to transplant the root megatile to a new scenario, there are a lot of steps. You'll obviously need to copy-paste it, but make sure to bring over the blueprint book from the Blueprint Deployer, throw a stack of heavy oil barrels in one of the storage chests and put at least one logistic bot in one of the Roboports to bootstrap things. The pins the algorithm puts on the map also won't line up if you move the root megatile, so you'll need to adjust the variables PIN_OFFSET_X and PIN_OFFSET_Y in the Moon Logic combinator until they line up.

The save files (these are with the factories producing 1000SPM) may be easier to get running:

How this was recorded:
For clips where I'm talking about UPS on my M1 Max MacBook Pro, I recorded using a 4K30 capture dongle with screen mirroring turned on to force the resolution (since the Macbook Pro screen isn't actually 3840x2160). However I wanted 4K60 for as many clips as possible, so for all the other footage I used my Windows desktop (Intel 8700K) and used a GTX1080 for rendering the game and an RTX2080Ti for encoding the footage in the highest quality I could. I used OBS for all captures and edited in Adobe After Effects.

References:

FAQs that aren't answered in the video:

Q: How long did this take to make?
A: I started in 2021, I spent about 2 months on the initial trains-and-belts factory, then another month or two on the bot-based factory. Over the course of the past couple years I probably spent about six months total working on this, but most of that was tweaking and minor improvements.

Q: What's with the name?
A: The bot-based factory is called "Von Noying", a name that references the concept of "Von Neumann Probes" and which I came up with when I was frustrated with an issue I was running into. That name is all over all of my files now, so it's the one I'm stuck with. Notably, I worded the whole script to avoid saying the name because I'm honestly not in love with it.

Q: What are those two lines of lights on the root megatile?
A: Those keep track of the percentage of idle logistic bots. I keep those lights on their own power network so I can use the graph of their power usage to measure whether the factory has enough logistic bots over time.

Q: What's the deal with those two nuclear-related tiles in the root megatile?
A: Those were initially designed to be stamped out by the algorithm, but finding a good "build condition" for the uranium enrichment tile in particular proved difficult. In the end I discovered that one of each tile is enough to fuel 1000SPM worth of nuclear megatiles, so I just kept them in the root megatile to simplify things.

Chapters:
0:00 Introduction
0:45 Mods used
1:33 Part 1: The Design of the Factory
1:36 The Algorithm
3:10 Manufacturing Tiles
4:24 Solar Megatiles
4:54 Nuclear Megatiles
5:27 Oil Processing Megatiles
6:17 Mining Tiles
6:51 Part 2: The Factory Lifecycle
6:56 Kickstart demand with the "Mall of Shame"
7:42 Building the first Research Tile
8:17 The climb to 1000SPM
8:55 Biter Defense
10:09 Part 3: Evaluation Pros and Cons
10:15 Pro: Small Tiles mean low stakes
10:53 Pro: Fine-grain measurements of supply and demand
11:17 Pro: Transportation is simple
11:54 Con: UPS
12:35 Con: Water
12:56 Con: Modules
13:36 Things that aren't Cons
14:00 Other factories you should check out
14:35 Conclusion
Рекомендации по теме
Комментарии
Автор

Love the chestals and the luxurious hair at the end! 10/10

leeconderacci
Автор

bro automated the game itself. that must be one of the most factorio things i've ever seen anyone do on factorio!

DanielNerd
Автор

'Finally I can play the game now' energy lol

ThatOliveMrT
Автор

another option for artillery is to figure out whether (artillery_range² - (width_of_base/2)²) < tile_size² (or some other threshold) that way you know to insert a artillery tile in the middle. And you can adjust from there as you need to add artillery tiles and they get moved out of range of each other to make sure that you can always keep clearing.

ratchetfreak
Автор

Video was made seriously well when I was just expecting an amateur level of production lmao. Also the turn while bringing up tool assisted speedruns was a good touch haha

gabagool
Автор

This is a very elegant design. I am impressed. A few observations:-

- The 2x2 breeder reactor design is great. Most people overcomplicate on nuclear, because they want to maximise neighbour bonus, but as you and I have both figured out, going above 2x2 increases your complexity massively.

- I didn't think of going coal liquefaction only for oil. That's a wonderful idea. Automating the placement of pumpjacks is prohibitively difficult, as I'm sure you've observed, and by doing it that way, you've sidestepped the placement issue completely. You seem to have achieved something similar with your mining drills, by simply using a uniform square layout. Most people attempt to follow the shape of the ore patch, which again makes placement more difficult.

- The design of your decision making system is the simplest and cleanest I've seen anywhere, as well. Most people seem to go for clock loop based designs, which get fiendishly complex. Designing based around quotas is definitely the way to go.

- I haven't started using Recursive Blueprints yet. I am still placing my sectors manually, although at the moment I am using hexagons. It isn't possible to make perfect hexagons with Factorio's square grid, but I got around that by grouping four tiles together in a square, and using that as a single unit. My hexagons have side lengths of 11 of those 4 tile units each. The main practical reason why I use hexagons, is because I can both place roboports at the vertices, and get close to centroid equidistance. This means I have six roboports per sector, with minimal traversal distance. That in turn means that my bot flight time is minimal, which allows me to maximise the amount of bots I can have in the air at once, before I incur FPS loss. I experimented with squares, and found that the FPS/UPS drain was too big, due to excessive bot flight time; it was necessary for me to get that down as much as possible.

Hexagons would be difficult to place with Recursive Blueprints though, because of the different horizontal and vertical length offsets.

petrus
Автор

This video is seriously underrated, dosh doshington level quality

palee
Автор

Wow, congratulations on this amazing SEF! This is on a level of complexity that JOSEF could only dream of... If he had the amount of brain cells needed for dreaming (n>1)

And thanks for the shout-out, makes me very proud to be in a list with Grey Goo!

DroCaMk
Автор

Wow this was an extremely impressive video. Self-govourning machines are amazing in every single game. Massive props to you for doing this.

I will try and simulate this on my ryzen 9 7950X and 6GHz 96 Gigs of ram rig to see how far the design can be pushed, I will return to you with the results in a month or so. May or may not also be recorded, I'm not sure if I can record as well.

I'm 13 hours in at 500 SPM and 80-70 UPS without overclocking anything.

Edit: Just passed 1000 SPM, needed to perform two restarts because of a bug that stopped the design of choosing what to build in a new mega tile, I'm not sure what's causing it, but I will trouble shoot.
27 hours in.
Current CPU 1 clock 5.5 GHz, current ram speed 5.6 GHz, current UPS 55.

Edit 2: Just passed 1.5k SPM. I managed to fix the issue and find the problem. 40 hours in.
Current CPU clock 5.7GHz, current Ram speed 6.4GHz. Current UPS 43.

Edit 3: A lot of time has passed and many changes have been made. Many, many bugs and things that took ironing out later.(I'm learning Lua due to this, thanks, Chris.) I've managed to create two worlds, one without biters and one with. Both of them are now at 2k SPM. They aren't the first worlds I created. I found some issues that I will post about in my full dissertation.
Current CPU temperature 76' C, current clock 6GHz. Yeah, I'm at my limit. Current RAM speed 6.5GHz, I managed to squeeze a little more from them too. Even with my water cooler it doesn't work. I might attempt wiring a car radiator to my processor, but I've been busy so I can't really focus on that, it will take probably an entire day. Current UPS 30. I've also noticed the problem that it doesn't display the UPS correctly, it says it's 30, but from my tracking I found it to be closer to 20. Even my graphics card seems to be struggling a little bit when playing at 4k. Yes. This base is so insane that it's pushing against the ridiculously optimised factorio graphics. In the biterless world I'm getting 45 UPS, but it's closer to 35.
Things I will need to do: Remove rocks and trees from the generation. I've been told it might improve the performance. If anyone has any other ideas, I would love to hear any other performance fixing tips and tricks. Soon I will begin changing up the individual tile designs to feature beacons. It should improve performance many fold. I might replace the water barreling chains with one of the waterfill mods too.

baboin
Автор

This turns the game into an environment with a significantly smaller action space. The game doesn’t run quickly enough for any normal deep learning rig to optimize this, but it would be interesting to see what reinforcement learning could do to optimally place tiles in order to reach 1k SPM.

JordanMetroidManiac
Автор

Followed the nilaus series with this mod, was impresive too.
Enjoyed the video and ty for sharing the files, Will try running it later ✌

mike
Автор

I wanted to do EXACTLY this and you did it. On a MacBook Pro too even. Congrats, this is amazing

omgwat
Автор

This is amazing. Downloaded and played it myself and it's stunning to watch all the processes working together to create a unique factory.
Also, thank you for using DK64 and BK/BT music for this, loved it!

finlay
Автор

Wow, I'd been thinking to myself: "I should really buy Factorio, and then have someone else play it for me for optimal optimization" and here you've done it.
This makes ME the top Factorio player of all time.

FuncleChuck
Автор

My goodness that is a whole new level of complexity well done!

brentritchie
Автор

Okay the second you had the dk64 tinker music playing you had me. Easy sub

Gavagai
Автор

Frantic Factory a real fitting intro for a vid like this

itsnotamasterpieceitsamist
Автор

I really love to see self expanding factories but i could not desing one, the most advanced thing i desinged is an automated miner for dangoreus with uranium mining and relatively easy to change direction. I will run this one for sure, just without infinite chests and i will try to remove modules too.

minebuilder
Автор

Good job, always love to see new takes on automated base

duster
Автор

Nice to see someone using general LUA for bot building. Our group normally just injects with C tooling and wraps python or c# for more streamlined builds. Props on sticking with LUA nicely done.

thereal-ghost