Search Unity

Getting started with UWP and Xbox

Discussion in 'Windows' started by Marscaleb, Nov 29, 2019.

  1. Marscaleb

    Marscaleb

    Joined:
    Jan 7, 2014
    Posts:
    1,037
    I would like to put my game onto my Xbox so I can start testing things on it. I'm still relatively early in development but I'd like to make sure my game is running smoothly on the Xbox and keep it that way through development.

    I'm following this guide, which is the only one I've found relevant to my situation. (That being said, it is nearly three years old and the various setting in Unity don't match anymore, so I would appreciate it if anyone has a more recent guide they could share.)

    At any rate, I'm trying to set up the build settings for UWP in Unity, and right away I'm looking at a warning that I don't know how to resolve. It reads "Selected Visual Studio is missing required components and may not be able to build the generated project."
    I'm really unfamiliar with Visual Studio, and I can't find where to go to make sure it has the correct UWP things installed. I've found a couple pages of tutorials that mention to install a UWP workload and WPD package tools, but they all mention to do this when I install Visual Studio. I already have Visual Studio installed, and need to add these various features.

    I notice that in Unity's Build Settings I can select an older version of Visual Studio and the warning goes away, but I am concerned that would just cause other problems if I use a version of Visual Studio that installed with some older version of Unity not associated with this project.

    I have the developer mode working on my Xbox now, and I really want to try putting my game on there. I would appreciate any help I could get.
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    If you ignore that warning and build anyway, Visual Studio will ask you if you want to install that missing component when you open VS solution in it.
     
  3. Marscaleb

    Marscaleb

    Joined:
    Jan 7, 2014
    Posts:
    1,037
    Hey, it's working now!
    But when I got past the title screen and into the game, there was a "development Console" on the screen which I have no way to close. I can't read the red text clearly but I think it says "AwakeFromLoadThreaded has not been called"
    I'm pretty sure that's not an error I made from my scripts, and it definitely wasn't appearing when I tested the game within the editor on my PC. Is it platform specific? And I have no idea how I am supposed to clear that console since I don't have a mouse.

    Also my framerate is amazingly crap. It's a 2D game and it was running smoothly on my Ouya a couple years back, so I'm wondering what is amiss here.
     
    Last edited: Nov 30, 2019
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Are you running the game in "Debug" config by any chance? That would cause it to run really slowly. As for "AwakeFromLoadThreaded has not been called" - does it happen when you run the same UWP app on local machine?
     
  5. Marscaleb

    Marscaleb

    Joined:
    Jan 7, 2014
    Posts:
    1,037
    The error does not appear when I run the game inside the editor. I haven't checked to see if it appears if I run the built game on a local machine instead of a remote console. I will test that when I get home tonight.

    And I believe I am running it in debug mode; that is what the directions I was following led me to do. I was poking around in the settings and tried to change that, but it caused the build to fail. (Reverted my changes and it builds fine now.) How do I change it out of debug mode?
    And will that be the same as making it not a "development build" that will cause error messages to appear in-game? Because if not I'd be interested in knowing how to change that too; I'd like a more "final"-like build so I can take my xbox places to show my game to people.

    Also, when I launch the game from my xbox, before it shows the Unity splash screen, the screen is grey with a grey box with an X in it (like a broken link.) Is there a way I can replace that with a formal graphic, or is that just part of the game running in the xbox's dev mode?
     
  6. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    What settings did you change and how did the build fail?

    When you target UWP, there are three configs you can use: Debug, Release and Master. You can change these in generated Visual Studio project:

    upload_2019-12-2_13-59-40.png

    "Debug" and "Release" are considered "development" builds. The only different between them is that "Release" is compiling with optimizations, so it will run significantly faster. You generally should use "Debug" if you want to step through C++ source code and use "Release" if you want to test or profile your game.

    "Master" builds are considered "non-development". They don't have the "development build" watermark, they don't have a development console, they have the profiler stripped out and generally run faster than "Release" builds. You should use "Master" builds to make a "final"-like build.

    That's the default splashscreen image. You can replace it in either Player Settings or the generated VS project.
     
  7. Marscaleb

    Marscaleb

    Joined:
    Jan 7, 2014
    Posts:
    1,037
    My frames! They came back!
    Thank you very much for your help!

    And about the error...

    Okay, wow, when I ran the game on the local machine when it got to the point where it was popping up with the "AwakeFromLoadThreaded has not been called" error, it dropped out of the game and into Visual studio, declaring that my game triggered a break point.
    I'm guessing the problem is arising from "DestroyImmediate" which my Game Manager script calls when a new scene is loaded. My GameManager object is set to not destroy on load because it, well, manages all my game's data. But I have a GameManager in all my scenes so I can test my levels properly, and when a new scene is loaded the GM from the new scene checks if there is an existing GM and destroys itself if there is.


    It said "Build failed" in the output window. I don't recall all the other things it said too.
    I was poking around in the Build menu and found a configuration manager. I changed the "configuration" for my game from "Debug" to "Release." I guess I should have done that with that "II2cppOutpurProject" too?
    Well, the drop down you showed in your screenshot is much easier to access anyway.

    I was guessing that, but nothing within the Player Settings looks relevant. There's a Virtual Reality Splash Image, Windows Holographic, a tracking loss image, and then about seven images just labeled "Windows" at differing resolutions. I tried putting in an image for "windows" but it didn't change anything.