In other languages:

Blueprint string format

From Official Factorio Wiki
Revision as of 08:55, 19 November 2017 by Bilka (talk | contribs) (→‎Icon object)
Jump to navigation Jump to search

This is a technical description of the blueprint string format, used to share blueprints with other users.

A blueprint string is a json representation of the blueprint, encoded using base 64 with the version byte in front (0 in vanilla 0.15) and then compressed with zlib deflate. So to get the json representation of a blueprint from a blueprint string, skip the first byte, base64 decode the string, and finally decompress using zlib deflate.

Json representation of a blueprint/blueprint book

The json representation of a blueprint or blueprint book is one large object, named either blueprint or blueprint-book.

Blueprint book object

Key Description
item String, the name of the item that was saved ("blueprint-book" in vanilla)
label String, the name of the blueprint set by the user
blueprints The actual content of the blueprint book, array of objects containing an "index" key and value (starts with 0) and a "blueprint" key with a #Blueprint object as the value
active_index Index of the currently selected blueprint (starts with 0)
version The map version of the map the blueprint was created in (but converted to an uint, not sure how)

Blueprint object

Key Description
item String, the name of the item that was saved ("blueprint" in vanilla)
label String, the name of the blueprint set by the user
entities The actual content of the blueprint, array of #Entity objects
icons The icons of the blueprint set by the user, array of #Icon objects
version The map version of the map the blueprint was created in (but converted to an uint, not sure how)

Icon object

Key Description
index Index of the icon (starts with 1)
signal Object with a type key/value ("item" or "virtual") pair and a name key/value pair.

Entity object

Key Description
entity_number Index of the entity (starts with 1)
name Prototype name of the entity (e.g. "offshore-pump")
position Position of the entity within the blueprint. Object with a x key/value pair and a y key/value pair
direction Direction of the entity, uint (optional)
connections Circuit connection, object with keys starting from 1, values are #Connection objects (optional)
control_behaviour
items
recipe