Autonauts

Autonauts

Not enough ratings
Advanced Backpack and Programming Guide
By killswitch1968
This guide will explain in detail the Stow, Retrieve, Cycle Held Item Up, Cycle Held Item Down, and Swap programming functions & how they interact with the Backpack. As this is an advanced guide, some familiarity with the game is recommended.
Advanced programs utilizing these commands are also featured.
   
Award
Favorite
Favorited
Unfavorite
Introduction
This guide is intended to explain the mechanics of the Backpack. It is a powerful tool but will frequently stymie new players by its poorly explained interaction with items held in the Hands. As a result it is frequently overlooked in favor of simpler programs. While you can easily complete the game without ever using the Backpack, the challenge and enjoyment from the game comes from developing intricate programs to perform complex tasks.
This guide will explain in detail the following functions:






All these operations directly interact with the Backpack. While most of these commands apply to the Player Character and Bots alike, there are small differences which will be explained.
Mastering these functions will allow sophisticated programs & more efficient Bots. This guide is not intended for new players. This is meant for players in higher tech levels that want something more interesting than "Until Hands Full" and "Until Hands Empty" basics. Advanced programs demonstrating these functions are featured later in the guide.

Inventory Mechanics
Hands
For the purposes of this guide, Hands will refer to the Hand Slots that hold items:



The Backpack refers to the Backpack Slots:



"Inventory" will collectively refer to both.

Hands is the most straightforward portion of your Inventory. Hands follow simple rules.
Only one item can be picked up at a time, whether from the terrain or from a storage unit.
Only the same item can be held at any given time. One can hold 4 Stones or 4 Sticks, but never 1 Stick and 1 Stone in Hands.

Item Weight
All items have a ‘weight’, which corresponds to how many Hand or Backpack Slots are occupied by that item:



This can range from a Weight of 1 for most items (Sticks, Stones, Poles), to end game items that can weigh up to 16. Any item can be held in Hands regardless of the weight requirement. Even if you only have 4 Hand slots, you can still carry an item than has a Weight of 5 or more. However, items that weigh more than 3 will cause a reduction in movement speed even if you have enough Hands for it. This penalty is worse with items that weigh 4, and speed is maximally reduced for items that weigh 5 or more.
Items can only be stored in the Backpack if there are enough slots for it. However any item that can be stored in the Backpack will never cause a speed penalty regardless of the weight.

Tools & Animate Objects have their own Inventory rules. Bots, Colonists, & Livestock always take up all your Hands, and can never be stored in a Backpack. Any Tool (Hoe, Scythe, Axe, etc.) completely occupies all of your Hands regardless of their actual Weight. You can never hold more than one Tool in your Hands regardless of the number of empty slots. Crude Blades are the only exception to this rule which occupy 1 Slot. This is relevant for programming as certain items require other tools as part of their recipe, and you have to store extra tools in the Backpack to carry more than one.

Backpack
The Backpack can hold any combination of different items. They are not restricted to being the same item like with Hands. This is the crucial difference between the two and allows for more sophisticated programming than Hands alone would allow. Backpacks are not simply an extension of your Hands.
Each Backpack slot can hold 1 Weight of items, meaning a Log will take 3 Backpack slots. If you do not have the Backpack space for a given item it cannot be stored in the Backpack by either the Player Character or a Bot. This does not apply to Hands, where the Player Character can hold an item that exceeds its Hand size, albeit with a severe speed penalty.
As the items in the Backpack can all be different, the order in which they are are stored is critical. For the purposes of this guide, the Left most slot will be called Slot 1, and the Right most slot will be called Slot n, where n is the last available Backpack Slot. This will vary depending on the available Backpack Slots in the Player Character or Bot.



Stowed items cannot be placed in any slot. The Backpack must fill from left to right, meaning spot 1 will be filled first, then 2, then 3, etc. For example, you cannot have Slot 1 & 4 filled without having 2 and 3 also filled. Empty slots in your Backpack always occupy the highest n slots.
Note the Player Character can manually click items in their Backpack to place it directly into their empty Hands. Bots cannot be programmed to do this behavior, as these mouse clicks will not translate into Bot commands when in programming mode.
Bots can only use their Backpack with the commands listed below. Backpack related commands all have a turqouise background to distinguish them from Movement commands (Blue), Add/Take commands (Orange), Search commands (Purple), Object Interaction commands (Green), and Program Functions (Yellow).
Backpack Programming Commands
While Backpack commands are all unique there are important rules they all follow:
  • No command will put more than one item in your Hands, even if your Backpack is full of the same item.
  • All commands interact with your Hands in some way; there are no Commands that only rearrange the Backpack.
  • Backpack commands cannot "freeze" the program or Bot. If a Backpack command doesn't or can't work in a certain context the program simply continues. However, improper use of these commands will often cause problems later in the program, especially with the "Add to" or "Take from" commands.
Stow held item


While and are listed as different Commands, they are bound to one button for the Player Character (Q). This is because they are mutually exclusive.

is performed only if your Hands are not empty (at least one item) and you have at least one free Backpack Slot.
is performed only if your Hands are empty and you have at least one item in your Backpack.

will take as many items as possible from your Hands and put them in the n Slot.
A single item is Stowed in the Backpack

will attempt to put as many items as possible into your Backpack if there is room for it. If there is not enough space for all items, the remaining items will remain in your Hands.


fails completely if the Backpack is full.
Retrieve


can only be performed with Empty Hands. It will place the n Slot into your Hands:



seems like the reverse of . This is not strictly true. While you can many items into your Backpack at once, you can only one item at a time, even if your Backpack is full of the same item.
Using with 4 Sticks in Hand will put all 4 Sticks into the Backpack (assuming it has 4 empty slots). Using with 4 Sticks in a Backpack and empty Hands will only move a single Stick.
Programming a Bot to when its Hands are empty does nothing.
Programming a Bot to when its Hands are not empty does nothing.
Cycle held item up


The label of is a bit of a misnomer, as it is not at all obvious what direction is ‘up’ with respect to inventory items.
can be better described as "shuffle items left". Each item in your Backpack moves over to the Slot to the left, or based on the terminology in this guide, their Slot number decreases by 1. The item in Backpack position 1 moves into your Hands, and the item in your Hands goes to the n position in your Backpack.

Start
1 Cycle Up
2 Cycles Up
3 Cycles Up

Unlike with , you can still use if your Hands are empty. Slot n will be empty and your Hands will receive Item 1. As per the rules in the introduction, the empty slot does not cycle. This means using will always put (or leave) a single item in Hands.

If your Hands have more than one item, will attempt to move all these items into the n slots.


If you do not have enough Backpack Slots the command fails and nothing moves. This means the can only be issued if the total number of items in your Backpack and Hands is equal to or less than your total Backpack space + 1.

Cycle fails.

is a powerful command as it is the only way to pull an item from Slot 1 into your Hands. As we will see, all other commands always put the n Slot into your Hands.
Cycle held item down


Unlike & , is the true reverse of . It can be better described as shuffling items right.
Each item in your Backpack moves over to the Slot on the right; their Slot number increases by 1. The item in Backpack position n moves into your Hands.


You can if your Hands are empty. Slot n will be empty and your Hands will receive the n occupied Backpack Slot.

behavior is otherwise identical to . Using any Cycle function will always put an item in your hands if you have anything in your Backpack. Cycle has no effect if your Backpack is completely empty.

The keybinds for and are oriented in the same manner as the functions of their relative commands. is bound to comma (,) and moves objects left. is bound to period (.) and moves objects right. Comma is to the left of period on a standard keyboard. This mnemonic can help one remember which command does what.
Swap held item


is very straightforward. It exchanges the items in your Hand with the n Backpack Slot.
All other remaining slots are undisturbed. Much like & , only the Hands and the n occupied slot are altered.


If your Hands have multiple items, you must have Backpack space to store these multiple items for to function.


Therefore will only work if your total inventory is equal to or less then your total Backpack Space + 1.
If your Hands are empty it will pull from the n slot, functioning exactly like .
If your Backpack is empty will put whatever you are holding into your Backpack exactly like .
Advanced Programs
Bots are limited to carrying one type of item without using the Backpack. This limitation severely restricts the programming possible. With the above information we can now create programs that allow otherwise impossible efficiencies. We can program Bots to use Buckets in addition to handheld ingredients.

Below are increasingly complex programs that use the Backpack commands.
Bulk Recipes
The recipes below are the simplest in this guide. They utilize the Backpack in the simplest sense, mostly just to store more objects for more efficient transport and less trips to storage containers.

Bulk Transfer

This basic program simply fills a Bot's entire Inventory with a single item and deposits everything into a single storage vessel. It may be tempting to check the "Exit Repeat on Fail" box when picking up items. This can break the program if the Bot stores enough items that its Backpack can hold everything and its Hands are empty.

Bulk Crafting

This program fills a Bot's inventory with Weeds. While String only needs 5 Weeds, picking up extra causes no issues at the String Maker because the extra Weeds will just sit in the hopper until the Bot returns. It economizes the Bot's time as fewer trips are needed to make the same amount of String. A Bot that only uses its 4 Hands will make half as much as String as one that uses 4 Hands and 4 Backpack Slots.

Bulk Tool Usage

This is a very simple but reliable program. The Bot will pick up as many Chisels as it is able and store them in the Backpack. It will constantly cycle through all the Chisels until they are all broken and then return to the Chisel Crate for more. This significantly reduces the number of trips for more tools.
This program can be used for wood choppers, clay diggers, and ore miners just as reliably.

Bulk Liquid Transfer

This script fills a Bot's entire Backpack and Hands with a Bucket. All Buckets are filled and emptied into a Barrel/Silo. When the Buckets break the Bot will fill its inventory again with new Buckets.
Advanced Bulk Crafting
The recipes below use the following generic formula, and only apply for items with a weight of 1.
A, B, C - Items that can be held in the hands.
L, M, N - Liquid/Particulates (Water, Sand, Mortar) that require a Bucket.
2x/3x/4x etc. - How many of the recipe will be made by the program.

3x(A + B)
Requirement: 3 Hands, 4 Backpack Slots.

This recipe makes 3 Tools at once and stores them in a crate. To make 2 Tools would require 2 Hands and 2 Backpack Slots. Note the collected Tool has to be Stowed in the Backpack as Bots can only hold one Tool at a time.

2x(A + B + C)
Requirement: 2 Hands, 4 Backpack Slots.

This recipe makes 2 Tools, but the Tool requires 3 ingredients, significantly increasing the complexity of the code. To make 1 Tool would require 1 Hands and 2 Backpack Slots.

2x(2A + B)
Requirement: 2 Hands, 4 Backpack Slots.

This recipe makes 2 Items that require 2 of an identical item and 1 of a different item.

2x(2A + 2B)
Requirement: 4 Hands, 5 Backpack Slots.

This recipe makes 2 Items that require 2 of an identical item and 2 of a different item.
Advanced Tool Usage
When first playing Autonauts, Bots are normally dedicated to specific tasks; this Bot chops trees, this Bot digs stumps, this Bot plants seeds, etc.
It is good advice to avoid complicated programs when starting; partly because the early Bots have so little data or storage it's not possible to run complex programs; but mostly because complex programs can fail easily.
Later having a single Bot perform all tasks related to a given harvesting operation (ore, lumber, crops, etc.) allows you to easily increase production by copying a single program to a new Bot. With simpler programs each program has to copied to a new Bot; in the case of Logs you'd have to program a Bot to chop, a Bot to plant, a Bot to dig, and a Bot to gather. While 4 bots would certainly create more Logs in output than one Bot, it does not allow more granular control and you may easily overproduce.

Miner Program
Requirement: 6 Hands, 2 Backpack Slots

This is a relatively simple mining program. The Bot collects several tools but only enough to fill the Backpack, keeping their Hands free. The Bot performs both mining and collecting into a nearby Crate. This program can be duplicated for Metal or Clay & easily modified to accommodate however many Hands or Backpack Slots the Bot has.
Note the Toggle Exit if Repeat Fails is enabled if a Tool breaks during the repeat uses.

Weed Program
Requirement: 3 Hands, 1 Backpack Slots

Here a Bot will dig up Weeds, replant as many as it can, and store this rest. This prevents Weeds from being used for other goods before they can be replanted.

Lumberjack Program
Requirement: 2 Hands, 2 Backpack Slots

This is a complicated program for Forestry. A single Bot chops down a tree, digs up the stump, puts the fallen log in storage, and replants the destroyed tree. Note this code only works because Spades and Axes have the same durability, and thus will break simultaneously on the same Repeat allowing the Bot to collect both Tools again.

Cereal Harvesting Program
Requirement: 4 Backpack Slots


This extremely lengthy (58KB) & complicated program has a single Bot pick up a Scythe, Hoe, and Watering Can. It tills the soil, plants 4 Seeds, fertilizes the crop, waters them, harvests the grown Cereal, and collects it into a storage bin.
The most interesting part of this program is the different durabilities of the Scythe, Can, and Hoe. Hoes have half the durability of these other Tools and will therefore break mid-program. This program compensates for this problem by picking up 2 Hoes at the start, and swapping in the second Hoe when the first inevitably breaks.
This program can plant as many seeds as the Bot has hands for.
Advanced Liquid Crafting
Liquids present a challenge not necessarily because they require an extra inventory slot, but primarily because a) the Bucket must be filled, b) different qualities of buckets hold varying amounts of liquids and have different durabilities, and c) when the Bucket breaks it can disrupt an entire program and freeze the bot. Many programs must start confirming that you both have a Bucket and that it contains liquid.

A+B+L
Requirement: 2 Hands, 2 Backpack Slots.

This program allows a Bot to mix a liquid with 2 other different items, in this case for bricks.

2x(A+B+L)
Requirement: 2 Hands, 4 Backpack Slots.

This is an extension of the program above, and essentially doubles the amount produced in a single trip.

2A+B+2L
Requirement: 2 Hands, 2 Backpack Slots.

A common problem at Tier 2 or 3 Colonist is creating Watery Porridge. This is difficult as you have to juggle Buckets and standard items, especially with the data limit of even a Mark 2 Bot. This program does require a data upgrade but the code fits. A Crude Bucket has only 21 durability. This odd number means it will guarantee to break mid program. This program takes 2 Buckets, thus the effective durability is 42 and the program can be truly infinite.

2x(2A+B+2L)
Requirement: 2 Hands, 4 Backpack Slots.

This complicated program makes double the recipe above. Note this will only work with Metal Buckets as each cycle uses 4 durability, and after exactly 50 cycles the Buckets will break and the Bot will automatically get a new one. With Good/Crude Buckets their durability is 51 & 21 respectively, and will break mid-program causing a failure.
Any program using a Bucket will eventually fail unless the total Bucket use per program cycle is divisible by the Bucket's durability. In the above example, the Bucket is actually used 4 times, as Watery Porridge requires 2 water. As a result a Good Bucket will fail on the 12th cycle. A possible workaround is to set the repeat to 12 uses, and have the Bot drop all buckets and then repeat the cycle infinitely.

5x(A + L + M)=N
Requirement: 1 Hands, 4 Backpack Slots.

A single Bot creates 5 Mortar at once & deposits it into a Barrel, completely independent of any other Bots except for the ones that make Buckets, Sand, and Water. However it is not completely infinite in its current form, and after 54 repeats the program fails because the Buckets will break mid-program. This could be rectified by having the loop stop at 54 repeats, force the Bot to drop/destroy its Buckets, and then resume the program infinitely. This would require a large amount of data.
Hypercomplex Codes
These are very lengthy codes that feature a Bot doing multiple steps or requiring multiple workbenches.

Simple Book

A Bot makes 4 Ink, then grabs 4 paper and makes a Simple Book. The Bot must destroy its Watering Can after 6 Books are made or it will break mid-program.

Full Coat

An entire Coat is created from scratch.

Silk Production

A single bot collects Silkworms, Mulberry leaves, and Cocoons required for silk production.

Jam

A Bot makes makes 2 Stewed Berries and then makes the Jam, which requires Honey. This Bot is juggling 2 Buckets, one is used 4 times per cycle and the other is used once per cycle. Continued indefinitely the Bucket used for Water will break before the Honey one does. This program will swap out buckets when the Honey Bucket is empty so that the durability loss is spread out evenly and both Buckets break at the same time (80 Cycles).

Advanced Mortar

This advanced Mortar recipe features a single Bot collecting 5 Clay & 2 Buckets, making 10 Mortar at once, and then depositing this all into a Mortar Silo. This is different from the above recipe as the Bot picks up 5 Clay at once, rather than going back and forth to the Clay storage.
Unfortunately as this requires 12 Bucket uses a Cycle, it is not possible to have 2 Buckets break at the same time (400 Durability between 2 Buckets is not divisible by 12). As a result this is only good for 33 cycles, which would still make 330 Mortar. The Bot can be programmed to destroy its Buckets after 33 cycles and repeat the cycles.
Having 3 Buckets is a durability of 600, and while this is divisible by 12, there is no way to distribute the durability loss per cycle so that all Buckets are destroyed on the final cycle.

Good Dough

A Bot makes 2 Watery Porridge, converts this into Crude Dough, and then makes this into Good Dough; all with one Kitchen Table and one Crude Mixing Pot. It requires every line of code from a Mark 3 Bot with a data upgrade.
2 Comments
Decius Brutus 4 Jun @ 4:37am 
For programs that require a bucket or watering can, you can check to see if a can is present with an "repeat forever: break on exception (if hands not empty, (if held item not empty, add to table, else get water) else get watering can)" loop. This can avoid having to destroy watering cans early when adding water, and also only adds water when needed.
standi98 2 Jun @ 6:08am 
In the "Bulk Crafting of string" program, doesn't the program break if the storage becomes full? The exit on fail makes the program restart when the storage becomes full, then when it stops being full the bot has string in it's inventory and that will jam the initial crafting process.