Deploying to XBOX One with the XBOX Live Creators Program and Unity

xbox-header.png

1. Introduction

The purpose of this article is to create a Universal Windows Platform game application that is built to run on the Microsoft XBOX One game console. Consoles currently hold a 25% stake (~$34.6 billion) in the global games market. (Wijman, 2018) By developers limiting their development experience to Windows PC only titles, they are missing out on a quarter of the global games market. While building a game and deploying to a console might seem difficult, Unity and Microsoft have partnered to create an extremely simple workflow that is already built into Unity. This article is intended to help them generate exposure with console development through Unity and the XBOX Live Creators Program.


2. Background

The Universal Windows Platform (UWP) is an API created by Microsoft for use in developing platform independent, universal applications for Microsoft products including Windows 10, HoloLens, and XBOX One. (Universal Windows Platform, n.d.) Unlike traditional API’s, UWP aims to create a common app platform for every device that is running Windows 10 through different Extension SDK’s that feature native Windows 10 functionality such as Cortana, Windows Timeline, XBOX Live integration, and more. (What's a Universal Windows Platform (UWP) app? - UWP app developer, 2018) Primarily, UWP is used by game developers as the build target for lightweight XBOX One applications. In this article, we will utilize UWP and the Windows Gaming interface to deploy to the XBOX One platform.

The XBOX Live Creators Program allows you to publish your games to XBOX One and Windows 10 quickly and directly. The certification process is simple, and no concept approval is required. If your game integrates Xbox Live and follows the standard Store policies, you are ready to publish. (About the XBOX Live Creators Program, n.d.)

Find more information about the XBOX One Creators Program here.


3. Project Challenges

Given the mid-tier system requirements of the XBOX One, there are certain considerations that need to be made in both game design and technology. (System resources for UWP apps and games on Xbox One, 2017) Screen scaling and resolution, branding, and optimization are crucial to ensuring the player gets the best experience possible.

With the shift to UWP, XInput was no longer supported in that API and therefore, was no longer supported on the XBOX One console. Unity’s default input system has the ability to handle standard gamepad input for UWP but the framework and structure of this input system is not user friendly, cumbersome, and lacks gamepad rumble support.

This method of building a UWP project is intended for lightweight apps and games are not given the full resources they would by building directly for the XBOX One console. Because of this, there are some technical limitations for what can and cannot be done.


4. Prerequisites

Unity prerequisites

  1. Windows 10

  2. Unity

    • Unity: Unity versions 5+ support the UWP API. Ensure that the Windows Store .NET and IL2CPP Scripting Backends are installed with Unity.

  3. Visual Studio 2017 and Unity must have the correct packages enabled

    • Visual Studio: For best results, the 2017 version of Visual Studio should be used.

    • Universal Windows App Development Tools: Modules found in the Visual Studio Installer.

  4. Windows 10 SDK

    • Note: At the time of this publication, version 1809 (servicing release 10.0.17763.132) is being used

  5. XBOX Live Creators Program Account

  6. Xbox Live/Microsoft Account

UWP Settings from Unity Hub

UWP Settings from Unity Hub

UWP Settings from Unity Installer

UWP Settings from Unity Installer

Registering the Xbox One

Preparing your Xbox

  1. Turn on your Xbox One, it will take a few minutes to setup

  2. Sign into/create your Xbox Live/Microsoft Account

  3. Once on the Dashboard Home, press the Xbox button on the controller, open the Store

  4. Use the Y button on the controller top search the “Dev Mode Activation” app

  5. Download and run the app

Registering on the Web

  1. Follow the link provided by Microsoft for the Creators Program to the Developer Dashboard

  2. Click the settings gear (top right corner of screen) and select “Account Settings”

  3. In the left-hand menu, select “Dev Devices” and “Xbox One development consoles”

  4. Click “Enter activation code.”

  5. Enter the code provided by the Dev Mode Activation app


5. Building a solution

PublishingSettings.PNG
BuildSettings.PNG
  1. Ensure that the Windows Store .NET and IL2CPP Scripting Backend features have been added to your Unity install

  2. Ensure that Visual Studio 2017 has been installed and is set as the target for Unity

  3. Create a project

  4. Ensure that your Publishing settings are correct in the Player Settings in order to build a correct WSACertificate.

    • Note: They can be accessed by Edit -> Project Settings -> Player -> Publishing Settings.

  5. Go to File -> Build Settings, select Universal Windows Platform (UWP) NOT XBOX One, and use the Switch Platform button to switch the target platform to UWP

  6. Select appropriate settings for your build

    • Note: In order to build and successfully deploy to XBOX One some specific settings are required.

      • Build Type: D3D (Direct3D)

      • SDK: latest installed (10.0.17763.132 - see above prerequisites)

      • Visual Studio Version: latest installed (Visual Studio 2017 - see above prerequisites)

  7. Build for Universal Windows Platform (UWP)

    • Note: This creates a Visual Studio solution (.sln).

  8. If you haven’t downloaded it already or included it in your install, Unity should open a Unity download for the Windows Studio UWP components. Install this, it should be about 5GBs

Result.PNG

6. Deploying to XBOX One

IP.PNG
  1. Launch the XBOX Developer Dashboard on the XBOX One

  2. Open the Visual Studio .sln in Visual Studio 2017

  3. Change the Visual Studio architecture to x64

  4. In the Play button settings of Visual Studio (dropdown arrow) and select “Remote Machine”

  5. Go to Project -> Properties -> Debugging and select Remote Machine from the dropdown

  6. In the “Machine Name” field, enter the IP address from the XBOX Developer Dashboard

    • Note: The first time you connect, it may ask for a Visual Studio Pin. Enter the pin found on the Xbox Developer Dashboard after selecting “Show Visual Studio Pin.”

  7. Deploying may take a while as it is pushing the content over the network. Your first deployment will take longer as there will likely be missing libraries

  8. Your app should show up on the Developer Dashboard

    • Note: Select to open if it does not do so automatically.


7. Iteration steps

Many of the steps listed above only need to be done on an apps first launch. The steps below outline the common steps used when developing a project.

  1. File -> Build Settings and build for Universal Windows Platform (UWP)

  2. Open the Visual Studio .sln in Visual Studio 2017

  3. Build the Solution (F6)


8. Notes

This guide should be used in combination with your own research.

There may be pieces of information that become outdated and I will do my best to update them

Marketing assets can be setup through the Player settings or added to the ProjectName/Assets folder in the root of the UWP build.

When rebuilding a Visual Studio Solution (.sln) for UWP from Unity, there may be build errors related to the IL2CPP Scripting Backend.           

  • Steps to solve this

    • Close the .sln

    • Delete the Il2CppOutputProject folder in the root of the UWP build

    • Delete the ProjectName/Data folder in the root of the UWP build

    • Relaunch the build tool from Unity


Feel free to contact me or comment with any questions!


9. Resources

Unity Porting Guide. (n.d.). Retrieved from Unity Technologies: https://unity3d.com/partners/microsoft/porting-guides

About the Xbox Live Creators Program. (n.d.). Retrieved from Unity Technologies: https://unity3d.com/partners/microsoft/creators-program

Lewis, Robert. (n.d.).

System Requirements for Unity 2018.1. (n.d.). Retrieved from Unity Technologies: https://unity3d.com/unity/system-requirements

System resources for UWP apps and games on Xbox One. (2017, February 08). Retrieved from Microsoft: https://docs.microsoft.com/en-us/windows/uwp/xbox-apps/system-resource-allocation

Universal Windows Platform. (n.d.). Retrieved from Wikipedia: https://en.wikipedia.org/wiki/Universal_Windows_Platform

What's a Universal Windows Platform (UWP) app? - UWP app developer. (2018, May 07). Retrieved from Microsoft: https://docs.microsoft.com/en-us/windows/uwp/get-started/universal-application-platform-guide

Wijman, T. (2018, April 30). The Global Games Market 2018. Retrieved from Newzoo: https://newzoo.com/insights/articles/global-games-market-reaches-137-9-billion-in-2018-mobile-games-take-half/

XInput and DirectInput. (2018, May 31). Retrieved from Microsoft: https://docs.microsoft.com/en-us/windows/desktop/xinput/xinput-and-directinput

Reusable and robust: A look at Dino Delivery's modular puzzle system

I have been working with a team of awesome developers on Dino Delivery for about a year and a half. During that time, our gameplay went through many iterations and reworkings but one of the things that remained constant was the desire for a modular, easy to use puzzle system that designers and artists could use to bring interactive objects to life in the game. What started as a simple object manager, turned into a robust, highly reusable puzzle system that is core to our gameplay.

Now that we have shipped the latest iteration of the game, I wanted to showcase how this system I created works. At its core, the system is pretty simple. A designer or artist drags in an “interactive object” (i.e. a lever, button, pressure plate, trigger, etc.) sets up a collection of parameters called a “packet”, sets up some conditions, and converts any actor in the world to an “action object” that will receive the packet. When the interaction is triggered, the packet is sent, and the object manages and updates its state based on the function provided. The reason why this system is so robust is that an interactive object can have 1-n number of action objects with 1-n number of unique functions that are each handled separately. For example, the user could create a sliding platform that scales, translates, rotates, and updates a quest at the same time with different durations, speeds, and vector values for each function all with a few clicks. Because the information being distributed is using an event system, the action object receiving the packet is disconnected from the interactive actor which helps prevent hard references. Moreover, to add another layer of complexity, users can indicate that action objects can reset (in the case of a pressure plate no longer colliding with an actor for instance) and these action objects will return to their initial state, ready to be triggered again.

However, all of this power would be useless if designers and artists couldn’t make it FEEL good. We base a lot of systems off of custom curves in Dino Delivery and this modular system is included in that. Each transformation-based function can be combined with a custom float curve using the curve editor built into the Unreal Engine. In addition, particle effects and Wwise events can be tied to different moments in the system. For example, multiple Wwise events can be triggered when the interaction begins, resets, and ends, and particles can be spawned from specific actors along the way.

With all of these features, our design and art teams were able to easily create many unique interactions in Dino Delivery. If I had more time, I would have loved to add more optimizations, effects, and built-in functions to the system but in the end, it was core to our gameplay and development process.

For more information, check out this video where I walk through examples, the concept, and the process of using our modular puzzle system.

- Jeremy McCarty

Unreal Engine Workshop video playlist

This video playlist is from the livestream of an Unreal Engine Workshop I led at DigiPen Institute of Technology on August 30th, 2018 to kick off our new semester. The goal of this learning workshop was to showcase some extremely useful things that the Unreal Engine offers that students might not know about, give students some information that will *hopefully* save them time and frustration during the school year, and leave students with some good habits to pass on to their game teams. I thought it would be useful to make the talk available to everyone after the workshop. It is geared towards beginners and is in no way as in-depth as it should be. Some of the major points will turn into future articles on this page.

I hope you enjoy learning some new things and that some of my tips are able to help you in your development! If you have any questions, don’t hesitate to connect with me!

Resources:
Mixamo
Project Source

- Jeremy McCarty

Creating a more manageable input manager

Capture.PNG

When I first started researching what it took to create games, I, like many other new developers, fell in love with the Unity game engine. It is easy to understand, light, and it does a lot of things extremely well. However, when I started creating controller supported projects and multiplayer experiences, I found that the support that I needed to provide was not available. Chances are if you have created something in Unity then you know what I am talking about but if not, then I will elaborate. When setting up controller input in Unity, one must first find where the input registry is located, find the correct XBOX controller button layout from the Unity support wiki,  connect joysticks and buttons up to string event names, and then implement functionality that at its core comes down to hardcoded string comparison. In most cases, this is fine and works as expected. However, when I needed to create support for two players in Dunkaroos in a simple, modular way, I knew there had to be a better way. Enter my InputManagerModule project.

The InputManagerModule is a .dll plug-in that I created to help provide multiplayer support for all gamepads regardless of brand or type. The idea is simple; provide a "subscribable" interface for the player input that is bound to specific function calls. There were a few important things that I wanted this plug-in to accomplish.

  1. Create  "fire and forget" events
  2. Support any type of USB gamepad
  3. Increase code reuse
  4. Avoid hardcoding string comparisons
  5. Provide custom rumble support

In my research, I came across an XInput wrapper created by Rémi Gillig that created a solid foundation for this project. Rémi's plug-in already bridged the gap between Unity and XInput by exposing gamepad functionality to the user. This functionality included all major buttons and axes as well as rumble support. So, "Avoid hardcoding string comparisons"; check. "Provide (not custom yet) rumble support"; check.

Again, after more research, I found ways to meet each of the other items that I wanted to accomplish. The solution ended up being a delegate based input manager.

What is a delegate you ask? Well, a delegate is a type that represents references to methods with a particular parameter list and return type. When you instantiate a delegate, you can associate its instance with any method with a compatible signature and return type. You can invoke (or call) the method through the delegate instance. (Source)

Short ‘n sweet version; a delegate is a method that you can “bind” a function to and execute the event.

What this allowed me to do was to implement input with just a simple "subscribe/unsubscribe signature" that directly called a defined function.

Capture.PNG

The implementation for the user is simple. Determine which button you want to listen for, determine if you want to listen for pressed, released, or held (or all three) events, and "subscribe" a function to the correct delegate event.

After a few helper functions to allow activating and deactivating controllers, creating an interface for users to create custom rumble, and creating generic function calls to interface with XInput's generic native USB controller support, I was happy with the project and was able to implement it easily into the assignment it was created for. The solution that I created is in no way as elegant as it could be, but it accomplished everything I wanted it to and was a great learning experience.

Why am I making this post now? Well recently, I was lucky enough to be able to share the InputManagerModule plug-in with a group of Game Design students that I TA for at DigiPen and figured it was about time to make it open source. So, if you are interested in learning more about the plug-in or just want to use it yourself, head over to my GitHub page and enjoy! I hope it will help mitigate some of your controller input problems and let you create more cool things.

- Jeremy McCarty

An Introduction

Hello there!

If you are reading this blog post, that means that you have found my design blog. Welcome! I will be using the space to blog about my experiences as a student game developer, tips-n-tricks that I have learned along the way, as well as other education/tool creation/game design based topics. As content appears, feel free to reach out to me with any questions you might have, you can find my contact information through the connect button. I am looking forward to sharing my experiences with you!