Creating Multiple Asset Bundles
This tutorial is out of date for the new Starter Game project that shipped as part of Lumberyard 1.25. We're working to revise it and provide better, more comprehensive instructions. |
Open 3D Engine (O3DE), the successor to Lumberyard, is now available in Developer Preview. Download O3DE |
The Build and bundle assets for release in Lumberyard tutorial gets you started with using the asset bundling system to produce a game release. However, it doesn't represent what most games require. In this tutorial, you learn the bundling process for a common use case: Games that download additional content after the player launches the game. The tutorial shows you how to create a release build with multiple game levels in separate asset bundles that have the contents of the base game removed.
This topic covers the following points:
-
Adding a new level and basic content to the Starter Game project.
-
Creating multiple asset bundles separated by game level.
-
Running the new build with and without the additional bundles.
Prerequisites
This tutorial requires completing Build and bundle assets for release in Lumberyard. After finishing that tutorial, you should have:
-
A bundled release of Starter Game located at
%USERPROFILE%\StarterGameRelease
-
The
startergame_pc.assetlist
andengine_pc.assetlist
asset list files used to generate the starter game asset bundles.
It's also useful to be familiar with the Amazon Lumberyard Asset List Comparison Operations for this tutorial.
Create a second level
In this section of the tutorial, you'll create a new level for the Starter Game that displays a static scene containing a single entity.
-
Launch the editor, and create a second level. Name it level2.
-
Create a camera. Right-click on the viewport and choose Create camera entity from view.
-
Create an object in front of the camera. To make sure that the object you create is located correctly, you may need to pull the perspective in the viewport back a bit so that you can clearly see the view frustum of the camera and know where the place the object.
-
Create a new entity in the level by right-clicking in the viewport somewhere within the camera frustum, and selecting Create entity.
-
In the Asset Browser view, search for the am_rock_boulder_01.cgf mesh.
-
Drag the boulder mesh on to the entity you created.
-
-
Make sure that the boulder is visible from the camera position by running your game in the editor. Select Game > Play Game (Ctrl-G). If you can't see the boulder, adjust its position with the editor's Move tool and make sure it appears within the camera's view.
-
Select File > Save (Ctrl-S) to save the level.
-
Select Game > Export to Engine (Ctrl-E) to export the level.
-
Exit the editor.
Generate the new content bundle
In the Build and bundle assets for release in Lumberyard tutorial, you created two .pak
bundles for the game release. This new level you've created only uses the already-available assets that are bundled with your game, making it easy to
distribute only the content that you need. One important feature available in Lumberyard Beta v1.24 and later is the ability to distribute level data as part of its
own .pak
, rather than with the auxiliary game data.
This section of the tutorial walks you through creating a new asset list based on the level2.pak
dependencies,
removing duplicate entries that already appear in startergame_pc.pak
, and bundling the level for distribution.
-
Create the seed list and asset list for
level2.pak
:Bin64vc
141
\AssetBundlerBatch.exe seeds --addSeed levels\level2\level.pak --seedListFile dlc_level2.seed Bin64vc141
\AssetBundlerBatch.exe assetLists --seedListFile dlc_level2.seed --assetListFile dlc_level2_all.assetlist -
Get the complement of the assets between
startergame_pc.assetlist
from the previous tutorial anddlc_level2_all_pc.assetlist
. This generates a new asset list containing game content exclusive tolevel2
.Bin64vc
141
\AssetBundlerBatch.exe compare --comparisonType complement ^ --firstAssetFile startergame_pc.assetlist ^ --secondAssetFile dlc_level2_all_pc.assetlist ^ --output dlc_level2.assetlistImportant The ordering of
--firstAssetFile
and--secondAssetFile
here is required. The compliment comparison works by taking content located insecondAssetFile
which isn't referenced infirstAssetFile
— not the other way around. See Amazon Lumberyard Asset List Comparison Operations for all of the details. -
Get the complement of the assets between
engine_pc.assetlist
from the previous tutorial and ldlc_level2_pc.assetlist
. This removes engine-specific content from thelevel2
assets.Bin64vc
141
\AssetBundlerBatch.exe compare --comparisonType complement ^ --firstAssetFile engine_pc.assetlist ^ --secondAssetFile dlc_level2_pc.assetlist ^ --output dlc_level2.assetlist ^ --allowOverwrites -
Create the asset bundle for
level2
:Bin64vc
141
\AssetBundlerBatch.exe bundles --assetListFile dlc_level2_pc.assetlist --outputBundlePath %USERPROFILE%\StarterGameRelease\startergame\dlc_level2.pak
Test the new level in release
-
Open a console and navigate to the release directory at
%USERPROFILE%\StarterGameRelease
-
Launch the new map:
release\StarterGameLauncher.exe +map level2
If everything works, you should see a scene similar to the following:

Conclusion
You now have a working example of a release build of a PC game on Lumberyard that uses multiple asset bundles. These bundles do not contain duplicate files, and you've performed a workflow that matches how a downloadable content system would add new content to an already released game.
Next Steps
Learn how to bundle patch updates instead of all-new content with the next tutorial in this series: Create content patches with Lumberyard.