Last hope: blueprint library recovery from save file. (v1.1.9+)

Anything that prevents you from playing the game properly. Do you have issues playing for the game, downloading it or successfully running it on your computer? Let us know here.
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 3191
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Last hope: blueprint library recovery from save file. (v1.1.9+)

Post by boskid »

Introduction
Recently v453000 asked me about options to recover blueprints of a player that lost his blueprint library (viewtopic.php?p=530872#p530872). I looked at possible options and there were not many, however thinking a little more lead me to the simple conclusion: when blueprints from library are used in game, they are transferred so all the players have a copy of imported blueprint so it has to be part of a game state and be included inside of the save file. They are there and should be possible to be extracted. Only reason why they were not possible to be extracted was that when a player joins with an empty blueprint library, there is a blueprint library synchronization happening which removes all the blueprints that player does not have. From this a simple idea started to grow: if the synchronization would be bypassed (would not happen), it would be possible to get hands on the blueprints inside of a save file and take them out.
Limitations
This approach has some limitations. When player joins the game, synchronization is able to delete blueprints but it does not transfer new ones: it only creates a preview of a blueprint because blueprints contain entity data which can take a lot of space. Blueprints that are in the preview state are not part of the game state yet so they cannot be recovered using this approach.
The way
In the main menu, click "Settings" while holding both Ctrl and Alt. Modifiers are required to expose "The rest" part with all the hidden switches.
bprec-main-menu.png
bprec-main-menu.png (32.13 KiB) Viewed 21491 times
In settings go to "The rest"
bprec-settings.png
bprec-settings.png (81.6 KiB) Viewed 21491 times
Inside of the "Other settings" enable the "bypass-library-sync" option
bprec-bypass-on.png
bprec-bypass-on.png (2.88 KiB) Viewed 21491 times
Go back to the main menu and open a save file from which you want to extract blueprints.
bprec-load.png
bprec-load.png (6.26 KiB) Viewed 21491 times
While in game, open the blueprint library. There will be a warning "Blueprint library is not synchronized" to inform that the blueprint library here is not synchronized with player's own blueprint storage so none of the blueprints from player's blueprint storage are shown here. This also works in opposite direction: changes here will not get saved to the player's own blueprint storage.
bprec-library.png
bprec-library.png (90.39 KiB) Viewed 21491 times
From this point you can take a look at the blueprints and transfer them out. Simplest way is to empty the inventory, Control+Left click on empty slot in the library to transfer all blueprints to the inventory, create an empty blueprint book inside of the Game Blueprints, open that book, transfer all the blueprints from inventory to the book (Control+Left click on empty inventory slot) and then export that book to the string.

Alternative approach is to transfer blueprints to the inventory or to the Game Blueprints and save the game at that state. After disabling "bypass-library-sync" hidden option you can then load that save file and transfer those blueprints back to the "My Blueprints" which at this point will be synchronized (there should be no "Blueprint library is not synchronized" warning)

Cleanup: do not forget to disable "bypass-library-sync" option (first 3 steps).
Final notes
This way is intended to be only a last resort because it does not help with recovery of blueprints that were not transferred to the game state. Keep in mind that blueprint library uses binary format that is evolving with the game itself so older game versions are unable to read blueprint library made by newer versions. Every time you want to downgrade the game, the blueprint library will be lost (however there should be a backup made which may require manual file renaming to make backup to be the active one). When there are preview-only blueprints in the library, there may be some unintended behaviors happening when those blueprints are requested to be transferred: starting from importing a blueprint from the player's own blueprint library ending on the crashes because blueprint with the given ID does not exist in the player's own blueprint library.
Diablo
Long Handed Inserter
Long Handed Inserter
Posts: 68
Joined: Thu Apr 21, 2016 12:35 pm
Contact:

Re: Last hope: blueprint library recovery from save file. (v1.1.9+)

Post by Diablo »

I just wanted to say here again, thank you so much for helping me out with this.
It means more then I can express here.

THANK YOU!
User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12889
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Last hope: blueprint library recovery from save file. (v1.1.9+)

Post by ssilk »

Would/should have been a nearly perfect FFF.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
User avatar
NotRexButCaesar
Smart Inserter
Smart Inserter
Posts: 1133
Joined: Sun Feb 16, 2020 12:47 am
Contact:

Re: Last hope: blueprint library recovery from save file. (v1.1.9+)

Post by NotRexButCaesar »

ssilk wrote: Sat Jan 16, 2021 8:37 am Would/should have been a nearly perfect FFF.
No gif means no FFF. (Devs are never sarcastic and always tell the 100% truth with no jokes)
talk on discord
—Crevez, chiens, si vous n'étes pas contents!
quinor
Filter Inserter
Filter Inserter
Posts: 404
Joined: Thu Mar 07, 2013 3:07 pm
Contact:

Re: Last hope: blueprint library recovery from save file. (v1.1.9+)

Post by quinor »

That's the most factorio devs' thing I've seen in a long time. Come on, can you set the standarts any higher...?! Absolutely love the attention.
Marco3104
Burner Inserter
Burner Inserter
Posts: 9
Joined: Thu Sep 05, 2019 4:03 pm
Contact:

Re: Last hope: blueprint library recovery from save file. (v1.1.9+)

Post by Marco3104 »

This Post literally saved me many hours of work. Thank you very much!
mrfox113
Manual Inserter
Manual Inserter
Posts: 1
Joined: Sat May 08, 2021 4:17 pm
Contact:

Re: Last hope: blueprint library recovery from save file. (v1.1.9+)

Post by mrfox113 »

Hello,

i tryd this, but after 5 bps into my inventory, the game crash.
User avatar
ssilk
Global Moderator
Global Moderator
Posts: 12889
Joined: Tue Apr 16, 2013 10:35 pm
Contact:

Re: Last hope: blueprint library recovery from save file. (v1.1.9+)

Post by ssilk »

You can make a bug report, please.
Cool suggestion: Eatable MOUSE-pointers.
Have you used the Advanced Search today?
Need help, question? FAQ - Wiki - Forum help
I still like small signatures...
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 3191
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: Last hope: blueprint library recovery from save file. (v1.1.9+)

Post by boskid »

mrfox113 wrote: Sat May 08, 2021 4:24 pm Hello,

i tryd this, but after 5 bps into my inventory, the game crash.
You are most likely trying to transfer a preview-only blueprint for which this method does not work. This was mentioned in the "limitations" part and in the "final notes" part. This is highly experimental "feature" and in case of a crash happening because of a misuse of it and following bug reports, i would rather remove this feature entirely rather than fixing it.
MiniHerc
Fast Inserter
Fast Inserter
Posts: 176
Joined: Fri Jun 26, 2015 11:37 pm

Re: Last hope: blueprint library recovery from save file. (v1.1.9+)

Post by MiniHerc »

boskid wrote: Fri Jan 15, 2021 11:00 am Only reason why they were not possible to be extracted was that when a player joins with an empty blueprint library, there is a blueprint library synchronization happening which removes all the blueprints that player does not have.
But why remove them?
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 3191
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: Last hope: blueprint library recovery from save file. (v1.1.9+)

Post by boskid »

Ambaire wrote: Fri Jun 04, 2021 3:36 pm
boskid wrote: Fri Jan 15, 2021 11:00 am Only reason why they were not possible to be extracted was that when a player joins with an empty blueprint library, there is a blueprint library synchronization happening which removes all the blueprints that player does not have.
But why remove them?
Because player does not have them in local storage so they must have been removed intentionally.
MiniHerc
Fast Inserter
Fast Inserter
Posts: 176
Joined: Fri Jun 26, 2015 11:37 pm

Re: Last hope: blueprint library recovery from save file. (v1.1.9+)

Post by MiniHerc »

boskid wrote: Fri Jun 04, 2021 6:16 pm
Ambaire wrote: Fri Jun 04, 2021 3:36 pm
boskid wrote: Fri Jan 15, 2021 11:00 am Only reason why they were not possible to be extracted was that when a player joins with an empty blueprint library, there is a blueprint library synchronization happening which removes all the blueprints that player does not have.
But why remove them?
Because player does not have them in local storage so they must have been removed intentionally.
Or the save was shared with another who would naturally not have those blueprints in local storage.
User avatar
Rescovedo
Manual Inserter
Manual Inserter
Posts: 2
Joined: Sat Dec 12, 2020 11:39 pm
Contact:

Re: Last hope: blueprint library recovery from save file. (v1.1.9+)

Post by Rescovedo »

Recently bought a brand new Macbook Air and I honestly have no words to express so much gratitude towards this tutorial. REALLY REALLY Thanks, I was able to restore all my library back to what it was!
buddiedelorenzo
Manual Inserter
Manual Inserter
Posts: 1
Joined: Tue Apr 26, 2022 3:56 pm
Contact:

Re: Last hope: blueprint library recovery from save file. (v1.1.9+)

Post by buddiedelorenzo »

I don't understand why this method should be used only as a last resort? You said that it's a good method for restoring blueprints.
aka13
Filter Inserter
Filter Inserter
Posts: 818
Joined: Sun Sep 29, 2013 1:18 pm
Contact:

Re: Last hope: blueprint library recovery from save file. (v1.1.9+)

Post by aka13 »

I had the issue, where I accidentally put a bp book from hotbar into inventory, which removed it from the cloud bp storage.
Saved me a lot of trouble!
Pony/Furfag avatar? Opinion discarded.
cheezecake
Burner Inserter
Burner Inserter
Posts: 6
Joined: Mon Oct 12, 2015 4:33 am
Contact:

Re: Last hope: blueprint library recovery from save file. (v1.1.9+)

Post by cheezecake »

Just want to say thank you! This saved so much trouble and headache. Just used the export the book to string and it worked perfect.
I am putting a sticky note next to my PC that says "Do NOT downgrade Factorio unless absolutely necessary and back up all blueprints"
Whalesaregreat
Manual Inserter
Manual Inserter
Posts: 1
Joined: Sun Feb 05, 2023 9:02 am
Contact:

Re: Last hope: blueprint library recovery from save file. (v1.1.9+)

Post by Whalesaregreat »

I created an account specifically to reply to this post to thank you. I spent nearly 4 hours today creating some rail and station blueprints, and I thought I had lost them after I accidentally removed them from my blueprint library and accidentally cleared them from my hot bar. Thank you so much.
Dmytrozern
Long Handed Inserter
Long Handed Inserter
Posts: 55
Joined: Sat May 29, 2021 9:25 am
Contact:

Re: Last hope: blueprint library recovery from save file. (v1.1.9+)

Post by Dmytrozern »

Still relevant. Downgraded my game to continue playing a save with active recording and lost my saves. Renaming the backup did not help, but this thread did. Thank you.
Primarily a vanilla player. Enjoy extreme rail world death worlds with biter expansion and a 10x+ tech price. Do not feel much fun after the tech tree is fully researched.
GriffiPlayz
Manual Inserter
Manual Inserter
Posts: 2
Joined: Fri Jan 13, 2023 8:02 pm
Contact:

Re: Last hope: blueprint library recovery from save file. (v1.1.9+)

Post by GriffiPlayz »

Thanks! My blueprint library disappered after enabling steam cloud sync for blueprints (just like expected, that feature is a bit broken), and my blueprint backup i made a few days ago didn't want to work for some reason. (I tried copying the blueprint library file)
You saved my blueprints
Last edited by GriffiPlayz on Thu Apr 27, 2023 4:11 pm, edited 4 times in total.
flintycrayon
Manual Inserter
Manual Inserter
Posts: 1
Joined: Fri Sep 29, 2023 9:20 am
Contact:

Re: Last hope: blueprint library recovery from save file. (v1.1.9+)

Post by flintycrayon »

You, sir, are my hero.
Thank you <3
Post Reply

Return to “Technical Help”