Skip to main content
This walkthrough documents the end-to-end process for creating a small sample-game title and building it for XBOX Series X|S consoles. You then deploy the complete game to an XBOX dev kit, diagnose startup failures, and create an installable XVC. The completed sample uses C++, Direct3D 12, and the GDK with XBOX Extensions (GDKX). It also uses DirectXTK12 as an optional rendering helper. Both paddles are computer controlled so the game can run unattended while you iterate on graphics, gameplay, and effects.
The public GDK available through GitHub or WinGet supports Windows PC game development only. To compile and deploy an XBOX console executable, install the GDK with XBOX Extensions (GDKX) from XBOX Secure Downloads. Access requires an approved XBOX developer account. See ID@XBOX onboarding and Access GDK resources and downloads.

What you’ll build

By the end of this walkthrough, you’ll have:
  • A native XBOX GDK project (not a UWP project).
  • Debug, Profile, and Release configurations for XBOX Series X|S consoles and XBOX One family consoles.
  • An autoplay sample game with scoring, predictive paddle AI, particle effects, a motion trail, and a textured circular puck.
  • A complete loose-file deployment running on an XBOX dev kit.
  • An optional Store-associated XVC that can be installed and tested on the dev kit.

Before you begin

This walkthrough was validated with:
  • Visual Studio 2022 Enterprise 17.14.
  • April 2026 Update 2 GDKX, edition 260402.
  • Gaming.XBOX.Scarlett.x64 for XBOX Series X|S consoles.
  • Gaming.XBOX.XboxOne.x64 for XBOX One family consoles.
  • DirectXTK12 commit e656d54637b2830fc6eb5ecd9b329a9c72cb87d4.
Use the GDK edition installed on your development PC instead of 260402 if you’re following the walkthrough with another release.

Step 1: Create the working folder

Open PowerShell and create an empty root folder.
The final project layout used in this walkthrough is:
Visual Studio creates DeviceResources.*, Main.cpp, pch.*, StepTimer.h, and the shell visual PNG files from the Direct3D 12 XBOX Game template. Keep those generated files when adding the sample-specific source.

Step 2: Verify the XBOX GDK installation

Open the XBOX Series X|S VS 2022 Gaming Command Prompt installed with GDKX. The shortcut is normally under Microsoft GDK on the Start menu. You can also initialize the environment from an ordinary command prompt:
Verify that the XBOX build and deployment tools are available:
The GDK installation isn’t ready for console development if:
  • GXDKEDITION is empty.
  • The XBOX command-prompt shortcut is missing.
  • Visual Studio doesn’t show XBOX project templates.
  • The Gaming.XBOX.Scarlett.x64 MSBuild platform is unavailable.
  • xbconnect or xbapp can’t be found.
If only Desktop GDK command prompts and Desktop templates are available, the public PC GDK is probably installed instead of GDKX.

Step 3: Create a native XBOX project

1

Open Visual Studio 2022 and select Create a new project

Set Language to C++, Platform to XBOX, and Project type to Games.
2

Select Direct3D 12 XBOX Game

Set the project name to sample-game and the location to D:\repos\sample-game.
3

Leave Place solution and project in the same directory cleared

So the solution is in the root and the project is in D:\repos\sample-game\sample-game.
4

Create the project

The supported workflow is to create the project through Visual Studio. Manually copying d3d12game_gx template files is a recovery technique, not the recommended new-project workflow.

Confirm the project is not UWP

Before adding game code, verify the project:
  • Contains MicrosoftGameConfig.mgc.
  • Uses a Gaming.XBOX.*.x64 project platform.
  • Links to the XBOX GDK platform libraries.
  • Does not use Package.appxmanifest as its title configuration.
  • Was created from Direct3D 12 XBOX Game, not a Universal Windows template.
If the project is UWP, delete it and create a new project from the XBOX GDK template. Converting the generated UWP project is more error prone than starting with the correct template.

Step 4: Pin the GDK edition and configure console targets

Pinning the GDK edition prevents a future GDK install from silently changing the toolchain used by the project. In the main property group in sample-game.vcxproj, set:
Use Visual Studio Configuration Manager to confirm these solution configurations: If the title only supports XBOX Series X|S consoles, you can omit the XBOX One family consoles configurations. See Cross-gen for shipping the same title across generations.

Step 5: Build the unmodified template

Build the generated template before adding dependencies or game code. This isolates toolchain problems from problems introduced by the sample. From an XBOX Series X|S VS 2022 Gaming Command Prompt:
For XBOX One family consoles, initialize the XBOX One command environment and build the XBOX One platform:
Do not continue until the stock XBOX template builds successfully.

Step 6: Add DirectXTK12 as an optional helper

DirectXTK12 isn’t required to create a GDK title. The XBOX GDK template already provides the Direct3D 12 device, command queue, swap chain, and game loop needed to build a game against Direct3D 12 directly. This sample uses the separate Microsoft open-source DirectXTK12 library. The library reduces the amount of low-level rendering utility code required for sprite rendering, descriptor management, texture loading, resource upload, and graphics memory management. A title can replace these helpers with its own engine or a direct D3D12 implementation. Clone DirectXTK12 into the project:
In Visual Studio:
  1. Add external\DirectXTK12\DirectXTK_GDKX_2022.vcxproj to the solution.
  2. Add DirectXTK12 as a project reference from sample-game.
  3. Add $(SolutionDir)external\DirectXTK12\Inc to the include directories.
  4. Build both projects for the same XBOX platform and configuration.
The sample-game project uses this property:
It then adds the include path and project reference:
In this project, the DirectXTK12 shader build commands were changed to invoke CompileShaders.cmd through an explicit project-relative path:
This avoids relying on the current command directory when MSBuild invokes the shader compiler.

Step 7: Add the game code

The sample separates gameplay state from rendering so the simulation can be tuned without changing Direct3D code. Keep the template-generated files, including DeviceResources.*, Main.cpp, pch.*, StepTimer.h, and the five shell visual PNG files. Add these sample-specific files to the project:

Use a fixed simulation step

The project uses the template’s StepTimer with a 120 Hz fixed update. A fixed step keeps collision response and AI behavior stable when frame times vary. The simulation contains:
  • Two paddle states.
  • One circular puck state.
  • Scores for the left and right sides.
  • A serve delay and alternating serve direction.
  • Impact events for paddle, wall, and goal collisions.

Implement circular puck collision

Treat each paddle as an axis-aligned rectangle and the puck as a circle:
  1. Find the point on the paddle rectangle closest to the puck center.
  2. Measure the squared distance from that point to the puck center.
  3. A collision occurred if the distance is no greater than the squared puck radius.
  4. Move the puck outside the paddle to prevent repeated overlap.
  5. Calculate the outgoing angle from the hit offset and paddle velocity.
  6. Increase puck speed slightly, up to a maximum.
This keeps the physics circular even though the puck is drawn from a square texture.

Add predictive autoplay

Each paddle:
  • Predicts where the puck will intersect its horizontal position.
  • Reflects the predicted coordinate across the top and bottom arena walls.
  • Updates its target at a fixed reaction interval.
  • Uses acceleration and maximum-speed limits rather than snapping.
  • Adds a small deterministic targeting error.
To allow games to score, each side occasionally enters a short mistake window and deliberately moves away from the predicted intercept. Stagger the initial mistake timers so both paddles do not miss simultaneously.

Render the scene with DirectXTK12

Create:
  • GraphicsMemory.
  • A descriptor heap containing a white texture and the puck texture.
  • A normal-alpha SpriteBatch.
  • An additive SpriteBatch for particles.
  • DDS textures through ResourceUploadBatch and CreateDDSTextureFromFile.
Draw the arena, center line, paddles, score, puck trail, and puck with SpriteBatch. Draw particles in the additive pass. The completed sample renders in a 1920 by 1080 virtual coordinate system and scales that scene to the output viewport.

Keep effects restrained

The final tuning used:
  • A short, exponentially decaying screen shake.
  • Smaller streak-shaped impact particles.
  • More particles on paddle hits than wall hits.
  • A stronger burst for a goal.
  • A low-alpha puck trail.
  • A brief green impact flash.
These changes preserved impact feedback without making the game appear cartoon-like or making paddle collisions visually jarring.

Step 8: Create and deploy the texture assets

The sample needs:
  • Assets\white.dds: a 1 by 1 white RGBA texture used to draw rectangles and particles.
  • Assets\xbox_logo.dds: a 256 by 256 RGBA texture used for the puck.
The asset script:
  1. Loads the source logo.
  2. Resizes it to 256 by 256.
  3. Applies a feathered circular alpha mask.
  4. Writes an RGBA8 DDS with a DX10 header.
  5. Creates the 1 by 1 white DDS.
Run it from PowerShell:
Register both DDS files as deployment content in sample-game.vcxproj:
A DDS file using the standard header plus a DX10 extension has 148 bytes before the pixel data. During the original session, a custom DDS writer emitted 152 bytes and the title failed during texture loading with 0x8007000D. If you use a custom DDS writer, validate the header layout before deployment.

Step 9: Build the game

From the XBOX Series X|S VS 2022 Gaming Command Prompt:
The loose build output is:
Confirm that the output contains:
  • sample-game.exe
  • MicrosoftGame.config
  • The shell visual PNG files
  • Assets\white.dds
  • Assets\xbox_logo.dds
  • Required runtime DLLs
  • The Game OS image or other deployment metadata produced by the build
The project source is named MicrosoftGameConfig.mgc. The GDK MGCCompile build item validates it and emits MicrosoftGame.config in the build output. Deployment and packaging both use the generated .config file. See Game config.

Step 10: Connect to the XBOX dev kit

Set the default console using its Tools IP address or host name:
Check the stored console:
Run connection diagnostics:
If the title uses a Partner Center sandbox, configure the case-sensitive sandbox ID and restart the console:
Display the current sandbox:

Step 11: Deploy the complete game

Deploy the entire build output folder:
Do not copy only sample-game.exe. The title also needs MicrosoftGame.config, assets, runtime dependencies, shell images, and deployment metadata. An executable-only copy is not a valid full deployment.
For a clean redeployment after changing assets or configuration:
Use xbapp list after deployment to find the registered package full name and application user model ID (AUMID). The AUMID ends with !Game.

Step 12: Launch and verify the game

Launch the exact AUMID reported by xbapp list:
Wait for the title process:
Verify that the package is running:
The expected result is:
At this point, the autoplay match should be visible on the dev kit.

Step 13: Diagnose an immediate launch failure

If the game exits immediately, do not assume that deployment succeeded because the executable was copied.

Get the last title result

Monitor debug output

Start a debug output monitor in one command prompt:
Launch the game from another:
The sample added OutputDebugStringA messages around:
  • Game initialization.
  • DirectXTK12 resource creation.
  • Each texture load.
  • Sprite pipeline creation.
  • Texture upload completion.
  • Frame exceptions.
The original session isolated the startup failure to loading white.dds. The loader returned 0x8007000D, which identified malformed DDS data. Correcting the DDS header and performing a clean full deployment fixed the launch. For more launch diagnostics, run xbWatson while reproducing the failure. See also Error handling.

Step 14: Iterate safely

For most code-only changes:
  1. Build Debug.
  2. Terminate the running package.
  3. Deploy the complete output folder.
  4. Launch the registered AUMID.
  5. Query the package state.
For changes to MicrosoftGameConfig.mgc, assets, or deployment metadata, uninstall the old loose deployment before deploying again. This prevents stale files or registration data from hiding a fix.

Optional: Create and test an XVC

Loose deployment is the fastest development loop. Create an XVC when you need to test retail-like installation or prepare a package for Partner Center. See Packaging for the full packaging reference.

Associate MicrosoftGame.config with Partner Center

Get these values from Game setup > Identity details for the product:
  • Package Identity Name.
  • Package Identity Publisher.
  • Publisher Display Name.
  • Store ID.
  • XBOX Title ID.
  • MSA App ID.
Use placeholders in source-control examples. Don’t copy another product’s identity. For XBOX Series X|S consoles, the important structure is:
TargetDeviceFamily="Scarlett" is required for the XBOX Series X|S consoles package. Use a separate configuration for an XBOX One family consoles package.

Build the Release configuration

Stage the package content

Copy the Release output to a staging directory, but keep gameos.xvd outside the content map and do not include PDB files as ordinary package content.

Generate the layout

For this small sample, the resulting layout contains one launch chunk:

Create a dev-kit test package

Default test encryption is useful for local dev kit installation:
When StoreId is present in MicrosoftGame.config, /productid is unnecessary for a normal Store submission. Omit it unless a documented offline or disc scenario specifically requires it.

Use submission encryption for a Partner Center package

Produce the sample-game package first with dev-kit test encryption so you can verify installation and launch. For a package that you will submit, follow the current packaging policy and use /lk or /l. The recommended repeatable /lk workflow is:
Secure the LEKB. Do not commit it to source control.

Install and launch the XVC

Terminate the package when testing is complete:

Common problems and fixes

See also

Last modified on August 21, 2026