Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

UWP Sanity Check

Discussion in 'Windows' started by PeachyPixels, Mar 11, 2020.

  1. PeachyPixels

    PeachyPixels

    Joined:
    Feb 17, 2018
    Posts:
    704
    Hi Everyone,

    I'm on the cusp of releasing my first UWP game and have made a number of assumptions with regards to build configuration. I would greatly appreciate any feedback from devs who already have some experience of the platform.

    They are...

    1. The build targets x64 & ARM64 (I've made the assumption the 32bit market is negligible nowadays)
    2. The build targets Win10 SDK 10.0.18362.0 (purely because it's the latest)
    3. The build targets a minimum platform version of Win10 10.0.17134.0 (as this is the oldest version of Win10 that is still supported)
    4. The build uses LZ4HC compression (I'm seeing some gains in install size from this, but has anyone had any compatibility\reliability issues with it?)
    5. The game is running full screen, but this does create an issue when firewall prompts appear in the background (might the preference be to use a full screen window instead?)

    Finally, are there any UWP gotchas I should be aware of?

    Any comments or suggestions would be greatly appreciated. Thank you!
     
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,645
    WIndows Phones are dead, 32-bit on desktop is rare and the only relevant 32-bit device is HoloLens. I'm not sure if you want your app to work on the latter.

    Sounds reasonable.

    Sounds about right. SDK 17134 corresponds to Windows 10 update that came out in March, 2018. There seems to be less than 2.5% of users on older Windows 10 versions: https://reports.adduplex.com/#/r/2020-02

    That should be no issues. Also, there's no difference between "Fullscreen" and "Fullscreen window" on UWP.
     
    PeachyPixels likes this.
  3. PeachyPixels

    PeachyPixels

    Joined:
    Feb 17, 2018
    Posts:
    704
    Thank you so much for the feedback, it's greatly appreciated.

    One thing I've noticed is that even on full-screen, touching (or moving the cursor to the top of) the screen slides out the title bar (including window buttons etc). Clicking those can end up getting the app into all sort of trouble with regards to scaling & display. Is there a way to turn this off in Unity do you know? I believe there is using the Win API, but wasn't sure if there was in Unity itself.
     
  4. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,645
    I don't think you can. UWP apps give ultimate control to the user - you as an app cannot prevent them from resizing windows.

    What kind of scaling issues are you seeing? Unity should be resizing the resolution as you resize the window automatically.
     
  5. PeachyPixels

    PeachyPixels

    Joined:
    Feb 17, 2018
    Posts:
    704
    Most were my own doing. Firstly, I wasn't anchoring some controls correctly. Secondly, I setup the canvas scalers to only work on the X axis, not X&Y. Addressed both those now and it's working as expected (and Unity is scaling correctly)

    But... the issue now is that players can resize the window to an AR that isn't supported per se. The added complication is that I'm using Auto Letterbox (on the Asset Store) as it's a 2D game and the scenes only have about 5% extra outside the camera view (so supporting anything other than the intended AR of 16:9 is just too much work)

    Just working through it now, but off the top of your head, do you know of a way in Unity to only allow resizing to honour a specific AR please? If not, is there an (OnSizeChanged?) event that I can intercept and only allow the change if it matches the target AR?

    I hope that all makes sense :)
     
  6. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,645
    What do you expect to happen when people run your game on an ultra-wide display (like 21:9)? What about an old monitor with 4:3 aspect ratio? Or a vertical monitor (which would have 9:16 aspect ratio)?

    You can't prevent the gamer from resizing the window on UWP. The whole platform was designed against allowing that. The best you can do is letterbox, but that will give a horrible user experience for people that have monitors where aspect ratio doesn't match what you intended.
     
    PeachyPixels likes this.
  7. PeachyPixels

    PeachyPixels

    Joined:
    Feb 17, 2018
    Posts:
    704
    The game is targeted at tablets (on Windows) and phone\tablets (Android & iOS). It can be played with a mouse, but it's a fast paced speed\reaction game, so you wouldn't want to :)

    To be honest, the art\layout decision was one I made way back at the beginning and whilst I knew the limitations of that approach at the time, maybe I didn't fully grasp it. Lettering boxing is not ideal, but after a protracted development, it's better than delaying another 2-3 months whilst I tweak the levels and artwork.

    I've worked through the remaining issues and it turns out it was a combination of incorrect settings on the canvas scaler and auto letterbox components. I've addressed both and am happy with the results.

    Once it enters beta, I'll work on support for a forced 16:9 AR in windowed mode, although am prepared for MS to reject it.

    Thanks for all the help and input, it's much appreciated :)