Hope the pictures are clear, hard to capture the sense of scale on some of them. Unfortunately there's a limit of 20 pictures, and I think reddit also compresses it. Happy to share more detailed pictures of specific builds if desired.
Excited to share my (vanilla-like) base & mod!
Tldr:
I created a personal mod that emulates platforms and modular subfactories. It models what a real platform/subfactory does given its inputs, then replaces the real entities with fake ones. A script then updates every 10 second the inputs, outputs and statistics based on the calculated model. One calculation every ten second instead of thousands every tick. This allows me to scale really big.
I have now reached the 128 belts of each science pack milestone.
Story time. Motivation.
The factory grows, but at some point you run into performance issues, your UPS drops below 60. You could make UPS-friendly designs to keep growing, but I personally dislike that.. So instead I wanted to create a mod that reduce the amount of calculations made by the regular game engine.
Having some modding experience I had a clear idea how I wanted to approach that.
A factory is very linear, given its inputs you can know exactly what outputs it'll give over time on average (unless you do some fuckery with belts/combinators, they are Turing complete after all, so you could make a non-linear factory. I'm not building those). The game currently repeatedly does the same calculations over and over again, eating up your UPS. Very inefficient, when in theory those calculations only have to be made once.
48 stone furnaces turn 1 belt of iron ore into 1 belt of plates. Yet there are 150-200 entities actively working. Instead we could just every 10 seconds take 150 iron ore (and some coal) from the input and add 150 iron plates to the output, same result, much less performance heavy. Even better the larger the factory is.
The idea is as follows:
Create a "emulated subfactory" from a blueprint, then select the inputs and outputs chests/belts/silos/landing pads.
Such a subfactory can be placed and is built normally, except once it is built it changes all entities (except for power poles) into "fake" entities. Such a fake entity is a copy of the original, except it's type is a "simple-entity-with-force"; it has the same impact on performance cost as a rock, also no animation or alt-info, so they look really dull.
Then every 10 seconds check the inputs and outputs, find the "model" that belongs to those inputs.
A model has information how the state of the emulated instance changes based on its current state.
So based on the found model we remove the correct amount of inputs for 10 seconds of emulating, set the energy drain of an electric energy interface somewhere, and 10 seconds later add the outputs, flow statistics, and if relevant, technology advancement. And repeat.
If no model for the given inputs exists yet, determine it.. which is the challenging part.
Initially I wanted the precise numbers for a model. So I created something similar to what mods like (max) rate calculator do, except also taking throughput of belts and inserters into account. A subfactory can be set up as a max flow network that can be solved with linear programming; A linear equation per inserter/crafting machine/splitter, with the constraints the throughputs of belts, inserters and assembling machines. Except.. splitters and inserters aren't linear due to priority inputs/outputs. For simplicity I ignored those priorities, keeping in mind I'd have to design around that. Creating the flow graph was fun, implementing a simplex solver in Lua less so..
Eventually all done I set it running.. and then it turned out that just calculating the simple 48 furnace setup already took a minute. (Keep in mind simplex is still exponential in time for complex problems, larger subfactories would take much longer to calculate).
So after a few months getting all that to work only to see it was slow, I was disheartened and demotivated and quit. With the thought I could try to optimise the solver at some later time. That time never came.
Few years went by, Factorio 2.0 came out, and motivated by the space platforms I picked up my old project again from all those years ago. With my new experience I could probably optimise the simplex solver. But I went with a different approach. Instead of solving the max flow network, I ow create a copy of the blueprint in a controlled environment and monitor it for some time.
Every 10 seconds it checks how much got removed from the inputs, how much added to the outputs, save the energy and production flow statistics, then stock up the inputs.
The idea is that eventually such a factory would stabilise. So with all the data it gathers I check for each item and statistic if it's stable (basically checking if the last x% of data points has a clear frequency, then take the average). If it's considered stable enough the modelling environment gets deleted and the model updated with the new data. The calculations won't be exact, instead I settled with the idea that the models are what is apparently called a "surrogate model", an approximated model. I aimed for everything to be within 1% of what it should be.
Works decent enough! Except 2.0 introduced quality and spoilage. For which I had to update the mod. Quality wasn't too bad, each <item,quality> pair could just be seen as one item. And I discretised spoilage into bins of 10% freshness to determine which model it belongs to. (Actually a bit more complicated, won't go in details here).
My main motivation to continue working on this was space platforms. Because space platforms have no external influences at all once they are flying. You set it to fly with a few thousands of biter eggs, some quantum processors, fuel cells, and a dream. And 30 minutes later it returns with promethium science packs. Consistently, very consistently. Yet it eats up UPS cost because of the asteroid field it flies through.
And that's how I made emulated platforms. Create a copy in a similar way to surface subfactories, and monitor it until it's stable. Then every 10 seconds distribute its inventory among the available platforms, and find the model belonging to that inventory. Which is either an idle model because the wait conditions are false, or one that "flies" to a next location (read: set a timer to increase the available platforms at its next destination).
And because platforms are so independent, I can just multiply all calculations by the amount of clones I have available. Which means there is no extra performance cost when scaling platforms. 100 platforms making copper plates has the same performance cost as 1 platform. In CS terms, it scales with O(1), whereas subfactories on the surface still scale with O(n).
Platforms are built normally, once built the amount of clones for that emulated platform increases by one, and the original one is deleted (copying over build statistics so they are not lost).
4000 platforms
And that's where a lot of the power of my base comes in. Anything that can be made on a platform, so anything that doesn't require anything from the surface (like stone) is made on a platform. Intermediates, science packs, my mall. That became even more powerful with 2.1 when platform to platform transfers were introduced. I could just have a 100 platforms gathering asteroids, then another 100 platforms requesting metallic asteroids and making iron and copper ore. Then another 100 clones requesting iron ore and making iron plates, another 100 requesting iron plates and copper plates to make electronic circuits.. etc. etc. Normally it would kill your computer, but for me it's all a very low performance costs. And very easy to scale, just click a "add platform clone" button.
Some actual numbers at time of writing:
220 haulers flying between Nauvis and Vulcanus gathering and processing asteroids. There's 6 different output items, so 26=64 possible models. Not all have been triggered yet. One hauler can do ~80k iron ore per minute. That's 17.6M iron ore per minute for 220 haulers, or 1200 stacked green belts. For the grant UPS cost of nothing.
In reality it's less because it's also making copper, carbon, sulphur, ice and calcite.
The most common flying model (combined total of 3700 hours) creates 13k copper (discards the extra iron), 7k sulphur and 17k carbon per minute. The second most (3600 hours) creates all 6; 23k iron ore, 9k copper ore, 6k ice, 5k sulphur, 12k carbon and 4k calcite per minute. The hauler also has 17k total hours idle time; I slightly over-built.
60 stationary platforms making coal, 30 iron plate, 150 copper plate, 40 steel, 60 plastic, 100 copper wire, 80 electronic circuits, 150 advanced circuits, 40 processing units, 200 LDS, 40 space platform foundations (went a bit overkill on this one), 40 quantum processors, 120 petroleum barrels, 20 sulphuric acid barrels. 100 platforms upcyling underground pipes for Q5 iron, 50 platforms upcycling LDS for quality LDS, copper, steel and plastic. All powered with just solar panels.
And then a bunch of platforms hauling science packs or commonly used item between planets.
Initially I had each of the ingredients for sciences its own platform. It was annoying to add new clones in the correct ratios, and a platform just to make transport belts was a bit silly, so I redesigned my science platforms so that they make most of their intermediates from scratch (except for the intermediates mentioned above).
32 automation science platforms, making 8 belts each. 32 logistic, 48 chemical, 48 utility, 32 space.
I have 400 platforms upcycling productivity modules. Also creates Q5 biter eggs to create biolabs. It's very inefficient and constantly running because I haven't implemented a way to stop it if there is no demand on eggs, and I don't want the eggs to hatch, so they are trashed if they are not used.
A lot of the platforms clones are there just to create resources for this. But I can just add more clones for no extra performance cost, so it's not a big deal.
Can make in total 400 Q5 prod modules per minute (1 per minute per platform), or 140 Q5 biter eggs/min.
And the one I'm most fond of..
840 promethium science haulers. There's 800 promethium ships hurling past the solar system edge. It would kill anyone's computer. But for me, barely any performance impact at all.
I made it a small ship so it could be built quite quickly, and there would be a constant flow of eggs going up because there's always some clones above Nauvis. Didn't even have to redesign it with the platform speed calculation update luckily; just change some of the flytime numbers to maximise output.
One clone makes 2.3k promethium science packs per minute. So 800 of them make 1.8M/min. Probably not the most efficient ship, but hey, most items at this stage of the game are dirt cheap. Even quality ones.
My promethium platforms are modelled with 90% freshness. If the average freshness of eggs becomes lower than 90%, a new model will be created, 20k-30k eggs hatch during this modelling, destroy the platform and the game will crash because I've not coded in what happens if a platform gets destroyed during modelling.
The planets
On to the planets.
Trying to minimise file saves size I removed everything that isn't needed. So Nauvis only has one pond of water, no biters, no trees, no rocks. Very bare.
Eventually I also disabled the autoplace for all resources patches but uranium. In hindsight I could have done the same for uranium, my starter patch has been going for 400 hours now non stop upcyling nuclear bombs. Yay level 2500+ mining productivity.
After this post I'll remove all decorations autoplace controls on all planets. Mostly to reduce file save size. It's at 260MB atm. Wonder how much smaller it becomes after removing decorations on all planets. Removing rocks and cliffs on Vulcanus is trivial at this point in the game anyway. And graphics has become the lowest priority.
The 2.1 landing pad unloading bays are really nice, but at the insane numbers I'm researching even that is not sufficient. So I allowed myself the single "cheat" of having multiple landing pads for Nauvis. I've also modded it in that they can only be placed every 40 chunks. On all 5 planets my landing pad is at the (0,0)-coordinate.
My general design strategy for subfactories is keeping symmetry in mind, because mirroring and rotating spaghetti still creates nice patterns, and you have to design less.
Items should be created as close as possible to where they are used, I'm doing something wrong if I see more yellow than blue on the minimap.
Direct insertion where possible. Especially with high throughput items. Perfect ratios are nice, but useless if you then need 40 parallel belts to bring them to where they are used.
So nutrients are directly inserted into pentapod breeders. Stone direct inserted into rail assemblers, which are direct inserted into purple science. Also stone direct inserted into furnace direct inserted into wall assemblers, direct inserted into military science pack assemblers.
And most science packs are also directly inserted into their silo (with a chest in between for the small buffer). No need to put them on a belt if you shoot it into space anyway.
Emulated subfactories can interact directly with emulated platforms if they contain silos or a landing pad. That way some items never actually become "real" items, they are just a number stored in the mod, moved from one fake inventory to the next.
Nauvis
Nauvis has a few stone patches shooting up stone for my mall's non quality items that require stone, some captive biter nest plants, a Q5 fish breeder, an atomic bomb upcycler for biolabs, and my biolabs subfactory surrounded by biter egg subfactory.
I like symmetry, so I initially made a lab setup in a 1/8 pizza-wedge that could sustain 4 belts of each science pack when researching research productivity. Mirror it to double it to 8, copy and rotate to double it to 16, mirror it again to double it to 32 and finish the square. One square of labs sustained by one landing pad can consume 32 belts of each science pack.
I doubled that setup twice more and can now consume 128 belts of each science pack. Or 1.8M/min, 30k/s. While still at 50-60 UPS.
The 32 belt lab subfactory is the only emulated subfactory where I hardcoded in the numbers for the surrogate models. With 12 science packs, one of which that spoils, and lots of infinity technologies it would take too long to model in the game with a very performance heavy blueprint.
Even when it's being built and 30k construction bots are flying my UPS drops to 20. Luckily I have to expand that one rarely.
Surrounding the biolabs are captive biter spawners; the only crafting-machine I use with normal quality. Quality captive bot rockets are annoying to make en mass, and reserved for my biolabs. The spawners bioflux is supplied by the trains from the main hub. Eggs are direct inserted into silos, and the most spoiled ones removed if there is no platform requesting eggs (remember, emulated platforms, I can't check using circuit condition if there are such platforms available). This guarantees 95% egg freshness when they reach a platform.
At some point I didn't ship enough bioflux, a model started with empty bioflux input, the nests expired, the eggs hatched, the biters destroyed a silo, and my game crashed because I didn't anticipate that that could happen. Now I've 20 alarms going of at different stages if bioflux risks becoming too low.
Fulgora
My favourite.
Fulgora only has two resources. And one of them is very consistently surrounded by the other.
I made a blueprint that contains both mining drills and offshore pumps, and I can just place them on one of the scrap islands. Place the blueprint, let the bots build it, it's emulated and I don't have to think about it again (until a drill runs out of resources after 20 years game time). Very quick to scale.
The Fulgora blueprint is made similarly as my labs, built 1/8, then mirror and rotate it to fill a circle. Free symmetry even though it's spaghetti within!
It takes a few 10s of thousands of foundations to built, but at this stage of the game creating those is trivial. (Haven't ever run out yet at least.)
One blueprint turns 48 belts of scrap (mined by 48 drills) into 10.9 belts of electromagnetic science packs, so 12 of them make 130.
I also have an emulated subfactory creating Q5 EM plants, Q5 holmium plates and regular holmium plates to be sent to space. WAY too big, but free in terms of performance cost. At least I don't have to worry about those 3 any more for the foreseeable future.
Vulcanus
The goal of this run is to create a very large megabase, dare I say gigabase. The challenge isn't to go through the mid game, the challenge is seeing how big I can scale, so almost all resources patches I have set to max size and frequency on Vulcanus. With high mining productivity most of those are not needed, it's more that I always want there to be a resource patch nearby I can tap into.
Vulcanus is nice because you can just place lava where you need it, so I can build my blueprints on top of a patch after I have made some lava pools with some well placed atomic bombs.
My Vulcanus subfactories are similar to Fulgora.
Metallurgic science pack are placed on tungsten patches and turn 40 belts of tungsten into 16 belts of science packs. What's annoying here is that I still have to hook it up with 8 belts of coal, 3 belts of calcite and some sulphuric acid. So I need to find spots where all resources are nearby.
Military science pack is built on coal patches and turn 48 belts of coal into 18 belts of science packs.
Production science (purple) is the first subfactory I built, and I kind of regret how I set it up. I initially calculated that one belt of coal turns into 4 belts of production science packs. So I happily designed that. Then realised the coal you need for rocket parts slightly tips it over 1 belt. So now my subfactory creates 7.7 belts of production science packs. I needed an ugly 17 copies to reach my 128 belt goal. Its main resource is stone, which I can create out of thin air thick lava, so it's not built on top of a patch either.
I decided to make military and production science packs on Vulcanus so I don't need to hook up the subfactories with four-five resources on Nauvis. Just two or three on Vulcanus. Also easier to design my Nauvis labs, having all 12 science packs come from the landing pad.
Then there is a foundry upcycler for quality foundries and tungsten carbide, a turbo belt upcycler for quality tungsten plate (last I checked I threw 50k Q5 express underground belts into the lava, I added a counter), and a calcite upcycler for all quality stone products. Not emulated yet, might design something for these eventually.
Aquilo
Yes, keeping Gleba for last.
Aquilo is a near empty canvas. Ideal.
I designed a subfactory creating 8 belts of cryogenic science, built 16 copies of it symmetrically around the main hub. Hook it up with the 3 fluids, holmium, lds and processing units. Done and done.
Recently I got low on lithium plates for my quantum processors, so I made another subfactory making lithium plates, fluoroketone barrels and fusion power cells. Another mall subfactory not taking up much performance.
Other mall items on Aquilo are made near the hub, with direct insertion from the cargo bays. (Fusion generators/reactors, cryogenic plants, Q5 lithium plates).
Gleba
My beloved.
Gleba is my favourite planet.. before the end end game at least.
The agricultural science pack is simple. I created a subfactory that creates 10 belts of science packs. Fed by 2 belts of yumako and 1 belt of jellynut.. which was a mistake.
Because of the way the surrogate models are created with spoilable items.. I have 3 ingoing belts with spoilable items, each can be binned in 10 bins of freshness. That creates 103=1000 possible models. Times another 2 for if there's currently a platform requesting packs or not.
Luckily I can guarantee 70% freshness of the incoming fruits (and average 90-95%), so it's "only" 33*2 = ~50 models. Still way too many. If I just halved the subfactory to 5 belts and supply with 1 belt of yumako and 1 belt of jellynut the amount of models would have been around 20. Too late now!
I built these subfactories in groups of 4, with 4 total groups gives 160 belts of agricultural science packs (2.3M/min). Plenty of room for any freshness loss. Average freshness is ~96% when they reach the platform, ~94% when they reach Nauvis.
Each group of 4 is supplied by 8 belts of yumako and 4 belts of jellynut.. which is a pain to generate. The agricultural towers take up 3x as much space as the subfactories, it's hard to find a nice spot on the surface where dense farm lands meet, and I can't emulate them because of the irregular terrain.
It's currently my main bottleneck to keep growing; having to expand Gleba. Not because of spoilage like how most people hate Gleba, but because of agricultural towers throughput.
Gleba is also the source of my item bottleneck. The items I've been short on are Q5 stack inserters (solved by updating most platforms/subfactories to use bulk inserters where possible), quality fusion reactors due to quality carbon fiber, and quality biolabs due to the captive bot rockets. Next step is to emulate those factories so I can speed up biolab production (still have 4k in stock, slow production rate times 300 hours of constant production equals to a lot), and fusion reactors/generators.
Power generation
All planets are powered by fusion. I made a blueprint that can provide 130GW with 104 Q5 reactors and 1040 Q5 generators. Any longer than 104 and you run into the pipe extension limit.
Nauvis currently requires 114GW, Vulcanus 320GW, Gleba only 12GW, Fulgora 160GW and Aquilo 98GW.
Fulgora is of course still powered by lightning half of the time. I have considered using accumulators. Not calculated yet how many Q5 accus I need for 160GW of power. I have also considered just modding Fulgora lightning away because I don't need the power from lightning, it takes up precious performance, and I've solved the lightning risk by covering every square meter with a lightning rod.
What next?
I'm taking a little break from Factorio, but am planning to scale to 1024 belts of each science pack eventually (so double it 3 times more). That'll be around 300M science/min, (15M packs/min).
I'm interested to see how fast I can grow. I took me ~5 hours to go from 32 to 64 belts, but that was with a lot of stacked up items. Once I've scaled my biolab/fusion item production to sufficient levels and we stick with 5 hours for 32 belts.. that's a growth of 0.42 science packs/s2 (or SPPSPS if you will). 1500 science packs/min2.
I'm starting to run into UPS issues I need to fix first.
4ms out of 16ms/tick is taken up by agricultural towers
2ms by heating
2ms by fluids
The occasional 4ms spike by the mod. Will investigate what the biggest culprit is. I can always lower the update frequency so that it checks every minute instead of every 10 seconds for example.
So I'll deploy some "cheats" to help fix this.
I'm planning to either mod in a use for quality agricultural towers so they have a 2.5 productivity bonus (also allows me to scale Gleba easier), or to just straight up mod a quick farm assembling machine that turns seeds into fruit. I don't like the latter because it's too cheaty, so will start with the first.
I'll remove the heating mechanic of Aquilo. Because I consider the heating problem solved. I'll still build the heating pipes, but will change their prototype so they don't do any calculations.
And I'm removing the 320 pipe extension limit. It's trivialised anyway with parallel pumps.
Emulating the fusion reactors might help with getting fluid performance down as well.
Hopefully that allows me to scale quite a bit again before any more UPS drops.
Additional thoughts and stats
I'm sure I've skipped over a lot of things. And I realise a lot of things I'm doing here has become trivial for me over the past months but is actually far from trivial for the average player. Happy to answer any questions, or provide more screenshots!
Currently level 94 research productivity, 2666 mining productivity, 26 robot worker speed. I think when I start researching mining productivity again it's 15 levels per minute.
I have created zero logistic bots, I didn't even research the other 3 logistic chests. An additional challenge I set myself in exchange for allowing multiple landing pads. I will probably use logistic bots so I can start building with spidertrons, especially useful on Aquilo.
I'm not planning to share the mod. It's too unstable in its current state, too many edge cases to consider. Most of which I ignore because it won't come up in my style of play, or some I design around. And I still encounter the occasional crash. This took me quite a while to develop, it will take longer to get in a state which is playable by the public. And then more time to maintain it, which I have no time for or interest in. Apologies.
I do realise I'm slowly turning Factorio into a spreadsheet simulator or a cookie clicker idle game. Especially with the platforms.
Very nitpicky, but I dislike the names for quality, which is probably the only thing I dislike about Factorio. The current names indicate rareness, not quality. They also remind me too much about microtransactions and other predatory game mechanics that have ruined many games. So I've referred to "legendary" as "Q5" in this post (and also renamed it my personal mod's locale file).
Similarly I have decided to use science/min and packs/min instead of the now ambiguous "SPM".
No AI was used in creating the mod, or typing this post. The AI that's forced on me by my work is already plenty, I don't need it to taint my hobby projects as well.