Tips for preparing fast food even faster. Explains generic optimization strategies and mechanisms without spoiling any specific puzzles.
How the Time Score Works
The final time score for a solution is the maximum of the individual order times. In other words, the slowest order determines your score. Optimizing the faster orders will do nothing for your score. Therefore you should focus on making your slowest order faster.
In some puzzles you can sacrifice speed on faster orders to make your slowest order faster, for example by plotting a belt route that favors the slowest order. In other puzzles, you can simplify your design by using the Sequencer timing of the slowest order for all orders, thereby saving space on components, which gives you more freedom elsewhere in the design.
The time score of an order is equal to the tick on which the tray leaves the preparation area, which is one tick after you get the green light for the order.
Planning the Route
How you place your machines is the largest factor in how fast your solution will be, as this is the main thing that you have control over: cooking times are fixed per the instructions, while programming decisions can add delays but cannot make a solution faster than the minimum determined by the route.
Every square traveled takes one tick of time, no matter whether you use a plain belt, a Router or a Sorter that fires as soon as possible. The length of the fastest route from one position on the grid to another is always the Manhattan distance: the sum of the horizontal and vertical distance between the two squares.
This means that if a dispenser is 3 squares to the right and 4 squares up from the final Stacker, whatever ingredient you dispense there will need at least 7 ticks to reach the Stacker: you need 3 moves to the left and 4 moves down, no matter in which order you put those moves. If your item needs to wait to be processed or for another ingredient to pass through, those ticks get added on top of the minimum. If you ever move in the opposite direction of the target, that adds two ticks: one for the move itself and one because you are now one square further from the target square.
By looking at your floor plan, you can already calculate how fast the solution is going to be before you even program it. This can save you effort, as you don’t have to wire up a solution that’s going to be too slow in the end.
In most puzzles, it helps to move the tray dispenser and the verifier/exit all the way to the left. This leaves the most space for manipulating the ingredients.
If your order consists of multiple items, the slowest item will determine when the order is finished. Therefore focus on that item first: get its ingredients from their dispenser as soon as possible and use the shortest possible route. While this may delay other items, that doesn’t matter until those items become the new slowest item.
It can help to study the path of the slowest item in single-step mode and for each step it takes, ask yourself “could it get here one tick earlier?” If the answer is “yes”, try to eliminate the wait, for example by delaying faster items or routing them differently. If the answer is “no” every time, there might just be too many steps in the slowest route and you have to rethink the overall approach instead.
Try to do as much in parallel as possible. For example, if you need to fry two items, consider using two fryers, so you can fry both at the same time. We’re optimizing for time here; optimizing for cost is an entirely different challenge and for most puzzles you can’t optimize both in a single solution.
Experiment with the Machines
The Instructions screen (F1) shows the most obvious way to use machines, but some of the machines are more flexible than you might assume. It is useful to run a few experiments in a separate solution to see how the machines react in different circumstances.
Stackers are pretty flexible in some cases. For example, while the Instructions show food being stacked on a plate and then the plate on a tray, stacking the plate on the tray and then the food on the plate works as well, which means you only need one Stacker, saving not only space but potentially also time, as a Stacker represents one time tick of travel in addition to the time spent stacking.
When mixing liquids, the order often doesn’t matter, which gives you some flexibility in the placement of the liquid dispensers.
You can dispense liquid into a travelling cup, for example a single shot can be dispensed onto a belt, while a Sorter can eject on the same tick as the last shot is dispensed.
Not all experiments pay off: for example if the Instructions say you have to fry a food item, you can’t microwave it instead. Also a fryer only heats the item if it stays stationary there: moving an item from one fryer into another doesn’t progress its heating. But it’s a small effort to run an experiment and in several puzzles you might discover something that allows for a faster or easier solution.
Once you are satisfied with the route you designed, you can start configuring and wiring up the machines to make it all work.
While the Multimixers produce their results instantly, the Sequencer and Counter add one tick of latency. If that latency affects the slowest item on your slowest order, eliminating it will improve your time score.
The Sequencer starts running on the time tick after its START input gets activated. Therefore, if you have for example dispensing a cup as your first Sequencer action and that cup is the slowest item, you can speed things up by using an OR mixer to send the incoming signal to both the Sequencer START input and the cup dispenser input. You use one machine more, but save one tick of time.
A Counter will set its ZERO or POS output at the end of the tick on which it becomes zero or positive respectively. For example, if you have to stack 3 items on the tray, you might have a Counter with a +3 wired to the overall START signal and -1 to the Stacker’s STACK output, with the ZERO output wired to the Stacker’s EJECT input.
While this is a compact solution, it adds one tick of latency: if the 3rd item is stacked on tick 10, the STACK signal comes at the end of tick 10, which is then processed by the Counter and generating the ZERO signal at the end of tick 11, which leads to the tray being ejected on tick 12. This means the tray is sitting on the Stacker during tick 11 while it was ready to move on.
One way to avoid this is to control the EJECT using a Sequencer rather than a Counter. This is appealing in particular if you already have a Sequencer running and not all of its outputs are used yet. But if your programming area is not full yet, you could also use a dedicated Sequencer for it. If the eject time is after tick 12, you need to start the Sequencer using something other than the overall START signal, for example from another Sequencer’s output or from a SENSE output of a factory machine.
Remember that we only care about optimizing the slowest item in the slowest order. If the fastest order is ready on tick 8 and the slowest on tick 11, it’s fine to eject both on tick 11.
If you’re short on Sequencer outputs, tricking the Counter can be an alternative: if the last two items come in directly after one another, you can just set the initial counter value one step lower to compensate for the latency. In the earlier example, if the 2nd item is stacked on tick 9 and the 3rd item on tick 10, you can initialize the Counter using +2 instead of +3, which means it will output ZERO at the end of tick 10 and the tray gets ejected on turn 11. If there is any delay between the last two items, this trick won’t work though.
The Lowest Time Possible
After you found a fast solution, you might be wondering whether it is the fastest possible or there might be an even faster solution.
You can compute a lower bound for the solution time by taking the time it takes for the tray to travel to the exit plus the number of items that you have to put on the tray. The tray takes at least 7 ticks to travel to the exit, as you can only dispense it on the top row and can only put the exit on the bottom row, so it needs to travel at least 7 squares.
For example the very first puzzle, 2 Twelve, requires 7 ticks for the tray to travel and 1 tick to put a single item on the tray, so there cannot be any solution faster than 8 ticks. So if you found an 8-tick solution, you cannot optimize for time any further.
For some of the more complex puzzles you can expand the computation of the lower bound adding frying times, number of liquid shots etc. However, the lower bound computed from the necessary processing steps is not always achievable: in many cases getting an item from machine A to B will require extra travel steps. In those cases it’s not easy to say what the lowest time possible would be.
In practice, the top percentile of the leaderboards will often be the fastest possible time. You can enable leaderboards via the System > Network settings in the hub application. In a few cases it is possible though to beat the leaderbord score. I found the following times that are below the leaderboard 1% threshold at the time of writing: Rosie’s Doughnuts: 26, On the Fried Side: 17, Sushi Yeah: 20.