Search Unity

Tips and Tricks for Building for UWP and deploying to Xbox One

Discussion in 'Windows' started by schmosef, Apr 1, 2016.

  1. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    7,036
    How about a PC? :)
     
  2. schmosef

    schmosef

    Joined:
    Mar 6, 2012
    Posts:
    817
    I have a Shield Android TV. It's awesome. And you don't need a developer subscription to deploy test builds. But it's not portable.

    If you are just getting started, I'd focus on learning Unity and just do test builds on Windows. It takes time just to build and deploy for a different platform, which is a momentum killer if you are just starting out. I have a touchscreen monitor that I use to simulate a tablet interface for my test builds on PC.

    Later, when you are closer to having a game finished, you can re-evaluate your target platform options.
     
    AJ-Design likes this.
  3. AJ-Design

    AJ-Design

    Joined:
    Nov 1, 2016
    Posts:
    15
    I'm actually using Unity for interactive Architectural Renderings, and I need an affordable, semi-portable solution for demonstrating these scenes in different locations. Yes, a laptop would be the best solution, but a decent laptop is much more expensive than an Xbox One, or a Shield Android TV. So, I'm trying to find the best bang for the buck for this case. I liked the idea of using the Xbox because it's $249 and it's small enough to fit in a bag with a projector, and I thought that it would be powerful enough to run my scenes. But, that may not be the case.

    I just need something easy enough to set up quickly at a public meeting (connect to a projector) to demonstrate the scene of an upcoming construction project.

    @schmosef: What kind of frame-rate would you get if you were to place the scene from your post #3 on it? Your PC runs it at 50+ fps, the Xbox at 19 fps, how about the Shield?

    Any other suggestions?
     
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    7,036
    I doubt shield is more powerful than Xbox One, tbh.
     
    schmosef and AJ-Design like this.
  5. schmosef

    schmosef

    Joined:
    Mar 6, 2012
    Posts:
    817
    There are a lot of factors that affect frame rate: model complexity, shader complexity, lighting, physics, camera settings, game logic, build settings, etc.

    I've run many different test scenes and demo projects on both my Xbox One and Shield TV. Some work better on one, some work better on the other.

    Your best bet, for the scenario you've described, is to use a laptop with a good CPU, dedicated GPU and plenty of RAM. To lower the price, you can get a used one from a few years ago.

    Also, to use UWP on Xbox One you have to be logged into Xbox Live, which means you'll need an internet connection. I know from doing many demos and presentations that this is not always possible.
     
    Last edited: Dec 16, 2016
  6. msl_manni

    msl_manni

    Joined:
    Jul 5, 2011
    Posts:
    272
    I too have a similar situation.

    1. Which is more powerful, Xbox One or a PC?
    2. What should be a affordable spec for the PC? A desktop will be OK.
    3. Would it be better to work with Xbox One now if I want to publish a game on it later, or should I build a game on PC now and when everything works, get a Xbox One?

    The major factor for me at present is - Which is more powerful, Xbox One or a PC?
     
  7. schmosef

    schmosef

    Joined:
    Mar 6, 2012
    Posts:
    817
    1) A mid range PC will be more powerful than an Xbox One
    2) Any mid range PC with a dedicated GPU, I prefer Nvidia, will be fine. If you find a PC that you are interested in, post the spec in the general discussion forum to get some input.
    3) I would start on a PC.
     
  8. msl_manni

    msl_manni

    Joined:
    Jul 5, 2011
    Posts:
    272
    At present I have a i3 + gtx550ti, and its not upto the mark. What replacement card can outperform a Xbox One if replaced?
     
  9. schmosef

    schmosef

    Joined:
    Mar 6, 2012
    Posts:
    817
    I recommend that you start a thread in the general discussion forum to discuss optimal specs.

    You can explain the type of game you are trying to develop and the performance issues that you are facing.

    Your GPU might not be the limiting factor. You might need more RAM or a faster hard drive. There are many variables that affect performance.

    And it's a perfect conversation for the general discussion forum.
     
    Last edited: Dec 21, 2016
  10. msl_manni

    msl_manni

    Joined:
    Jul 5, 2011
    Posts:
    272
    I started a thread as per your suggestion. But it turns out that my pc is not good enough.

    Now my concern is how does a xbox one perform with unity games. Are there any drawbacks with developing UWP Builds? If not then I will purchase xbox one.
     
  11. stownend

    stownend

    Joined:
    Jan 18, 2017
    Posts:
    2
    @schmosef thanks for a superb conversation thread. Got my first Xbox deployments done and ironed out a few wrinkles due to info from this thread. One of the key improvements was building using the Master build profile. That really improved performance.

    I have a suggestion for anyone getting intermittent problems deploying from with Visual Studio (yes I have tried cleaning the solution). What I have found to be very reliable is to use the web browser from my PC to access the Dev portal of the Xbox and then publish the appx bundle from there. This seems to work every time. Here are the steps:-
    1. Select the Master build profile
    2. Right click the project in the solution explorer and select Properties. From there uncheck the option for .Net toolchain (or whatever it's called)
    3. Then right click the project again and choose Store -- Create app packages
    4. Choose the last option where you don't use the store
    5. Select just the x64 Master
    6. Create the package.
    7. Once done, it will tell you where the package is stored.
    8. Using the web browser portal select the appx bundle file, the certificate file and the two dependencies under the dependencies\x64 folder
    9. You should now be able to deploy.
    Looks like a lot of steps but quite easy and always works for me.

    One last thing that I am struggling with is that my game runs with a white border around it thats about an inch wide - it's not quite full screen. Any ideas anyone?

    I am loving this Unity development having spent a long time getting to grips with Microsoft's abandoned XNA gaming framework. Unity is so much more productive

    Cheers,
    Steve
     
    MV10, angrypenguin and schmosef like this.
  12. schmosef

    schmosef

    Joined:
    Mar 6, 2012
    Posts:
    817
    Hi @stownend!

    I'm really glad that this thread has been helpful for you.

    I will be adding a link, to your post, inside the troubleshooting section at the beginning of this thread, so that others might benefit from what you discovered.

    Unfortunately, as you can see in my screenshots, I haven't run into a similar problem with white borders. Maybe it's an issue with your camera or project settings.

    If you want to send me a version of your project to test, I'll see if I can figure out the issue. Feel free to send me a PM if you want to arrange this.
     
    angrypenguin likes this.
  13. fluidImages

    fluidImages

    Joined:
    Sep 27, 2013
    Posts:
    29
    I am currently getting this error:
    Severity Code Description Project File Line Suppression State
    Error DEP6720: Failed to deploy package 'Core CLR' (E0999A8F-0200-4738-AE1E-B45742BE6B6B). Package is not defined for OneCore.

    when trying to publish to UWP on the xbox - it deploys and runs on the PC alone.

    Sean
     
  14. schmosef

    schmosef

    Joined:
    Mar 6, 2012
    Posts:
    817
    I haven't seen that error before. You might want to submit a bug report.
     
  15. fluidImages

    fluidImages

    Joined:
    Sep 27, 2013
    Posts:
    29
    Some Trial and error -
    Turns out it is something in VS 2017, I reverted back to 2015 and it all seems to work perfectly!

    Not sure what it is - but will have to investigate further.
    Maybe a .net version?

    Sean
     
  16. schmosef

    schmosef

    Joined:
    Mar 6, 2012
    Posts:
    817
    That's interesting.

    I've used VS2017 to deploy many UWP projects to my Surface Pro 3 but I haven't done any testing with VS2107 deploying to Xbox One.

    I'll do some testing on the weekend to see if I run into the same issue.
     
  17. fluidImages

    fluidImages

    Joined:
    Sep 27, 2013
    Posts:
    29
    Yeah, I published to my PC - and it worked just fine - once I tried to publish to the xbox - I kept getting the above error.

    I suspect it must be something with the .NET version in 17, however I cannot seem to modify the .NET version. in the solution that unity builds for deployment.

    Sean
     
  18. fluidImages

    fluidImages

    Joined:
    Sep 27, 2013
    Posts:
    29
    any luck @schmosef? or ideas? I would like to move back to VS2017.

    Sean
     
  19. schmosef

    schmosef

    Joined:
    Mar 6, 2012
    Posts:
    817
    I've been a little bit swamped with work. I'll do a test later tonight.
     
  20. schmosef

    schmosef

    Joined:
    Mar 6, 2012
    Posts:
    817
    @fluidImages:

    I've done a test now and was successfully able to deploy a UWP project to my XboxOne via VS2017.

    I did have to work through some issues to get it to work. Not exactly sure what fixed it, but here's what I did:
    • Recreated the UWP project with Unity 5.5.2p4 (The UWP project I tried to use was created a few weeks ago with Unity 5.5.2p1).

    • In "Player Setting>>Other Settings" I used IL2CPP for the Scripting Backend.

    • My Unity Build Settings were:
      • SDK: Universal
      • Target device: Any device
      • UWP Build Type: D3D
      • UWP SDK: Latest installed
      • Build and Run on: Local Machine
      • All checkboxes: Off
    • On my XboxOne, I exited Dev Mode, selecting the option to clear all side loaded apps. Then rebooted back into Dev mode.

    • In the Xbox Dev Home app I cleared all the Visual Studio pairings. It occurred to me that I had not previously paired my VS2017 installation (only my VS2015 installation) and I was surprised that it did not ask for it. After manually clearing the pairings, it did ask to pair on my next deploy.
    I did not encounter the same error as you. I can't guarantee that what I did will fix your problem as well.

    But I can now confirm that it is at least possible to deploy to XboxOne via VS2017.
     
    Last edited: Mar 27, 2017
    MV10 likes this.
  21. fluidImages

    fluidImages

    Joined:
    Sep 27, 2013
    Posts:
    29
    Reinstalling VS2017 and will give it a try.
    I am on 5.6 already - I don't think is an issue as it compiled and ran from the same unity build.

    I know that I did not try IL2CPP - so will check that out.

    Will report findings - fingers crossed!
    Sean
     
    schmosef likes this.
  22. schmosef

    schmosef

    Joined:
    Mar 6, 2012
    Posts:
    817
    When I booted my XboxOne today, I was informed that it has applied the "March 2017" update.

    I checked out "Dev Mode" and found that it had been updated as well. The Dev Home app has a cleaner layout. I'll update some screenshots in my earlier posts when I have more time.

    I did a few test deployments and can confirm that everything is still working with VS2017. I could have just been lucky but Dev Mode feels a lot more stable now. I didn't have any random app crashes today, which used to happen a lot.

    I tried to use the newly integrated, "Beam Service" in Dev Mode, to broadcast a video stream of a test project, but it I got a message saying that the app did not allow broadcasting. I plan to investigate this further. I'm hoping that this is just a setting in a manifest file somewhere and not a Dev Mode limitation.
     
  23. AndrewRyan

    AndrewRyan

    Joined:
    Apr 7, 2014
    Posts:
    18
    I have a Unity game made utilizing the Kinect v2 SDK. I am planning on integrating speech recognition but read that speech recognition is unique as it is dependent on the platform you're using—i.e. the Windows Speech SDK for windows. Does Xbox one use this same api? Has anyone had problems porting to Xbox One using the Kinect v2 with classes like the SpeechManager?
     
  24. schmosef

    schmosef

    Joined:
    Mar 6, 2012
    Posts:
    817
    I haven't played with the Kinect SDK so I can't provide any advice on this.

    Please post a follow up here if you've made any progress with this. I'll link to it from the first post in the thread.
     
  25. sybere

    sybere

    Joined:
    Mar 26, 2015
    Posts:
    176
    Hi

    Any idea how to make a working corsur? I maked one, i changed the event system standalone input to transform objects as the mouse, and working well with the sticks but when i point to UI canvas button its not highlighted and can't click on it, but on pc its working, any ide whats different on Xbox One?
     
  26. GIRsMySpritAnimal

    GIRsMySpritAnimal

    Joined:
    Jan 13, 2017
    Posts:
    42
    Has anyone else had issues with controller movement on their menus on their xbox? It works on PC but not on there.
     
  27. schmosef

    schmosef

    Joined:
    Mar 6, 2012
    Posts:
    817
    I'm not sure that I understand what you mean. Can you clarify?
     
  28. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    12,360
    I seem to recall it having something to do with one of the input modules not being created by default on the event manager on UWP, and that you can fix it by manually adding an EventManager with the correct module.
     
    GIRsMySpritAnimal likes this.
  29. GIRsMySpritAnimal

    GIRsMySpritAnimal

    Joined:
    Jan 13, 2017
    Posts:
    42
    I'm setting my buttons as selected which makes controller and keyboard nav for my ui's work on PC but when I test remotely on my Xbox the controller doesn't move or select buttons
     
  30. GIRsMySpritAnimal

    GIRsMySpritAnimal

    Joined:
    Jan 13, 2017
    Posts:
    42
    What module do I need and how do I add/create it?
     
  31. GIRsMySpritAnimal

    GIRsMySpritAnimal

    Joined:
    Jan 13, 2017
    Posts:
    42
    Hey when I build for on Master's build I get ARM errors. Every other build seems fine. Any tips for helping me build for Master to create a .appxupload file? I really need to get my game in the store before the UWP contest ends
     
  32. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    7,036
    ARM errors? What kind of errors?
     
  33. GIRsMySpritAnimal

    GIRsMySpritAnimal

    Joined:
    Jan 13, 2017
    Posts:
    42
  34. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    7,036
    Can you paste the contents of the output window?

    If you don't care about ARM packages, you could just build x86/x64 for now until you can work around this issue.
     
    GIRsMySpritAnimal likes this.
  35. schmosef

    schmosef

    Joined:
    Mar 6, 2012
    Posts:
    817
    The black flag with the yellow background at the top right of the window (in your screenshot) means that there is an update to Visual Studio available.

    You should update your VS installation. I've seen build errors get corrected by updating VS.
     
    GIRsMySpritAnimal likes this.
  36. GIRsMySpritAnimal

    GIRsMySpritAnimal

    Joined:
    Jan 13, 2017
    Posts:
    42
    Thank you I'll update it and see if it goes away if not i'll post the contents of the output window
     
  37. v01pe_

    v01pe_

    Joined:
    Mar 25, 2015
    Posts:
    50
    wagnerps and schmosef like this.
  38. Seiryu33

    Seiryu33

    Joined:
    Dec 22, 2014
    Posts:
    32
    Hi! I asked about this in a separate thread but since my game uses Xbox Live Services, i thought I'd ask here but it's more related to building UWP. How do I adjust cameras for UWP apps? My app builds but once it goes into full screen mode I get blue bars on both sides of the screen. Do I need to adjust my camera settings in the Editor or will it even be needed to launch on Xbox One?
     
  39. schmosef

    schmosef

    Joined:
    Mar 6, 2012
    Posts:
    817
    Sounds like something with your camera/game setup. Maybe not handling aspect ratio differences between your dev environment and run-time environment.

    I haven't experienced blue bars in any of my PC or XBoxOne UWP build tests.

    Try to see if this happens on an empty test project. Try some of the free demo projects from the asset store.
     
  40. Seiryu33

    Seiryu33

    Joined:
    Dec 22, 2014
    Posts:
    32
    No issues with PC build though I can match the player size to my Camera ratio in the PC Build. I guess I should clarify that the blue bars mean a blank space. Cameras work fine in the Editor but then the player leaves that blank space where the cameras end but only when it's in Full Screen mode. For some reason it's defaulting to a different camera settings. I'm trying to avoid having to re-size my assets to fit the player if I can help it.
     
  41. schmosef

    schmosef

    Joined:
    Mar 6, 2012
    Posts:
    817
    I'm not sure what you mean by "defaulting to a different camera setting". Maybe post some screenshots.

    It sounds like you are describing what happens with changing aspect ratios. This is a common issue. There is no general solution because it depends on factors specific to each game.

    There are assets to help with this. Here's one: https://www.assetstore.unity3d.com/en/?stay#!/content/57439
     
    angrypenguin likes this.
  42. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    12,360
    Exactly how are you doing this? Also, separately, are you specifically setting either a screen resolution or a camera aspect ratio anywhere?

    It sounds like the game could be running at a different resolution to your display, and either your display or the Xbox itself is letterboxing it, but that's only a guess because the info we have is pretty vague.
     
    schmosef likes this.
  43. sybere

    sybere

    Joined:
    Mar 26, 2015
    Posts:
    176
    Hello!

    i working with Xbox one X uwp DX12 and i try to get 4k resolution, but as i know the only way to change the resolution is a manual change with Screen.SetResolution, but when i change in runtime the game freeze and cpu usage goes to null, any idea what i can go? or maybe where i can find the swapchain in the unity generated project? also we have now and incresed performance so it's reachable, also Everspace is using uwp with 4k 30fps with unreal engine
     
  44. schmosef

    schmosef

    Joined:
    Mar 6, 2012
    Posts:
    817
    Hi @sybere,

    Right now, Unity does not work in 4K in UWP on Xbox One.

    We're not sure if this is a bug or a limitation or if the issue is with Microsoft or Unity.

    My recommendation to you, since you have a reproducible game freeze, is to submit an official bug report to Unity.

    If you get any useful info back from Unity via your bug report, please let us know.
     
  45. sybere

    sybere

    Joined:
    Mar 26, 2015
    Posts:
    176
    Hello @schmosef,

    After a lot of search, i thunk the Unity generated project missing several things or just unreachable in the generated project. I started my own implementation according to this it's looks beautyfull in 4K on X and really smooth so the issue is in Unity not in Microsoft, as i mentioned Everspace did it... :D unity is just maked the core implement of uwp and they dont care about...if i ask them they point to Microsoft.....Microsoft point to Unity and my released game never release on Xbox because of this..
     
  46. schmosef

    schmosef

    Joined:
    Mar 6, 2012
    Posts:
    817
    It's important that you submit a bug report.

    Provide all this info in the write-up for the bug report.

    Although many Unity team members are active on the forum, this is not the official way to get support.

    In order to bring the issue to the attention of the appropriate people in Unity (and to have the resources necessary to develop a fix allocated) they must receive a bug report.

    It's not a guarantee that they will fix the issue. But it is the best way to get their attention. Every bug report I have submitted has eventually been reviewed and addressed (sometimes with a fix).

    Once you submit a bug report, you will receive a tracking number for the report. You can they reference that number when you communicate with Unity team members on the forum.
     
  47. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    7,036
    Yeah we need a bug report in order to investigate and fix this.

    That is simply not true. However, we can't investigate issues that you post on forums. You need to submit proper bug reports to us.
     
    schmosef likes this.
  48. sybere

    sybere

    Joined:
    Mar 26, 2015
    Posts:
    176
    Okay, i will make today a bug report, but in this mean time, any info about where i can find dx device creation in the generated project? in this sample they start the game totaly different way.
     
  49. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    7,036
    Direct3D device creation happens inside UnityPlayer.dll, for which we do not ship source code so unfortunately you cannot access it. For what purpose do you need the device?
     
  50. sybere

    sybere

    Joined:
    Mar 26, 2015
    Posts:
    176
    Accessing to creation process is required to make the 4k starting and in case can be determine which console is, normal One, S or X, now this is impossible also as i mentioned erlier the sample has a far better performance.
     
unityunity