Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

Your Unity games and XAML: How many of you actually use it?

Discussion in 'Windows' started by Tautvydas-Zilys, Nov 25, 2015.

?

Do you use XAML in your Unity games?

  1. Yes, my game absolutely relies on it

    40.9%
  2. Yes, but it is not critical and I could live without it

    20.5%
  3. No, there's nothing in my game that uses XAML

    18.2%
  4. What's XAML?

    20.5%
  1. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    6,670
    Hello, dear developers targeting Windows!

    We had a discussion internally whether we should make the D3D project type the default in future versions of Unity. XAML has several disadvantages, some of which are more prevalent on phone scenarios.

    Disadvantages of XAML project type:

    * It increases game startup time by around 1 second;
    * It increases memory usage by ~10 MB. On phones when you have 180 MB memory budget, it is quite a lot.
    * There's an extra blit of swapchain contents to xaml layout at the end of each frame.

    Disadvantages of D3D project type:

    * You can't use XAML elements
    * On screen keyboard experience is a little bit poorer on Windows 10

    So the question remains: do YOU rely on XAML in your game? If so, what do you use it for? Would you switch to D3D even if you currently used XAML due to XAML disadvantages?

    Note, we are not going to remove XAML. We're merely thinking about changing the default.
     
    Last edited: Nov 25, 2015
  2. Notter

    Notter

    Joined:
    Mar 8, 2015
    Posts:
    65
    I didn't even realize you can can choose to build a D3D solution until i checked it because of this poll..
    XAML is default, so I didn't think i should mess around with that
    not sure what will D3D give me, but i don't use any XAML in my application
     
  3. Jonny-Roy

    Jonny-Roy

    Joined:
    May 29, 2013
    Posts:
    660
    I would only use XAML to introduce Ads really as Unity Ads are not supported. Although from an Application instead of Game point of view I would say XAML could be very valuable.

    Personally though I think changing the default would make sense as it would align it closer to the other platforms.
     
  4. dylan.ryan

    dylan.ryan

    Joined:
    Oct 15, 2012
    Posts:
    29
    We currently use XAML to display a web browser component as well as a video player component to smooth stream videos. I am unsure how easy it would be for us to do this without XAML.
     
  5. tswalk

    tswalk

    Joined:
    Jul 27, 2013
    Posts:
    1,106
    The nice thing about the XAML front-end is that it runs on a separate thread... I'm not sure a core gets dedicated to it, but can be used to do some very interesting things.

    I used it primarily for UI stuff as it support SVG, data binding, and custom controls in an easy to use XML like syntax.

    Regardless of the benefits, I think it would be ok to not make it the default moving forward now that Unity has an improved UI system (although SVG would be a nice to have supported feature).
     
  6. dylan.ryan

    dylan.ryan

    Joined:
    Oct 15, 2012
    Posts:
    29
    I also wanted to note that the on screen keyboard is a big deal to our project, and it was a blessing when it started working well.
     
  7. adamhill42

    adamhill42

    Joined:
    Nov 26, 2015
    Posts:
    1
    Yes. Mainly positioning Ads.
     
  8. SimonDarksideJ

    SimonDarksideJ

    Joined:
    Jul 3, 2012
    Posts:
    1,633
    So long as the guidance is clear, it shouldn't matter what the default is, most devs I've spoken to will choose speed of UI flexibility.
    XAML is mainly used for Ads, or in (a fair few) cases where start up speed is paramount, in which case, devs opt to have a XAML game menu before launching the game.

    So long as the platform features (Cortana, Location, Notifications) are not affected by going D3D, it should be fine. I think most are XAML by default because it's not absolutely clear in the docs that there is another choice.
     
  9. kshitijgandhi

    kshitijgandhi

    Joined:
    Jul 13, 2015
    Posts:
    28
    Our game uses dll libraries and those dll libraries use XAML controls. Will the libraries still work if they use XAML and I build the game in D3D?
     
  10. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    6,670
    Most likely not.
     
  11. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    1,215
    Assuming that Unity uses a SwapChainPanel in xaml to utilize DirectX in the xaml project, does this mean building the project as Universal 10 D3D will improve frame rate? If so, has Unity done any benchmark testing? ie 1%, 5%, 20% improvement? Obviously, every project will get different results but I'm assuming the swapchain overhead is going to be fairly consistent for a give screen resolution on the same hardware.
     
  12. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    6,670
    It really depends on the GPU. Unless you're fillrate bound, it shouldn't have any impact. Otherwise, it depends.
     
  13. punkouter2019

    punkouter2019

    Joined:
    Jul 28, 2013
    Posts:
    170
    I would like to embed unity in XAML as part of a bigger XAML app.. but never found any examples how to easily do this