5 ms·
On the future of Web publishing in Unity
- flohofwoe 13y agoI'm most impressed by the compact size of the Javascript blob (around 6.5 MB gzipped for the FSP demo, unless I'm missing something), since this is C# code cross-compiled to C, and then cross-compiled to JS, including the Mono and Unity runtimes, I was expecting this to be a lot more.
- matthew-wegner 13y agoRegarding the Mono runtime: To convert the .NET game code (your C# and UnityScript scripts) into JavaScript, we developed a new technology in-house which we call IL2CPP. IL2CPP takes .NET bytecode and converts it to corresponding C++ source files, which we can then compile using any C++ compiler — such as emscripten to get your scripts converted to JavaScript. Expect more information on IL2CPP soon.
- pjmlp 13y agoThere are some rumours on Unity forums how IL2CPP might influence the existent issues with the legacy Mono runtime on Unity.
- kayoone 13y agoPretty excited about this, i just hope it won't cost alot of extra fees, Unity Pro for multiple platforms is already quite an investment.
- lawl 13y agoAwesome! That means we can hopefully soon play Unity web games on linux too! Last time I checked they only had plugins for windows. > To convert the .NET game code (your C# and UnityScript scripts) into JavaScript, we developed a new technology in-house which we call IL2CPP. IL2CPP takes .NET bytecode and converts it to corresponding C++ source files, which we can then compile using any C++ compiler — such as emscripten to get your scripts converted to JavaScript. Expect more information on IL2CPP soon. This however ... It's cool that it works. But do we really have to compile C# to IL bytecode to CPP source to LLVM IR to asm.js javascript which the browser will compile to native code. Just... I'm kinda speechless, not that this is possible, but viable for release. Well the demos show it is. Still.
- azakai 13y ago> But do we really have to compile C# to IL bytecode to CPP source to LLVM IR to asm.js javascript which the browser will compile to native code. I guess you're saying that it sounds like a convoluted process? There are other ways to run C# on the web, like JSIL which compiles C# more directly to JS. In practice each approach has benefits and disadvantages. But I wouldn't say that C# to IL to C++ to LLVM to asm.js to native is convoluted. It reuses a lot of existing tools (LLVM, Emscripten), and makes a lot of sense: Once you have C# to C++, you can compile that on any C++ compiler, including platforms where you couldn't run the Mono VM. C++ is as portable as it gets.
- flohofwoe 13y agoActually, it would be interesting what the performance looks like when the intermediate C++ code is fed into compiler toolchains which produce native code, and how this compares to the Mono JIT performance. Also, whether this approach will benefit other Unity target platforms like iOS or Android.
- bilbo0s 13y agoI was wondering about that too. Why not just let us write to the C++ API ??? It seems .... circuitous. And I don't like the debugging implications at all.
- drawkbox 13y agoThere was a time when Unity was going to go with a C++ api during that Apple ToS 3.3.1 clause that banned lots of platforms like Flash in 2010: http://blogs.unity3d.com/2010/07/02/unity-and-ios-4-0-update-iii/ http://blogs.unity3d.com/2010/07/02/unity-and-ios-4-0-update... The fear was Apple would ban mono AOT as well. During that time they were going to go C++. I wonder what would have happened. Now that UE4 is pure C++ it does have that. C# is great and you can accomplish most things with plugins via C/C++/Obj-C/Java but having the pure C++ option would be killer. Then it would be a much easier jump into final form for WebGL/asm.js/etc. Unity also has the Mono 2.x runtime and hasn't updated Xamarin licenses to go to mono 4. I wonder if they would be smart to jump to a C++ api at some point that could still use C# scripting possibly but goes to this lower level C++ form. It is hard with such a large userbase to jump to C++ but in 2010 they almost did.
- james33 13y agoThis is incredibly exciting for the web as a platform. My focus for several years has been helping to bring the web forward as the ulatimte game platform, but there's always been a gaping lack of good tools. Unity can dramatically change this in one fell swoop.
- peferron 13y agoI'm impressed at how straightforward they are regarding their plugin's future: Longer term, however, we expect that the performance and feature gap between the Web Player and WebGL will become much more narrow, and we expect that browser vendors will make the Web Player obsolete by dropping support for plug-ins, at which point WebGL will become the prime solution for targeting the web with Unity.
- _random_ 13y ago"by dropping support for plug-ins" - oh, so that's the reason. Because the demo is slower to load as the plug-in, so I personally prefer the latter (runtime performance is a separate issue).
- robterrell 13y agoGoogle already announced they will be dropping Netscape plugin support. Unity had to choose this or Pepper NaCl or dropping Chrome entirely.
- _random_ 13y ago"Expect more information on IL2CPP soon" ...and how to fork it, ideally? I hope Unity3d will follow Microsoft and partner with Xamarin. They wouldn't be in business without Mono - time to give back to the community.
- drawkbox 13y agoI am sure they will put it out there. UE4 is open development now on github and I bet the developers at Unity want to. They do have some stuff on github: https://github.com/Unity-Technologies https://github.com/Unity-Technologies but not this yet.
- davexunit 13y agoUE4 is not open. The source code is still proprietary, even if you can read it.
- drawkbox 13y agoTrue bad term on my part, I should have said transparent as you have to pay to see the UE4 source code and in progress work. In the locked down secretive game world it is pretty open but not oss.
- grogenaut 13y agoDoesn't work on ff or chrome I have on mac or linux :( Loads and then black screen for 10 minutes
- d4mi3n 13y agoRelevant: https://www.destroyallsoftware.com/talks/the-birth-and-death-of-javascript https://www.destroyallsoftware.com/talks/the-birth-and-death...