Building Apps and Games for Xbox One Using UWP
Microsoft just opened up the XboxOne to UWP developers, allowing any retail XboxOne to become a development machine and test / deploy and publish UWP projects to the XboxOne Store
Join the DZone community and get the full member experience.Join For Free
for my sins, i was asked back to futuredecoded again this year to give a talk on the microsoft uwp platform, specifically about bringing games to the xboxone using uwp. by all accounts, the session went well (especially as there was standing room only by the time the talk started). with it being just two days in the london excel exhibition center, not everyone who wanted to make it could, in fact even some people were contacting me on the day saying they were in other sessions at that time but wanted more info.
so for everyone who couldn’t make it on the day or missed the session (or for those wanting a recap), i’ve recorded the session at home and published it on my “ darkside of monogame ” youtube channel. (i just have to hope my monogame friends will forgive me for featuring unity on there for a bit
you might also ask “why all the fuss?”. well, the answer is simple, microsoft just opened up the xboxone to uwp developers, allowing any retail xboxone to become a development machine and test / deploy and publish uwp projects to the xboxone store. it’s like christmas has come again for those of us who remember the xbox live indie game platform and the thrill of writing your own games and running them on your home xbox.
just what is uwp?
i’ve posted a few times about the uwp platform, but to recap, uwp is microsoft’s latest endeavor to make it even easier for developers to be able to publish on windows platforms. so much so, that now you only need one project to be able to deploy on to all of their windows 10 platforms, this includes:
- windows 10 desktop
- windows 10 mobile
- (supported) iot devices
- surface hub
plus, any other devices that microsoft decides to roll out on to from now on.
it pretty much sounds like a multi-platform dream, and it certainly is. but how does uwp handle all the different variations on its platform? each device is different and has its own unique characteristics. the answer, in this case, is “extensions”:
as you might expect, windows 10 has a single “core” which runs on all devices, in exactly the same way. then for those little extra’s, the uwp platform provides an “extension” component that is specific to each platform. however, these extensions are also expressed on all the other platforms, so your code doesn’t break and you write the same code as if you were writing for them all. where a device doesn’t support a certain feature (say the holographic api on an xbox), then the code simply does nothing, it doesn’t error, it doesn’t crash, your code still works but nothing actually happens. for those platforms with that feature, lights start shining, the bells ring and the choir sings out with joyful praise.
also as part of this “extension” framework, microsoft gives you the ability to test if a feature is available or not, allowing you to write different code depending on whether the feature is active, like if you want to use a devices accelerometer if it has one, or use a virtual joystick on a desktop with a touch screen, or fall back to keyboard if hat isn’t available. sure, there is a bit of thought to go in to building for “any” device but that is the trade-off for building one solution.
but what about the games?
when we start looking at building games under uwp, there is a lot of support (that is constantly growing) from third parties. as you can see most of the major engines and frameworks already support the universal platform out of the box, making it even easier to publish your game as a uwp app.
still not see any engine or feature you like, then there is always the ultimate fallback:
under the hood, uwp games are just a directx surface and you can write games using native directx in either c# or c++, there are even visual studio templates “out of the box” for uwp as well.
getting started with uwp on xbox
now that uwp apps can be deployed / tested and run by anyone with a retail xbox, we can go wild and try out our own games to see how they run on the big screen. once you lick all the bugs and get it just right, you can publish that game “as is” to the xbox store. well, once you have your project accepted by the id@xbox team (which is even easier for uwp developers now)
so long as you have a windows 10 pc and a retail xbox, you're good to go as everything else is free, the tools, the software, even the ability to switch your retail xboxone over to a uwp dev kit. all from the comfort of your own home (or hotel room with free wifi)
there is one other caveat, that you need to also have a windows store developer account. this normally costs about £19 for an individual, a little more for a company account. you can either get this yourself, or when you are accepted by id, you will get this account plus a load of other software completely free. up to you.
p.s. if you have an msdn account, you also get a code for free, check your benefits.
setting up your development environment
once you have everything ready, getting started couldn’t be simpler and there are only a few short steps. as the slide above shows, you can get up and running with your first project deployed in just 5 minutes. (if you're using unity, it might take a little longer )
in short, what you need to do is:
1. install the “dev mode activation” app on to your xbox from the xbox store.
2. launch the “dev mode activation” app. you will be presented with a code and a url. navigate to the url on your pc, sign in with your windows account (same one used with your xbox live gamertag) and enter the code to register the xbox to your microsoft account
3. once complete, your xbox will automatically refresh and then ask you to restart.
this will now boot your xbox in to uwp developer mode with a completely separate sandbox inside your xbox.
your retail settings / apps are still safe on your xbox, you just can’t access them from developer mode. you can return to retail mode at any time.
once you have signed in to your xbox using your microsoft account, you can launch the developer portal app on the xbox.
this shows you all the apps / games installed plus a ton of other developer details.
take note of the tools ip in case visual studio doesn’t automatically detect it.
the first time you connect to your xbox from visual studio (selecting the deployment as remote and selecting the xbox, as shown here) you will be asked for a code to pair the xbox.
you get this code from the developer portal on the xbox in the “pair with visual studio” section.
visual studio and the xbox must be signed in using the same microsoft account you activated with.
done. you should now be able to deploy and run games from visual studio on your xbox.
you can also see debugging information from your xbox (providing your local network supports it) while the game is running.
just make sure you run in “release” or “master” mode when looking at performance issues as the debugger has an impact.
and that’s it. you are up and running. the security of the setup ensures that you (and only you) can connect to your xbox in dev mode and deploy apps, so long as you use the same microsoft account for everything. you can still sign in other gamers using their gamertags for local multi-player (although you can’t grant gamerscore ). if you also are a member of id and have access to to the live sdk and services, you can also test networked multi-player and all the other live services.
right, so you have your project ready, plans are afoot and you know what you either want to build or have a tech-demo (or even a full project) ready. to get ready to be published on the xbox and windows store (for games) you need to be registered with the awesome id@xbox program. in the past some developers have been a bit disillusioned with the responses to the program but times have changed . the team has evolved (especially with uwp deploy now coming to light) and it’s now even more streamlined to get access to the program.
once registered and signed up, the id team are fully behind you, giving you:
- free software and a windows store account
- access to all major gaming events
- support through the ms game developer network
- enablement to xbox live for access to achievements, networking, leader boards and much more.
my recommendation (especially if you have a mobile game already or the beginnings of a desktop app) is to apply just for windows 10 first, get your project out there in the hands of players and then either publish it as a uwp to xbox or then also apply for the xbox tier to build a native game (although check the next section for more detail on that). windows 10 has much easier access but has all the same rewards for all id developers, it also has fewer requirements and certifications to get published (you can’t ship a game that randomly crashes for instance!).
the key here is that you are getting your game out as early as possible, getting it in to the hands of players and gaining presence. i state this in the video but you must be prepared for the amount of footwork you need to put into promoting your game with the general public. id will be behind you every step of the way to take your content further (many id games are now even getting in front of major nelson these days, thanks to id). i will stress, though, expect a lot of work, id won’t do it for you and you need to be ready to produce high-quality videos, marketing material and make yourself available. at least 80% of the effort in your game will come from the last 20% (as they say).
if you want your game to be successful, you need to be out there building presence and touting your game! only you can promote your game the best way. (but id will help with guidance and weight)
key differences between uwp & native
to round this session up and to allay some of the concerns and comments i’ve either heard or been asked about uwp on xbox, i’ll walk through some of the key differences between publishing uwp on xbox and going native.
in short, uwp is simply easier. it’s a friendlier platform and the key benefit is that the single project you build, is also directly shippable on all of microsoft’s other windows 10 platforms.
while at futuredecoded , the visr-vr team showcased an awesome vr project aimed at helping children and adults who suffer from autism called botanika (it’s also a fun game for anyone btw ). this game was written in unity, running as a uwp using the vive vr setup. to make it even more amazing, the lead developer spent 10 minutes converting the project over the hololens (the night before the event no less) and had it running perfectly. granted it wasn’t the full scope of the project but all the key elements were there, all now using hololens’s gestures to control the game instead of the vive controllers.
getting botanika up and running in about 10 minutes on a hololens in unity was an awesome effort louis!
when publishing uwp games to the xbox, there are slightly fewer resources to native games (about 70% of resources are available) but there are also fewer certification requirements, meaning less headaches trying to figure out why a controller keeps getting disconnected. as the demo’s show, there is a lot you can get done with that 70% (remembering, it’s 70% of a very powerful beast, do not be fooled in to thinking it’s not much)
if you get invited into the xbox native group, which is a tougher crowd and you need your project to shine, you will be given 2 developer enabled xbox’s and a couple of years to get your project “finished”.
a great number of developers are also taking up microsoft’s offer of getting a “ preview ” version of their title out even earlier to consumers. something not offered on other platforms. yes, it’s more work but it means you get to build more presence and get feedback direct from your players while building.
i cannot stress more, just how much extra effort is needed to get a native xbox game out, apart from the stricter certification requirements (which with some engines, you can run into trouble if it’s the engine causing the issue). most certification builds take months of testing and validation to get ready. there are also stricter controls placed on console projects from a ratings perspective (and in some cases, quite costly), iarc hasn’t reached xbox native yet (like with the windows store) but hopefully it will be coming soon.
there is also the fact that in a lot of cases, you will need c++ skills (or contract them) to work on the interconnectedness of things, or if you need the utmost performance on the platform. although, i’ve known a fair few devs who haven’t had to go down this route but there are always compromises.
the world just got that little bit bigger and if you are already working on a project for windows 10, the reach of your title has now opened up even more and for very little effort. if you want to then use the success of your game to then build the “evolved” edition and build that native later, then you already have a foot in the door and it also becomes easier (although harder from an effort perspective )
so, if you want to build one game and ship it on to several platforms at once, then uwp is the answer (yes i know mobile share is small at present but ms is still committed to it ). you’ll still be able to take it to other platforms later as most engines and frameworks also support more than uwp, so if you architect your project right, the world is your oyster.
if you are making games these days, never restrict or limit your dream to one platform. go big, go wild and get out there!
Published at DZone with permission of Simon Jackson, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.