Search Unity

Vote for Windows Standalone with Scripting Backend IL2CPP (MUCH better script performance)

Discussion in 'Windows' started by AVOlight, Feb 25, 2016.

  1. AVOlight

    AVOlight

    Joined:
    Apr 15, 2014
    Posts:
    427
  2. Deleted User

    Deleted User

    Guest

    Probably because IL2CPP will make it not possible for you to load assemblies at runtime for mods etc. They did promise a Mono upgrade for the editor and standalones though.
     
  3. AVOlight

    AVOlight

    Joined:
    Apr 15, 2014
    Posts:
    427
    isn't the mono upgrade in the far off distant future

    thought i remember one of the speakers at a Unite saying that they already had IL2CPP working on standalone but one needed to be on the platform they were building for
     
  4. Deleted User

    Deleted User

    Guest

    Im not really sure about that, maybe Unity thinks its better to quickly roll out IL2CPP to all platforms and give us the Mono upgrade faster than fix the problem with the need to be on the platform your building for.

    Also microsoft recently acquired Xamarin which owns Mono so we might see the Mono upgrade come sooner since Unity and Microsoft are buddies.
     
  5. AVOlight

    AVOlight

    Joined:
    Apr 15, 2014
    Posts:
    427
    remember hearing that somewhere too
    wow! that's forward thinking of them
    i hope this doesn't negatively effect the partnership
     
  6. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Well, there are a couple of reasons why standalone player is not a target for IL2CPP yet.

    First of all, today you can build windows standalone player on any platform, be it windows editor, mac editor or even linux editor. You don't need to have anything else than Unity installed (no SDKs, no compilers, nothing). With IL2CPP, you can actually only build windows standalone player on Windows, and you have to have Visual Studio + C++ compilers/SDK installed.

    Secondly, standalone player is not a platform that prevents us from making the Mono upgrade, so naturally it comes as lower priority compared to the platforms that do prevent it. We want to first roll IL2CPP out to non-desktop platforms and make the only scripting backend available: that's a prerequisite for upgrading Mono.
     
  7. AVOlight

    AVOlight

    Joined:
    Apr 15, 2014
    Posts:
    427
    so it would be similar to the Windows Store IL2CPP process

    do you know how many platforms are left before it

    so upgrading Mono will happen before having a IL2CPP Windows standalone build option
     
  8. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Some of them don't have support yet at all:

    Wii U;
    Samsung TV.

    Some of them are in experimental phase right now - they're not yet on par with the main scripting backend, but they're being actively developed and improved as we speak:

    Android;
    Windows Store;
    Xbox One;
    Playstation 4;
    Playstation Vita.

    I can't promise it, but it is likely.
     
    AVOlight likes this.
  9. AVOlight

    AVOlight

    Joined:
    Apr 15, 2014
    Posts:
    427
    @Tautvydas Zilys Thank you :)

    feel a lot better having a general idea of whats happening with IL2CPP
     
  10. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    I'd like to hear what's the current standing on IL2CPP for Windows standalone.

    To the original response, I don't quite understand the concern of not being able to compile IL2CPP content on other than target platforms, that's hardly any kind of real issue for windows game developers.

    All in all, I'm bit concerned that IL2CPP on Windows standalone isn't even mentioned on the official roadmap, is it not planned at all? Or if it's in some plans, would it be realistic to expect that to happen with Unity 2017?
     
  11. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    It is in our plans. No ETA when, though.
     
  12. Meltdown

    Meltdown

    Joined:
    Oct 13, 2010
    Posts:
    5,822
    Are you saying this is somehow currently possible?
     
  13. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    No, that limitation will be in place once we do introduce IL2CPP support for Windows Standalone.
     
  14. Kandy_Man

    Kandy_Man

    Joined:
    Mar 8, 2014
    Posts:
    67
    As I understand it, Steam's DRM wrapper doesn't work with Unity games due to them being .NET applications. Would IL2CPP backend mean all Steamworks features should work?
     
  15. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Unity applications aren't .NET applications. Sure, it has .NET components (like your scripts), but the engine and the executable itself was compiled from C++.

    I don't know why Steam DRM doesn't work (and does it really not?).
     
  16. Kandy_Man

    Kandy_Man

    Joined:
    Mar 8, 2014
    Posts:
    67
    Apparently not: https://steamworks.github.io/faq/

    From the FAQ: "
    Does the Steam DRM wrapper work with Unity or XNA/Monogame?
    No it doesn’t. Unfortunately the Steam DRM wrapper does not play well with .NET applications such as Unity and your application will likely fail to start if it’s wrapped. Even if it does succeed and work for you it will often fail on other computers."

    I've not used it so I can't speak from experience, but this seems to be a common thing I'm seeing when looking into it
     
  17. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    I'm curious though, what is the real issue that prevents this feature to be implemented yet?

    According to the old talk on 2015:

    Unity staff has been running Windows standalone IL2CPP a long time already (video is from 2015) and only reason mentioned on the video is that IL2CPP windows standalone toolchain could only run on windows so cross-platform compiling wouldn't work.

    I really struggle to understand that reason though as every team who dev a game for windows will have a computer that runs windows.
     
  18. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    The issue with cross-compilation is that a number of users compile standalone players for macOS or Linux from Windows (which works fine with the Mono scripting backend). That won't work with IL2CPP. Still, that is not really a big technical hurdle, we can just document the restriction.

    The bigger reason why IL2CPP is not supported on desktop platforms is lack of time to make it production quality and support it. As with anything else, there are trade-offs, and we've simply not put the resources on this feature yet, as they have been used elsewhere.
     
  19. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Yup, this pretty much sums it up. It's a prioritization issue right now. But we do have plans to get to it soon™.
     
  20. Meltdown

    Meltdown

    Joined:
    Oct 13, 2010
    Posts:
    5,822
    Just throwing it out there, but IL2CPP also makes it harder for hackers to reverse-engineer our hard work :)

    So IL2CPP on standalone will be appreciated on that aspect too :D
     
  21. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    soon™ sounds good :)

    I wouldn't call it even hacking, you have to press a button and IL decompiler spits out all the source codes in human readable form :)
     
  22. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    I know that many modders will hate IL2CPP but then again, it really should be up to the devs to make the call what parts of the codebase they share with the final game. At the moment, devs don't have that choice (besides sticking everything into unmanaged native dlls).
     
  23. Deleted User

    Deleted User

    Guest

    Really looking forward to this feature as well!
     
  24. Sarudan

    Sarudan

    Joined:
    May 21, 2011
    Posts:
    65
    This sounds really good to me. We're working on an MMORPG which would greatly benefit from the extra performance and obfuscation that IL2CPP will offer in desktop builds!
     
  25. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    soon™ = any year now :D
     
  26. Lesnikus

    Lesnikus

    Joined:
    Aug 29, 2015
    Posts:
    47
    I want to have this, since all the codes of the Windows standalone games on the Unity are de facto open source (easy hacked). I also hope for better performance. Please do IL2CPP for standalone builds!!!
     
  27. vr_unity

    vr_unity

    Joined:
    Jun 12, 2017
    Posts:
    1
    Hi Unity devs, any update at all by any chance?
     
  28. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    I'm aiming to ship IL2CPP for Windows and Mac standalone players in 2018.1.
     
  29. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    Nice to see this now included in 2018.1 beta :)

    Been playing around with it, I initially just got IL2CPP.exe crash but solved it by reinstalling VS2017.
     
  30. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    While trying to link my own c++ code directly into Unity project (following setup found here: https://docs.unity3d.com/Manual/windowsstore-plugins-il2cpp.html ) I don't actually get the Platform settings to show up for Windows standalone (no settings show under it so I can't even select x64), I only see the options for Unity Editor. Is this functionality implemented in 2018.1 beta and if not, will it be done for the final 2018.1?

    I'm getting errors for unresolved external symbols for my native functions so it didn't include the files in build. When using external native DLL without __Internal, IL2CPP works but would prefer the internal method to minimize the overhead.
     
  31. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    I'm guessing not. Can you report a bug? It slipped through my radar - but I will do the best to fix it if you tell me the case #!
     
  32. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    Thanks, I made a simple test project to go along with bug report, hope it helps. Case number 987026.
     
  33. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Thanks, I'll take a look.
     
  34. Cronos05

    Cronos05

    Joined:
    Sep 26, 2012
    Posts:
    12
    Hi there,

    I would like to try the new IL2CPP on Windows build using Unity 2018.1.0b2. However, when I select it as the Scripting Backend, on the Build Settings it shows: "Currently selected scripting backend (IL2CPP) is not installed".

    I uninstalled VS 2017 and installed it again with the Windows 10 SDK, VC++ 2017 v141 toolset, C++ profiling tools and Just-In-Time debugger. But it's still showing the same message on Unity ("Currently selected scripting backend (IL2CPP) is not installed"). Am I missing something?
     
  35. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    It's needed to be selected from the list when you install Unity, it's one of the optional things in the list.
    I think this is a separate installer for IL2CPP only for windows: https://beta.unity3d.com/download/7...dows-IL2CPP-Support-for-Editor-2018.1.0b2.exe
     
  36. Cronos05

    Cronos05

    Joined:
    Sep 26, 2012
    Posts:
    12
  37. Cronos05

    Cronos05

    Joined:
    Sep 26, 2012
    Posts:
    12
    It's me again. :)

    Tried making the build and got the following error:

    Code (CSharp):
    1. Unhandled Exception: System.InvalidOperationException: Builder is unable to build using selected toolchain (MsvcDesktopToolChain) or architecture (Unity.IL2CPP.Common.x64Architecture)!
    Tried changing the architecture to x86, and no luck:

    Code (CSharp):
    1. Unhandled Exception: System.InvalidOperationException: Builder is unable to build using selected toolchain (MsvcDesktopToolChain) or architecture (Unity.IL2CPP.Common.x86Architecture)!
    Reinstalling VS2017 didn't do the trick neither.

    Googling about it I found that Unity has fixed it before (5.5.1): https://unity3d.com/unity/qa/patch-releases/5.5.1p3

    Maybe it's back on the Windows IL2CPP version?
     
  38. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    Make sure that c++ build tools are selected when you run the installer. Not sure if VS2017 selected those automatically, I know VS2015 made you pick those manually or you didn't get c++ building support.
     
    Last edited: Jan 17, 2018
  39. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    Yeah, that sounds like C++ tools in VS2017 aren't installed. And they're not enabled by default.
     
  40. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    Talking of which, might be worth changing the defaults from the Unity installer to include these tools when you install VS2017 with it. I think it's now silent install (I could remember it wrong) so users don't get the option to pick the c++ build tools with it.

    This would avoid a lot of confusion amongs new users in the future as people have gotten used to that when they install unity and platforms, things just work out of the box.
     
  41. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I would suggest that the build process in Unity detect missing C++ tools and offer to install them for the user. A few tools I use do that and I found it quite helpful indeed.
     
  42. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    Hmmm, are we supposed to be able to include .lib? I tested it again and Unity Editor doesn't even recognize the file type.

    I'd essentially want to replace my native dll with something that gets compiled into final game dll but including each cpp and h separately is kinda tedious, so including just a static library would solve this (as I could use similar setup as now with the dll).

    As a side note, .obj is not going to work either as unity thinks it's a mesh in that case.
     
  43. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    .lib files are complicated because they must be linked against code that was compiled with the same C++ compiler. The way IL2CPP works is that it tries to detect any il2cpp compiler and will use the newest that is installed on the machine. So if you build your .lib file with VS2010, VS2012 or VS2013 and you have VS2015 installed on your machine, IL2CPP will use VS2015 to build generated source code and will error out at link stage because compiler versions didn't match. Same will happen if you build .lib file with VS2017 and then only have VS2013 installed when building your project from Unity.
     
  44. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    Yeah, I guess it's tricky if you just allowed it out of the box, considering people might try all kinds of things with it. But I already thought about workaround to not having unity UI include the lib support. One could just throw in a dummy header that has something like
    and it should do the job, unless you guys filter out this kind of preprocessor commands (I hope not).
     
  45. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,680
    We don't filter that kind of stuff out.
     
  46. hogwash

    hogwash

    Joined:
    Oct 12, 2012
    Posts:
    117
  47. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    Unfortunately no, we don't have an update on this.
     
  48. hogwash

    hogwash

    Joined:
    Oct 12, 2012
    Posts:
    117
    Are line numbers expected to work in development builds using IL2CPP?
     
  49. JoshPeterson

    JoshPeterson

    Unity Technologies

    Joined:
    Jul 21, 2014
    Posts:
    6,936
    No, we don't have line numbers working in IL2CPP development builds.