Building games for game consoles and deploying / debugigng them has always been complicated, but Clockwork allows to build games for Xbox One very easily.

In order to deploy games to your Xbox you will first need to install Clockwork Runtime, by following that link on your Xbox or searching for the app on the Store.

Once you have the runtime set up in your Xbox, make sure both your development PC and the console are connected to the same local network. Then, launch the app in the console and you will be greeted by a screen similar to this one:

The initial Clockwork Runtime screen

The IP of the console, which will be useful later on, is shown at the bottom of the screen.

Now, open the game project with Visual Studio Code, press F1 and execute the Deploy Clockwork project to a remote machine command. You will see that the console starts installing the game package, excatly the as if you were deploying it on your PC!

Since the Runtime menu does not support gamepad input yet, unless you have a mouse attached to your console you will need to launch your game in debug mode. In the game project, open .vscode/launch.json (the file used by Visual Studio Code to know how to launch the project), and you will see something like this:

{
    // Use IntelliSense to learn about possible Node.js debug attributes.

    // Hover to view descriptions of existing attributes.

    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387

    "version": "0.2.0",
    "configurations": [
        {
            "type": "clockwork",
            "request": "launch",
            "name": "Debug game",
            "program": "${workspaceRoot}/manifest.json",
            "levelEditorEnabled": false
        }
    ]
}

When you create a new project, there is only one launch configuration defined, that allows you to debug games locally. We need to add another one that will point to our console, using the IP that is shown in Clockwork Runtime:

{
    // Use IntelliSense to learn about possible Node.js debug attributes.

    // Hover to view descriptions of existing attributes.

    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387

    "version": "0.2.0",
    "configurations": [
        {
            "type": "clockwork",
            "request": "launch",
            "name": "Debug game",
            "program": "${workspaceRoot}/manifest.json",
            "levelEditorEnabled": false
        },
        {
            "type": "clockwork",
            "request": "launch",
            "name": "Debug game on remote device", //You can choose any name you want

            "program": "${workspaceRoot}/manifest.json",
            "remoteMachine": "192.168.1.36", //Here you need to place the IP address of the console

            "levelEditorEnabled": false
        }
    ]
}

Finally you just need to open the Debug panel and select the new debug configuration:

Choosing a debug configuration

After pressing F5 the game will launch on the console, and you will be able to see the log on real time on your PC!

Have fun developing your Xbox game, here are some extra tips:

  • You can use the gamepad package to easily integrate the Xbox controller
  • When you finish your project, you can use the UWP bridge to upload it to the Store!