Alt-F4 #13 - Megabase Archaeology  13-11-2020

Geschreven door stringweasel, bewerkt door Conor_, nanogamer7, Therenas, nicgarner, Firerazer

Inhoudsopgave

In this spookily coincidental issue 13 of Alt-F4 published on Friday 13th (it’s almost like we planned this), we focus on a single topic: building as many rocket defences as possible. What are rocket defences, you ask? Well, stringweasel is here to tell you, taking you back to a simpler time; the land of Factorio 0.11.

Nauvis Archives: One Rocket Defence Per Minute stringweasel

Since the beginning, players have been pushing the limits of Factorio; seeing how massive they can build their factories before the game starts to grind to a halt and succumb to a slow and painful UPS death. Over the years these limits have been broken time and time again as players reach new heights. Today, records focus on continuously consuming as much science as possible, measured as science per minute, or spm. The main limiting factor here is that building bigger factories also decreases your “updates per second”, or UPS that the computer can run at. Keeping a large-scale megabase close to the ideal 60 UPS is an art form in itself, and playing with a lower UPS physically slows down the game, making it very time consuming to further expand your base.

Currently, the world record in spm seems to be u/swolar’s 60 UPS 20 kspm base. This incredible base runs in vanilla, but it was built using some mods and console commands to generate ore, etc. Almost three years ago, the record was likely held by u/SteveTrov with his vanilla-ish 15 rpm base running at 15 UPS. (Notice the metric was rpm, short for rockets per minute, because this was before infinite science made the spm metric possible.) Also notable from the same time is u/AccidentalChef’s vanilla-ish 10 rpm base base running at 10 UPS, which pushed SteveTrov to go for 15 rpm.

Then there’s a breed of player who build true vanilla megabases, without using the editor or console commands, and sometimes even keeping biters, which makes big builds much harder. This record is likely held by Gh0stP1rate and Hamiebarmund’s 10 kspm base running at 15 UPS, which was achieved very recently. The previous record of this kind was likely from u/SteveTrov, who had a 5.8 kspm base in August 2020 running at 90 UPS, that was built in “the old school way”.

So, how did the biggest megabase look five years ago—before we even had rocket launches; back in the days of Factorio 0.11? Well, there is one base that really stood out from the rest, and I had a chat with the creator DaveMcW about his design.

The story

Back then, pre-0.12, bases were measured in rocket defence per-hour, or rdph. Rocket defence was the final end-game item that triggered the victory condition, but it was very expensive, hence the ‘per hour’. The idea was to “protect the landing of the rescue fleet”—although no rescue fleet ever actually arrived. Bases rarely even reached 1 rdph, not to mention 60 rdph. Building bases at such a scale simply wasn’t feasible at the time, and it was debated whether the game could even handle such large factories. For example, the largest factory at the time was likely by ColonelWill which could do 15 rdph, but not consistently since it ran out of raw resources. And it was built with the help of some mods like FARL. Then, on 29th June 2015, DaveMcW showed the world what was possible with his record-breaking old school 60 rdph (or 1 rdpm) megabase.

One-rocket-defence-per-minute base by DaveMcW (posted on Reddit and the Factorio forums).

This 6km-by-6km base shook the community, as clearly expressed in the top comment by u/TheWrongCat. It surprised some of Factorio’s biggest builders, including u/Zistau, u/rootnegative and u/Xterminator5. Even Wube’s founder u/kovarex commented on how hard it would be to optimise Factorio to run this base at 60 FPS/UPS (more on that later). This base was even referenced in FFF-93 as “the biggest factory ever built”, and was used by the developers as an optimization benchmark for quite some time. DaveMcW shattered people’s expectations about what was possible in Factorio.

It should be noted that to a few people, it came as no surprise that it was DaveMcW who designed this record-breaking base; he has always been on the cutting edge of technical Factorio. For example, he was the original inventor of the Blueprint String, which was later added into vanilla. He built the first large scale colour display, famously showcasing Darude’s Sandstrom. He created the mod called Recursive Blueprints to automate blueprint placing, and then built a fully-functional factory using the mod that was only 9x14 tiles. He even found the origin of the original alien artefact graphic!

What’s the big deal?

The size and throughput of this base is staggering, even for today’s standards. Back then, Factorio wasn’t nearly as optimised, causing the base to only reach 2 FPS/7 UPS when running at full pelt! To compare it to what we know today we can look at the insane amount of circuits it consumed, which were the main ingredients for rocket defence. Turns out, it almost compares to today’s full-productivity-bonus 2.5 kspm factory. What he built was completely new though; it was fully vanilla, including biters, without copy-paste-undo, no blueprint books, no personal roboports, without a live map view, or any existing calculators, all while likely playing at 5 FPS/15 UPS (idling factory). A true old school base.

At the time, simply achieving this throughput was non-trivial. For example, belts lost compression around corners. Then, there’s the beacons that are used in pretty much every megabase. They decrease the size of your base and increase your UPS, but require a high throughput of items to keep fed. Nowadays, it’s trivial to place 12 beacons around an assembler with enough inserters and belts to feed/unload it. In 0.11 though, there were no stack inserters and the only stack size bonus was for container-to-container transfers where it could stack five items. This meant simply placing enough inserters next to an assembler became an issue. For example, notice how the chemical plants producing plastic have four output inserters in the picture below, even though they’re affected by only four beacons each.

A section of circuit manufacturing that’s mirrored throughout the base. Notice the number of inserters around the chemical plant producing plastic, and how on a compressed belt like the right-most copper line the items do not seem compressed, but spread apart somewhat. (Sped up 10x)

Even more impressive is importing enough raw resources to feed this base; it requires logistics that are still considered massive today. A big reason for this is that in 0.11 there was no mining productivity, which meant resource patches would deplete rapidly, and maintaining a megabase would unfortunately consist of constantly rebuilding outposts (hence the addition of mining productivity in 0.15). DaveMcW solved mitigated this problem by building an absolutely gigantic outpost network using trains. Using 72 unloading stations across four separate rail networks, he had 216 trains importing ore from 216 resource outposts. (No, that’s not a typo.) That’s what he needed to feed his factory without running out of ore, for 20 hours at least. Additionally, he had 1,091 speed-beaconed pumpjacks on depleted oil patches, all piped to the main base. No fluid wagons in 0.11, mind you.

The sprawling rail network itself, which is DaveMcW’s favourite aspect of his base, is also fascinating. As mentioned, it was enormous, with 216 trains speeding moving (they were coal powered) between the 216 outposts. In 0.11 there were no chain signals, meaning large intersections were tricky to design for high throughput while preventing deadlocks. His solution was to eliminate the need for intersections. Instead, each of his four mirrored rail networks consisted of a single large loop, meaning there was never traffic crossing from opposing sides! Also, in 0.11, train schedules could only handle a time-passed-at-station condition. To ensure all outposts were drawn from evenly therefore, each of the 216 trains had a custom wait time. It should be noted that just building rails in 0.11 wasn’t as easy as it is today with the click-and-drag building mechanic. Before 0.13, rails had to be built piece by piece using straight and curved rail pieces. For reference, this gigantic rail network had almost 77,000 pieces of rail. Most of these were likely placed by hand since they could only be placed by robots if covered by the logistics (no personal roboports were available).

Main railway (left-to-right) showing branch to outposts (down) and an iron outpost. Notice the old train graphics and the alien artefacts lying on the ground. (Sped up 10x)

The final (and in my opinion the most impressive) part is that the layout of the base was simple and elegant while having more than four times the throughput of any base before it. It took DaveMcW 11 months to design and build this base, and you can see it in the precision of this build. A belt is only as fast as it needs to be, and never placed unnecessarily. All ratios are perfect within a few percent. This also causes the belts to rarely back-up, which makes the base look more alive. And everything is beautifully mirrored in four directions, expanding from a single point, spotlighting the rocket defence. And the fact that this was all built in vanilla, and without a personal roboport, is mind boggling.

Running the factory in 1.0

I was curious how this megabase would run in Factorio 1.0 with all the optimisations the developers applied during the intervening five years. So, I migrated it. It took longer than I expected, but it works! For reference, on my PC using 0.11.22 the base runs at 2 FPS/6 UPS, but in 1.0 it reaches about 65 FPS/65 UPS with high quality graphics! (Disclaimer: the migration to 1.0 is not by any means perfect. The goal was simply for all the machines to run similarly to 0.11. There’s likely something I missed or simply ignored, for example the negligible power generation.)

Production graph visualization
The new production graph lining up almost exactly with items produced more than five years ago. The middle area shows the fail/fix process (not an accurate representation of spent time).

One of the four mirrored circuit builds. Notice the layout: it’s mirrored left to right with four similar sections, and it shows three repeating row sections.

There were quite a few changes needed to run this old base in 1.0. It started with adding items and changing recipes to mimic 0.11, which includes the fluid amounts being multiplied by ten and the advanced circuit to copper cable ratio being 8:1, not 6:1. Then, there were more straight-forward changes like replacing small-pump setups (on which DaveMcW was also the expert) with single pumps; the small pumps of 0.11 were much weaker than today’s pumps so you had to have multiple in parallel to maintain full flow. Another required change was the manual addition of a belt directly in front of inserters where it was not previously needed, which had to be fixed for most of the outposts! And, as mentioned earlier, the inserter stack size at the time was always one, except when moving from container-to-container, then the bonus was five. This was fixed individually for each inserter using a script.

Difference between the old small-pump setups and new pumps (left), including the new offshore pump (right) and addition of polluted water. Also notice the change in how tile transitions are handled.

There were a few other changes that were not apparent at first, but quite interesting. For example, in 0.11 a splitter’s throughput was limited by its output speed, whereas today it’s limited by its input speed. A yellow splitter could output two full yellow belts with only one red belt as input. I also had to ensure the biters couldn’t penetrate the perimeter with outdated defences. This is partly because in 0.11 there were no behemoth biters, but the main issue was that DaveMcW used an old belt trick that interrupted a spitter’s attack animation, preventing the spitter from dealing any damage. This meant that laser turrets only had to focus on the melee biters. This belt trick no longer works, meaning the perimeter needs to handle spitters as well. To completely circumvent this problem for 1.0, without losing the performance impact of the biters, I used a script to make his ~24,000 laser turrets 50 times more powerful.

Belt trick with laser perimeter
Perimeter wall in the 0.11 base showing the belt that interrupts the spitter’s attack animation. Notice the old 1x1 laser turret graphics. (Image from here)

Finally, I had to manually modify all vertical train stations, which was the most time consuming part since there are over 100 of them! This is because before 0.13, vertical and horizontal train stations had different lengths due to Factorio’s 2.5D world projection. All in all, it was a very interesting and exciting challenge to find and fix bottlenecks and other problems by changing and fixing the game, rather than the base itself.

Map view of rail network, showing only an eighth of the outposts.
Map view of rail network, showing just 27 of the 216 outposts.

Experience this base yourself

This base is remarkable and will always be remembered as one of the first true megabases. And you can explore this base yourself by simply downloading the 1.0 save and the necessary small mod pack here. Or, if you like being retro and have patience, you can simply download Factorio 0.11 and DaveMcW’s original 0.11 save. Or, if you only want a quick look around, you can even view it in Google Map format here, which was created by Twinsen. However, there will be internet points awarded to the first person who finds the roboport that DaveMcW dropped five years ago.

In closing I would like to request that one of the four mirrored circuit builds be placed in Factorio’s upcoming main menu simulations. The build is chaotic, but still highly optimized, implemented with precision, and very pleasing to look at. More importantly, this base laid down megabase principles that would be valid for years to come, in a time where the art of highly optimised builds was only just getting started. It’s a base that could be remembered forever. (Or at least until that rescue fleet finally arrives.)

Contributing

As always, we’re looking for people that want to contribute to Alt-F4, be it by submitting an article or by helping with translation. If you have something interesting in mind that you want to share with the community in a polished way, this is the place to do it. If you’re not too sure about it we’ll gladly help by discussing content ideas and structure questions. If that sounds like something that’s up your alley, join the Discord to get started!