NOTE: This project has been deprecated, in favor of npm scripts inside the factoriolab repository itself. This tool is no longer maintained and will not generate data sets that work with the latest versions of FactorioLab.
This is the repository for FactorioLab Export, a Factorio mod that logs game data to JSON files and an icon sprite sheet that can be used by FactorioLab.
After following the steps in getting started, you can use this mod to create a new data set, update an existing data set, or localize a data set.
This mod works best when run in Instrument Mode. Learn more
- Install this mod alongside any mods that should be included in the data set
- Set up Steam to run this mod in Instrument Mode
- In the library, right click Factorio and in Launch Options enter:
--instrument-mod factoriolab-export
- Alternately, run Factorio from the command line with these options
- Why instrument mode?
- In the library, right click Factorio and in Launch Options enter:
- Fork and clone the FactorioLab repository, and follow the instructions for running locally
- Ensure the Factorio language is set to Default
- Start a new game
- A message should be logged indicating the output has been written to
%APPDATA%\Factorio\script-output\factoriolab-export
- A normal export includes
data.json
,hash.json
, andicons.png
- A normal export includes
- Create a new folder in the FactorioLab repository under
src\data
- These folders use a three-letter abbreviation for brevity when used in the URL, or a combination of three-letter abbreviations if multiple mod sets are included (e.g.
bobang
for Bob's and Angel's)
- These folders use a three-letter abbreviation for brevity when used in the URL, or a combination of three-letter abbreviations if multiple mod sets are included (e.g.
- Add an entry for this mod set in
factoriolab\src\data\index.ts
- This should include the folder name as the
id
, a friendly name as thename
, andgame: Game.Factorio
- Also add the
id
of the mod to the end of thehash
array in the same file
- This should include the folder name as the
- Double check the
defaults
object indata.json
to ensure reasonable defaults are used for this data set - Run the application and load the data set, then refresh the page
- If the calculator fails to find a solution within five seconds, update the
disabledRecipes
indefaults
- A suggested default for this will also be logged to the browser console
- Ensure the Factorio language is set to Default
- Start a new game
- A message should be logged indicating the output has been written to
%APPDATA%\Factorio\script-output\factoriolab-export
- A normal export includes
data.json
,hash.json
, andicons.png
- A normal export includes
- Copy only
data.json
andicons.png
to the appropriate folder in the FactorioLab repository undersrc\data
- Do not copy
hash.json
, overwriting the old file would break existing saved links
- Do not copy
- Double check the
defaults
object indata.json
, or copy thedefaults
from the original data set if it is still valid - Run the application and load the data set, then refresh the page
- An object will be logged to the browser console indicating the new
hash
for this data set - Copy that object and overwrite the existing
hash.json
for this data set, this should only append ids
- An object will be logged to the browser console indicating the new
- If the calculator fails to find a solution within five seconds, update the
disabledRecipes
- A suggested default for this will also be logged to the browser console
- Ensure the Factorio language is set to the language you want to use for localization
- Start a new game
- A message should be logged indicating the output has been written to
%APPDATA%\Factorio\script-output\factoriolab-export
- A locale export includes
i18n\lang.json
, wherelang
is the language code
- A locale export includes
- Copy this folder and its contents to the appropriate folder in the FactorioLab repository under
src\data
- Run the application and load the data set, then choose the language you localized to verify the localized data works as expected
Running in instrument mode is technically optional but strongly recommended and required if submitting a PR to FactorioLab.
FactorioLab Export uses instrument mode to check icon data for cases where icons will be rendered at unexpected sizes in the game, to ensure that the generated sprite sheet sizes the icons appropriately. In certain cases icons can bleed out of the expected size or can be scaled in unexpected ways that can only be detected in the data stage. FactorioLab Export runs these checks in the instrument-after-data.lua
file to ensure that it has the most up to date icon information from all loaded mods.
Unfortunately, the Factorio Lua runtime exposes no method to determine what size a sprite will be rendered to when using LuaRendering.draw_sprite
. By checking the icons in the data stage, FactorioLab Export can predict the size and use the scale
parameter to ensure all the icons are the desired size.
FactorioLab Export checks for a few edge cases that do not currently work well with the FactorioLab calculator.
-
[FLE] Detected multiple fuel categories for entity
id
, exporting first category only- FactorioLab currently can't handle factories that allow mutiple fuel categories, see issue #744
- FactorioLab Export will only include the first fuel category
-
[FLE] Skipping boiler recipe for entity
id
, failed to find water or steam fluid- FactorioLab generates boiler recipes using the
water
andsteam
items. If those items are not found due to changes from a mod, it cannot create boiler recipes
- FactorioLab generates boiler recipes using the
-
[FLE] Skipping recipe
id
, failed to find producers- FactorioLab Export couldn't find any factories that allow this recipe
- This most commonly occurs when the mod attempts to generate a recipe to generate the burnt result of a fuel, but the fuel is only allowed in entities like trains that cannot be used as producers in FactorioLab
-
[FLE] Failed to find fluid or item prototype for recipe product/ingredient
id
- This indicates a problem where a product or ingredient could not be found in the list of
game.item_prototypes
orgame.fluid_prototypes
- This indicates a problem where a product or ingredient could not be found in the list of
-
[FLE] Failed to find appropriate tech to represent infinite research, looking for
id
- FactorioLab Export includes recipes for infinite technologies, and attempts to create a category for these based on the
space-science-pack
technology - If that technology does not exist in the mods loaded, need to declare an explicit tech to use - please open an issue
- FactorioLab Export includes recipes for infinite technologies, and attempts to create a category for these based on the