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 without .NET? How do you get fast?

Discussion in 'Windows' started by Deleted User, Jul 3, 2018.

  1. Deleted User

    Deleted User

    Guest

    I just started using Unity 2018.2.0b9 and realized that with the release notes of 2018.2.0b4, .NET is officially deprecated and will be removed in future releases. Now my question is, what are the alternatives with IL2CPP when it comes to all the cool and fast features .NET had in store for UWP:

    - Generate "Unity C# Projects", meant altering C# code got immediately available in the build. Very useful
    - Compile Time... Well, compiling from Unity to VS and from VS to final build takes about 10 times as long as with using .NET
    - Script debugging. As of now, building and running IL2CPP builds makes debugging waaaaaaaaay harder than plain C# scripts

    Just for the ease of debugging capabilities and speed, I love to see .NET stay
     
    CanisLupus likes this.
  2. QFSW

    QFSW

    Joined:
    Mar 24, 2015
    Posts:
    2,906
    Doesn't 2018.2 come with IL2CPP debugging? or was that 2018.3?
     
  3. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,589
    According to the 2018.2 roadmap, it does come with IL2CPP managed debugging on some platforms.

    https://unity3d.com/unity/roadmap
     
  4. Deleted User

    Deleted User

    Guest

    This does not apply for UWP though :(
     
  5. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,132
  6. Barkers-Crest

    Barkers-Crest

    Joined:
    Jun 19, 2013
    Posts:
    159
    @LeonhardP What about these two? I just wrapped up a big UWP project that wouldn't have even been feasible if IL2CPP were the only option.

    We ultimately shipped with IL2CPP, but there is no way we could have iterated on the platform specific code in a reasonable time frame had IL2CPP been the only option.

    Hopefully I'm missing something here and there will be a way to iterate at the speeds .NET allowed.
     
    arufolo likes this.
  7. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,644
    There are two aspects to iteration that "Unity C# Projects" enabled.

    1. Writing platform specific code. With "Unity C# Projects", you get full intellisense for all the types and methods available on UWP (as with normal generated projects when you double click the script you only get intellisense for the editor). We worked with MIcrosoft on this last year and we came up with this:



    When you use IL2CPP, double clicking any script will open VS solution with two projects for each DLL: one for the editor, and one for the player. This allows you to switch contexts between them and get full intellisense experience for platform specific UWP code. Note: you need VS2017 and VSTU 3.1+ for this to work.

    2. Building the generated project used to just rebuild scripts, without touching data files. This has historically been a huge platform specific hack that we did on UWP, as accidentally changing serialization layout would cause immediate crashes. Last year, we introduced a very similar feature to all Unity platforms - "Script Only Build". When you check this checkbox in the build window, Unity will just recompile the scripts and reuse data files from a previous build. This allows quick iteration while also telling you if you changed serialization layout and need to rebuild data too. Naturally, this will not be as fast as "Unity C# projects" option since you still need to run through IL2CPP pipeline, but it's much faster rather regular builds.

    Lastly, I want to point you to this docs page: https://docs.unity3d.com/Manual/IL2CPP-OptimizingBuildTimes.html. It contains some tips we've historically found to significantly help with build times when using IL2CPP.

    Besides all that, iteration time is the number one focus post 18.3.
     
  8. Deleted User

    Deleted User

    Guest

  9. ArjunKPrahaladan

    ArjunKPrahaladan

    Joined:
    May 17, 2017
    Posts:
    13
    Hey I am not sure if this is the forum to as about it. Does anybody know how I could make a webview appear in UWP.
    Most people I got in touch with in different forums suggested that I use A native UWP web view. I don't have much experience in UWP development outside of Unity. Can anybody help me with this ?
     
  10. Deleted User

    Deleted User

    Guest

    @Tautvydas-Zilys just re-read your explanation. Would you mind linking where the duality of DLLs is documented? I stumbled across these recently and thought that was a bug due to some problems I've gotten into. Apperently it's a feature
     
  11. Deleted User

    Deleted User

    Guest

    @ArjunKPrahaladan this Thread is about IL2CPP and C# compilation feature comparison. I think there are better ones on the net about webview embedment.
     
  12. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,644
  13. Deleted User

    Deleted User

    Guest

    @Tautvydas-Zilys too many to be honest, not really one particular related to this. But thanks for the link.
     
  14. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,644
    If you make a new thread we can discuss your issues in detail and most likely resolve them.
     
  15. Barkers-Crest

    Barkers-Crest

    Joined:
    Jun 19, 2013
    Posts:
    159
    I've came back to the UWP project I was working so I can put out a patch/update for it.

    I was very quickly reminded of all the pain and distress associated with developing UWP compared to standalone development.

    I moved on to the latest version of 2018.2 and was hoping things would go well with the new IL2CPP debugging. It did not go as well as I would hope. In order to attach a debugger the Visual Studio project has to be built in release mode (or debug). Unfortunately this causes code that during runtime would execute < 300 milliseconds when compiled to Master mode to take over 30-200 seconds. Also the framerate in XR is just unbearable in release mode while 90fps in master mode. Of course slowdown when a debugger is attached and has debug symbols is to be expected, however, the delta between the two modes is astounding.

    There are a couple of other issues that are putting me in a bad place but I digress.

    I know you guys work hard to make UWP great and I appreciate that. However, I think you do need to hear the feedback that the UWP development experience is really bad right now and looks to only get worse until the IL2CPP workflow is addressed in 2019. This is assuming those efforts create a workflow equal or better than the .net runtime workflow.

    I'll never understand why I put 10 units of effort into UWP and get maybe 1 unit of productivity (and spend a ton of time building bug reports) while in standalone I can put 10 units of effort and get 20 units of productivity.

    Sorry for the mini-rant. Just very frustrated right now with UWP.
     
  16. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,644
    I believe that the IL2CPP debugger perf hit is a known issue on all platforms, not just UWP. It shouldn't perform much worse in release than master with debugger disabled. But I agree, it's not ideal. We're going to address it.
     
  17. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,644
    And it looks like we have major improvements coming regarding this in 2018.3.
     
    Barkers-Crest likes this.
  18. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,644
    An update on iteration times: 2019.1.0a13 has a new build type option on UWP called "Executable Only", which builds your game into a folder without generating a visual studio project (just like Standalone Player does by default). From our initial testing, this improves build & run performance quite significantly, enabling faster iteration. With Script Only builds and this new build type, iterating on code changes should be much more pleasant. Please give it a shot once it's out :).
     
    Peter77 likes this.
  19. Deleted User

    Deleted User

    Guest

    @Tautvydas-Zilys great to hear about this feature.
    I have yet another problem with speed and convenience. What about platform dependent code like UWP sockets? The relevant libraries are not available in Unity, but when compiled to C++ native code you can't continue writing code in Visual Studio either. the old NET feature of generating the project was very handy as it allowed to write that part in the generated project, wrap it in #if !UNITY_EDITOR && UNITY_WSA and it was good to go.
    I guess now you have to manually create a second project for that and then move the platform code over to Unity? Is there a better approach to that?
     
  20. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,644
    If you have latest VS2017 (I think this feature was added in 15.6) and target UWP with IL2CPP, VS will automatically create a second project when you double click any of your scripts. It will be called <ProjectName>.Player and will allow you to use all UWP API with full intellisense support. Read more about it here:

    https://docs.microsoft.com/en-us/wi...started-with-partner/partner-unity-uwp-il2cpp

    Note that with IL2CPP, you don't necessarily have to use UWP specific sockets anymore (you can if you already have that code, though). Regular .NET sockets work too.
     
  21. Deleted User

    Deleted User

    Guest

    Ah nice, thanks a lot