Space Engineers

Space Engineers

45 ratings
How to Convert Prefabs to Blueprints
By jlp1528 (Minty)
This guide explains how to convert "Prefab" files (used to spawn pirate bases, drones, etc. in worlds) to Blueprints for use in projectors and creative copy/paste.

You can also extract blueprints from projectors in save files, as explained in the final "ADVANCED" section of the guide.
   
Award
Favorite
Favorited
Unfavorite
Example: Easy Start Earth "Mining Operation Site" pirate base with drones
TL;DR/I'm lazy. ;)
1) Download one, more, or all vanilla prefab blueprints (as the ZIP archive file) from game update v01.110.008 HERE[drive.google.com].

2) Copy the folders (or unzip the zip/7z file) to your local blueprints folder: "%appdata%\SpaceEngineers\Blueprints\local"

3) Have fun! :D
This is what I did, why, and how to do it yourself.
What I did, why, and how to do it yourself:

I wanted to be able to spawn/build bases, drones, etc. that spawn in worlds. Unfortunately, the files used for this are not blueprints per say, but prefabs. However, the XML definitions are interchangeable. So, to convert a prefab file to a blueprint file (or vice versa, at least theoretically), all you have to do is change a couple of tags in the file.

This probably sounds complicated, but it's actually not nearly as bad as you may think, especially if you use Notepad++. Actually, if you haven't already, ditch "vanilla" (Windows) Notepad and get Notepad++ today. :)
get Notepad++ here ;)[notepad-plus-plus.org]

Anyway, here is the procedure, step by step.

1) Pick a prefab (base/drone/whatever) that you want to be able to spawn/build. For this example, I will use the "Stinging Adversary", one of the two drones (the other being the "Fleeting Rival") that spawn from the "Ore Handling Facility" pirate base (5km from your starter base on "Easy Start Planet" worlds).

2) Find the prefab file. Usually* the name of this file is similar if not identical to the name of the ship itself. In this case, the file name is "Stinging_Adversary_mk.1". All prefab files are located in "C:\Program Files (x86)\Steam\steamapps\common\SpaceEngineers\Content\Data\Prefabs".

* - If the file name is not the same as the ship, don't worry; try to think logically about what the name might be. Take an educated guess, open the file you think it is, and search for the antenna name in the file itself. For example, that "Ore Handling Facility" pirate base is actually defined by the file "EasyStartPirate". You could also try the free program "TextCrawler" to search through all the files at once.
get TextCrawler[www.digitalvolcano.co.uk]

3) Copy the file to a "workspace" location of your choice and open it with your favorite compatible XML and/or text type file editor (XML files are technically "text" type files and I use Notepad++). At the top and bottom of the file, you will see the tags defining it as a Prefab. Use "Find and Replace" to replace all instances of "Prefab" with "ShipBlueprint".

Note: There is also a <SubtypeId>(ship/station name)</SubtypeId> line. This defines the name of the blueprint in the Blueprints screen. You may change it from here if you wish, or you may simply use the native (in-game) "Rename" function. You can even define the "Author" of the blueprint by adding <DisplayName>(insert name here)</DisplayName> after the </Id> block.

Example:

Before:
<Prefabs>
<Prefab>
<Id>
<TypeId>MyObjectBuilder_PrefabDefinition</TypeId>
<SubtypeId>Stinging_Adversary_mk.1</SubtypeId>
</Id>

After:
<ShipBlueprints>
<ShipBlueprint>
<Id>
<TypeId>MyObjectBuilder_ShipBlueprintDefinition</TypeId>
<SubtypeId>(insert ship/station name here)</SubtypeId>
</Id>
<DisplayName>(insert author name here)</DisplayName>

4) Save the file and copy it to a folder in your local blueprints folder: "%appdata%\SpaceEngineers\Blueprints\local\(blueprint name)". Rename the file "bp".

5) If you followed steps 1-4 correctly, you should be able use this new file like you would any other blueprint. Have fun! :D
ADVANCED - extract blueprints already loaded into projectors from a save file
So let's just say that you come across a world with one or more projectors that are already projecting blueprints, but you don't have the original blueprint files. Sure, you could build the ProjectedGrid and copy it as a blueprint once it's built, and I guess that works great if the grid is small and manageable enough. But with the projector's "instant build" function currently MIA, doing so still isn't exactly ideal, especially as the size of the ProjectedGrid increases.

Fortunately, you can use almost exactly the same procedure outlined in this guide to extract already ProjectedGrids from the world save file itself! However, the procedure is not 100% identical, and a few additional steps and tweaks are necessary - hence "ADVANCED" in the title of this section. That said, unless you went with the "TL;DR/I'm lazy" way, it shouldn't be that hard. Even if you did go that way, I have added the "Drop Ship" and "Scuttler" blueprints from Easy Start Earth to the shared Google Drive folder and the zip file. :)

Okay, but let's say you find a workshop world that presents the same issue. Here's what to do:

1) Open the save file with Notepad++ (%appdata%\SpaceEngineers\Saves\<ID>\<world name>\SANDBOX_0_0_0_.sbs).

2) Search for "ProjectedGrid" to locate the lines defining the grid in the projector; note that if there are multiple projectors in the world, every odd match (1,3,5,etc.) will be the "start" tags and every even match (2,4,6,etc.) will be the "end" tags of their projected grids.

3) Note the line numbers of the "start" and "end" tags of the grid you want - select everything from the start of the <ProjectedGrid> line to the end of the </ProjectedGrid> line.

4) Using a copy of an existing blueprint file as a template, copy and paste this selection between the <CubeGrids> and </CubeGrids> lines. Replace "ProjectedGrid" in the tags with "CubeGrid".

5) Set the SubTypeId to the name of the blueprint - see the note for step 3 above.

6) Delete the following lines:
<CreatePhysics>false</CreatePhysics>
<EnableSmallToLargeConnections>false</EnableSmallToLargeConnections>
<LocalCoordSys>0</LocalCoordSys>
I'm not sure this is necessary, but these lines do not exist in blueprint files, so they might cause issues if not removed.

7) Proceed through step 4 above.

8) Again, if you've done everything correctly, you should now have a working blueprint from the ProjectedGrid of a projector in a save file. Have fun! :D
26 Comments
jlp1528 (Minty)  [author] Oct 2, 2021 @ 10:53am 
Thank you chaos for requesting access to the Google Drive folder, which informed me that the link was broken by a security update. I fixed the link. Enjoy!
jlp1528 (Minty)  [author] Aug 20, 2021 @ 8:47am 
Happy to see this is still working halfway through 2021. Maybe I'll have to update the Google Drive folder with everything that has been added since. It's been a long time...
Volnick Aug 19, 2021 @ 11:13pm 
This was extremely easy and it worked perfectly. Thank you so much!
Mrcalzon02 Apr 11, 2021 @ 1:02pm 
who's here in 2021 looking for how to make Prefabs :) i am :)
Wingnut Apr 7, 2020 @ 1:40am 
Nevermind i managed to figure out what the problem was, I kept renaming the actual files bc instead of bp
Wingnut Apr 7, 2020 @ 1:35am 
I was able to spawn a cut random encounter called Pilgrim with all the debris in one blueprint using this, i cant seem to do it with the others though
Leonexis Aug 12, 2019 @ 9:30pm 
If you have a folder with a bunch of prefab sbc files, or a complete folder structure (such as copied from a compilation mod), and you have a Bash shell (such as Git Bash), the following worked for me (right click the containing folder and click Git Bash, then paste this):

find -name '*.sbc' ! -name 'bp.sbc' | \
while read i; do \
echo -n "$i ..."; \
mkdir "${i%.sbc}" && \
mv "${i}" "${i%.sbc}/bp.sbc" && \
sed -i 's/Prefab/ShipBlueprint/g' "${i%.sbc}/bp.sbc" && \
echo "done." || echo "FAILED!"; \
done

NOTES: This will modify the files in place. Make sure to run this on a copy. It can't tell if the .sbc files are actually Prefabs. It must run in Bash. Download the official Git for Windows for an easy way to get a good unix-like environment for Windows. I'm a Linux programmer by day that just happens to have to use Windows to play SE. Maybe a Powershell guru could convert my Bash...

I had a longer writeup, but comments can only be 1k. Happy hacking.
Skibez Apr 23, 2019 @ 12:21pm 
So I got it to work, the <TypeId> and the <SubtypeId> tags have now merged. It's:
<Id Type="MyObjectBuilder_ShipBlueprintDefinition" Subtype=" (ship/station name) " />

At the bottom of the code between </CubeGrids> and </ShipBlueprint> I inserted:
<WorkshopId>0</WorkshopId>
<OwnerSteamId> (Your Steam ID Number) </OwnerSteamId>
<Points>0</Points>
and it worked.

You can retrieve your Steam Id number easily from any existing blueprint. I also followed the rest of the guide.
STOGGY RETURNS Sep 1, 2018 @ 2:47am 
This doesnt seem to work for me
jlp1528 (Minty)  [author] Jan 16, 2018 @ 7:26am 
Given that there still appears to be some interest in this guide, I will consider trying to rewrite it to work with whatever Keen changed this time. I gotta be honest though, I am really sick of Keen going back on their word. While no actual promises were made, they did say that they would try not to break mods, guides, and similar things with game updates back in the day. Now it seems they just don't GAF about the community anymore, and it shows - the community, and the game itself, is dying. It's a shame really... Space Engineers could've been a lot better if they had just thought things through more and remembered that without the community, Indie games very rarely reach their full potential.