The Last Starship — Recipe Calculator
A tool that generates a dynamic Excel spreadsheet for planning crafting in The Last Starship by Introversion Software. Select any craftable item from a dropdown, enter a desired quantity, and the calculator instantly shows every intermediate component and raw material needed — with batch recipes automatically rounded up to the nearest complete craft run.
Requirements
- Python 3.8+
pip install pyyaml openpyxl
Generating the Excel file
python build_calculator.py
This reads all .yaml files from the recipes/ folder, computes the full
bill of materials for every craftable item, and writes
LastStarship_RecipeCalculator.xlsx.
Open the file, select an item from the dropdown in cell B6, enter a quantity in C6, and every required component and raw material is calculated instantly.
Project structure
├── build_calculator.py ← generates the Excel file from the YAML recipes
├── parse_recipes.py ← converts recipes.txt (from the game) into YAML
├── config.yaml ← output filename and alternative raw materials
├── recipes/
│ ├── smelter.yaml ← manually maintained (hardcoded in game engine)
│ ├── fabricator.yaml ← parsed from recipes.txt
│ ├── assembler.yaml ← parsed from recipes.txt
│ ├── refinery.yaml ← parsed from recipes.txt
│ ├── chemical_lab.yaml ← parsed from recipes.txt
│ ├── munitions_factory.yaml ← parsed from recipes.txt
│ └── laser_infuser.yaml ← parsed from recipes.txt
└── LastStarship_RecipeCalculator.xlsx ← generated output (not versioned)
How recipes work
Each .yaml file in recipes/ contains one or more recipe definitions:
ItemName:
out: 1 # how many are produced per craft run (>1 for batches)
equipment: Assembler # which machine crafts it (informational only)
duration: 30.0 # craft time in seconds (informational only)
ingredients:
- item: SomeComponent
qty: 3
- item: AnotherPart
qty: 1
Key rules:
- Item names are CamelCase and case-sensitive, matching the game's internal names
- Any ingredient with no recipe of its own is automatically treated as a raw material
out: 15means one craft run produces 15 units — the calculator divides ingredient quantities accordingly and rounds up to full batches in the Excel output- Files starting with
_are ignored by the calculator (used for reference files)
Updating after a game patch
Most recipes live in recipes.txt inside main.dat, which is a standard ZIP
archive. When the game updates:
Step 1 — Extract recipes.txt
Rename main.dat to main.zip and open it, or use 7-Zip directly.
The file you need is at: data/recipes.txt
Step 2 — Re-parse
python parse_recipes.py path/to/recipes.txt
This overwrites all YAML files in recipes/ except smelter.yaml.
Step 3 — Check smelter.yaml manually
Smelter recipes are hardcoded in the game engine and do not appear in
recipes.txt. Open recipes/smelter.yaml and verify the ratios still match
the game. Current verified ratios:
| Input | Output | Ratio |
|---|---|---|
| MetallicMinerals | MetalIngot | 2 → 1 |
| CopperMinerals | CopperIngot | 2 → 1 |
| PreciousOre | PreciousMetals | 2 → 1 |
| TiliumOre | RefinedTilium | 3 → 1 |
ScrapMetal as an alternative source for MetalIngot (3 → 1) is defined in
config.yaml under alternatives.
Step 4 — Rebuild
python build_calculator.py
Adding or editing a recipe manually
Open the relevant .yaml file in recipes/ and add or edit an entry, then
rerun build_calculator.py. You can also create new .yaml files — any file
in the recipes/ folder not starting with _ is picked up automatically.
If the same item name appears in two different files, the script raises an error identifying both files so you can resolve the conflict.
config.yaml reference
recipes_dir: recipes # folder to load recipe YAML files from
output_file: LastStarship_RecipeCalculator.xlsx # name of the generated file
alternatives: # alternative raw material sources
- crafted_item: MetalIngot # the item normally crafted from the primary raw
alternative: ScrapMetal # the alternative input
qty_per_unit: 3 # how many of the alternative per 1 crafted_item
Alternatives appear as extra rows in the Raw Materials section of the spreadsheet, showing how many of the alternative you would need instead.
Notes
- The calculator uses exact rational arithmetic (
Fraction) internally to avoid floating-point errors, converting to floats only when writing to Excel - Batch items (e.g.
RefinedMetreon,StableIsotopes) are rounded up to the nearest complete batch in the Crafted Components section of the spreadsheet - Rows for components not required by the selected item are automatically greyed out rather than hidden, so the layout stays stable as you switch items