TargetDeviceFamilyForDLC element to generate platform-specific DLC packages.
Set up your main package identity
- Look up the Store ID (12 character alphanumeric string) of your main application package in the Game Setup page for your main game product. (Example: 9PNX12345AAA)
-
Add the
StoreIdelement to your main package’s MicrosoftGame.config file.
Create a DLC package
- Create your DLC package add-on within Partner Center from the Add-Ons menu under your main product.
- Place all your DLC package content into a single directory.
- Create a MicrosoftGame.config file in the same directory as your DLC package content by using the sample data as follows.
-
Specify the Target Device Family that this DLC package is being created for in the
TargetDeviceFamilyForDLCfield. Allowed values are XBOX One, XBOX Series X|S, or PC. It’s required to be specified for XBOX One and XBOX Series X|S, and is optional on PC as long as the/pcflag is used when generating the DLC .MSIXVC file by using makepkg.exe. -
Look up the Package/Identity/Name field of your main application package in the Game Setup page of Partner Center, and then put the Identity Name in the
MainPackageDependencyfield. For example, MyPackageName -
Look up the Store ID (12-character alphanumeric string) of your Add-on/DLC package from Partner Center, and then place it in the
StoreIdfield as follows. -
Look up the Store ID (12-character alphanumeric string) of your main application package in the Game Setup page for your main game product. Place it into the
AllowedProductfield as follows. For example, 9PNX12345AAA
- Open a Microsoft Game Development Kit (GDK) command prompt in the folder that contains a single folder with all your game content, and then run the following command.
MakePkg genmap /f layout.xml /d <Your_dlc_folder>
- If you’re creating DLC for PC, use the following command.
MakePkg pack /f layout.xml /lt /d <Your_dlc_folder_name> /pc /pd <Output_Folder_Name>
- If you’re creating DLC for console, use the following command.
MakePkg pack /f layout.xml /lt /d <Your_dlc_folder_name> /pd <Output_Folder_Name>
In previous SDKs, you would pass the Product ID GUID of your main game on the command line with the /ProductID flag.
With the MicrosoftGame.Config model of configuring your DLC package relationships, don’t use the /ProductID parameter. MakePkg automatically places the appropriate information into your package based on the StoreIDs listed in your MicrosoftGame.config file.
Accessing DLC packages at runtime from your game
The basic steps to consume content within a DLC package are as follows.- Enumerate the packages
- Check for a valid user license for the target package
- Take the
packageIdentifierfrom the enumeration results and pass it to the XPackageMount API.
TargetDeviceFamilyForDLC unless you specify XboxOne for the DlcCompatibility field in your MicrosoftGame.config:
Deploying and testing a DLC package
Ensure that you install your main game package prior to installing your DLC package. For XBOX console, install your DLC package with the following command.xbapp install <Your_DLC_Package.xvc>
For PC, install your DLC package with the following command.
wdapp install <Your_DLC_Package.msixvc>
DLC content can also be registered from a directory with loose files, and testing can also be done with packages downloaded from the Microsoft Store.
For more information, see Manage and license downloadable content.
