
On the future of Web publishing in Unity - robin_reala
http://blogs.unity3d.com/2014/04/29/on-the-future-of-web-publishing-in-unity/
======
lawl
Awesome! 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.

~~~
bilbo0s
I 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.

~~~
MayorOfMonkeys
Yeah, I'm curious to find out how script debugging will work with WebGL
exports. Tough problem to solve. One of the nice things about PlayCanvas*
([https://playcanvas.com/](https://playcanvas.com/)) is that you can debug
your GameObject scripts using the integrated dev tools in any browser (or even
do remote debugging on mobile targets). * Disclaimer - I work on this! :)

~~~
azakai
I would guess people would debug their games in the Unity editor, like always.

In theory you can use the browser dev tools, and emscripten can emit source
maps which helps. But the Unity editor is probably a far better experience for
this use case.

~~~
MayorOfMonkeys
I guess so. But the blog entry does call it out as a feature that won't be
delivered initially, which suggested to me it's seen as 'important'. Also,
let's take profiling. I wonder how easy it will be to pinpoint performance
bottlenecks in Unity script code using the browser's dev tools.

------
james33
This 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.

------
flohofwoe
I'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
Regarding 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
There are some rumours on Unity forums how IL2CPP might influence the existent
issues with the legacy Mono runtime on Unity.

------
_random_
"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
I 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
UE4 is _not_ open. The source code is still proprietary, even if you can read
it.

~~~
drawkbox
True 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.

------
peferron
I'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_
"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
Google already announced they will be dropping Netscape plugin support. Unity
had to choose this or Pepper NaCl or dropping Chrome entirely.

------
d4mi3n
Relevant: [https://www.destroyallsoftware.com/talks/the-birth-and-
death...](https://www.destroyallsoftware.com/talks/the-birth-and-death-of-
javascript)

------
kayoone
Pretty excited about this, i just hope it won't cost alot of extra fees, Unity
Pro for multiple platforms is already quite an investment.

------
grogenaut
Doesn't work on ff or chrome I have on mac or linux :( Loads and then black
screen for 10 minutes

