![]() |
The Soft Object Path Tools plugin was created out of a need within my own project. There were functions which were not exposed in Blueprints and could only be done in C++. I love working with blueprints, so i had to make them be exposed to finish what i had in mind. The tools provide Blueprint nodes to achieve 2 main goals (although you can use them in other ways as well) The goals i had in mind were to be able to Download a PAK (Chunk) with the help from Google PAD which Unreal Engine provides by default, use the data in that PAK and be able to Pre-Load my level, since it is quite heavy and i wanted some control over how the loading happens. You can find the plugin on Unreal Engine's Fab website. I also created a Discord Chat if you have any questions about the plugin. |
Installation
Before you begin on your adventure, i highly recommend that you copy the plugin folder into your project folder. So that it is under "MyProject/Plugins/SoftObjectPathTools" If you don't have a "Plugins" folder in your project then create one. Also if you get into build issues, simply delete the "Intermediate" and "Binaries" folders within the plugin and let your project rebuild them.
Description
Included in the plugin is a Demo which illustrates essentially a ready made system for downloading Chunks from Google and Pre-Loading the data into an Object Array. I recommend looking into the demo as it is quite complex and took me several weeks to perfect after lots and lots of testing on mobile devices.
The plugin contains 5 sets of Blueprint Tools for you to be able to utilize the Google PAD plugin within Unreal and successfully download a PAK (Chunk), Mount it as well as re-scan the Asset Registry so your assets appear on your device. Additionally the Demo also includes an example of the second and third parts of the tool-set so you can Pre-Load level data, save it as a Table and use that table in your game-play.
The assets are stored while you load the level within your Editor and create a list of all references. You can use that created table in game-play to Async-Load the assets in an Object array to have in memory before your level is loaded.
The mounting part has to happen within code and as a part of the API since you cannot just input a folder path to your PAK file to be mounted. The Soft Object Path Tools plugin does just that.
We shall break the plugin into 2 sections since it really includes tools for two different things but i included them anyways as i know you shall want to do this as well :)
Mounting
![]() |
The heart of the whole Google PAD story is the mounting of the actual PAK since you can download it without any additional code but when it comes time to actually use it, the Mount function is not exposed in Blueprints. Additionally the Mount process requires to happen within the API, especially on newer Android devices which work in a Sandbox for each app downloaded. It is the same story as with Save Files for Android. |
The Mount node has 2 inputs you can define:
- Asset Path Location ID
- This is the ID that you enter from the "Get Asset PAK Location" node from the Google PAD plugin. It must be that. It cannot be the path as a string or anything else. Look for reference in the Demo how it is done as there is a process of getting the ID.
- PAK Filename
- The Filename is the actual filename you have on your build system. The one you added to the "On-Demand" folder when you set up your Chunk system. Note that this is NOT the PAK Name that Google shows in the packages. It must the the actual filename.
The LatentInfo and World Context Object are left empty and are required by the code internally.
Outputs
Once the Mount function has gone through, there can only be two outcomes. Success or Failure :) In the event of Success you are done as far as the PAK is concerned. You just need to Re-scan the Asset Registry so Unreal can see the files. Look into the Demo on how that is done. In the event of an Error you have the additional Text field output which will tell you what is wrong (if for example the file name is incorrect)
Note: Please have in mind that the Download -> Mount -> Registry Scan sections must be done EVERY TIME your game loads. You do it once for every session but the PAK has to go through this process every time you load a level or want to use any assets within the PAK. If the PAK is already downloaded, Google PAD will tell you and just skip to the next step (it won't download the file every time the user loads a level).
Pre-Loading
![]() |
The main reason i created these nodes was because i initially didn't organize my project as well as i should. I essentially had ALL my assets for all levels in a single folder and its sub-folders. So there was no way for me to know which asset goes with which level. In a way it turned out for the best since i could just make one chunk and include all my level assets in it. However You still need to know which assets correspond to which level if you want to Pre-Load them. In-Game this is not easy since we just mounted the PAK so the levels in it are not fully initialized until they are loaded and our assets are not in memory yet since we just mounted the PAK with them. |
So essentially you need a list of Objects which corresponds to each level individually if you want to load just the objects in that level. Technically you could just manually do a table and by hand input each asset but that is impractical, especially when you have complex levels with lots and lots of objects, materials and textures that are used in other things as well. So you are left with 2 main option of doing this. You can either create a Primary Data Label (if you had your assets organized per level in a separate folder) and add that label to the root of each level content folder so it can reference the data in it OR you can create the list for each level in Editor while you play the game as the level loads automatically. So you would essentially Cache the level references in a list in the Editor and then just package the list with your game when shipping.
For the above mentioned reasons i created the String Array -> CSV nodes which will save the referenced object list by level in a CSV file which you can then import into Unreal and have as an Asset (you can't just include a random TXT file in the game). Or you can use the Extract Referenced Soft Object Paths node to extract the references from the label you created. (Note: Normally in Blueprint you can get the referenced object from the label which you inputted as an "Individual Asset" BUT... you cannot extract the Sub-folder as well as Root folder objects manually. Those functions are usually done in C++)
Load / Save CSV To & From a String Array
![]() |
The node is pretty much self explanatory. You input into the node the Folder and File Name you want your String Array to be saved as (i have a separate folder in my Content named "Preload_Structure" where i save all the data for these functions) and input the String Array you want to save. Note: Please pay attention to the Data Table and Struct that is used in the Demo for importing the CSV file. You shall see that the Struct has a String input and the name of the row is "Value". This is important as the Save will format the file to be imported as that structure. |
Once you have your table and you imported the file, everything becomes automated. You just play your game in the editor, load all levels you have setup and the plugin will create automatically and update the list with referenced objects for each level. Then on the Shipped game you simply load the objects from the table you created.
I simplified the blueprint in the Demo (yes it is actually far more complex in my game) to just reference one level but i have a predefined Table structure in my game where i define for each level its Name, Object Path, Its reference and other parameters which i can then automate during load. So i would just call "Load Level: MyLevel" and it would go through the table and get all the data the game needs to get the correct info for it to use in the Pre-Load.
Extract Referenced Soft Object Paths From Label / Labels
![]() |
Both nodes do the same thing. I simply made the second one to get a ready array with labels i need as a group and process them without doing a For-Loop. You essentially input the Primary Data Label or an Array of labels into the node and the Soft Object Paths come out from the other side. The "Include Folder Assets" is that exact thing i created the node for. By having this checked, you include in the output all the references you have in the sub-folders of where the Primary Data Label sits. Note: Don't forget that you need to enable "Label Assets In My Directory" within the label, to actually include all assets in the sub-folders. You can check out how i set up the label in the Demo and what i enabled in it. Also there are few small files for the demo which illustrate how it works. |
Have in mind that once you got your Primary Data Labels, if you had them in the same Chunk you just mounted, you still need to Cast them to the "Primary Asset Label" class before you can use the plugin node. I show this in the Demo as well, so make sure to check out how it is done.
And that's it. Now you are the master of the Universe. King of the castle :) You can split your game without worries of package limitations from Google AND you have a pretty neat way to Pre-load Level Objects and save your users from Memory spikes, especially on Low End devices.