Official Everybody Edits Forums

Do you think I could just leave this part blank and it'd be okay? We're just going to replace the whole thing with a header image anyway, right?

You are not logged in.

#1 2017-05-04 09:52:55, last edited by LukeM (2017-05-04 17:30:19)

LukeM
Member
From: England
Joined: 2016-06-03
Posts: 3,009
Website

WebAssembly

Wasn't sure where to post this, but I guess this is programming related, so im putting it here for now

Something new called WebAssembly has been released, it seems like its fairly similar to flash, as in it runs compiled code in your browser, but it seems like its on the road to being supported by most browsers without the need for plugins, and from what I've seen, it has very good performance
As it runs pre-compiled code, it has speeds comparable to native languages, and may be able to run code written in many other languages in the future

From what Ive read, Unity is also colaborating, which means that it will probably allow WebGL exports to use WebAssembly in the future, this means that the new web EE client will run much faster, hopefully almost, if not just as well as the Unity engine version

Currently it only (from what ive read) runs in Firefox, but I'm sure other browsers will start working on supporting it soon if it is as good as it seems
Edit: I think chrome also supports it now

Here are a few sources of more info, for those who may want it:
Brief intro from the Mozilla blog
More in depth explanation
Demo for those using firefox (or any other browser which has added support)
Documentation and browser compatibility

Offline

#2 2017-05-04 17:15:37

den3107
Member
From: Netherlands
Joined: 2015-04-24
Posts: 1,025

Re: WebAssembly

destroyer123 wrote:

which means that it may be a better option than using WebGL in the future of EE, as both the in browser, and downloadable clients could be running the exact same code

Well, not sure you ever used Unity, but the fun thing is that with Unity, you can already use (almost) the exact same code for every platform (web, windows, ios, playstation, etc.).
Now probably what would happen in the future (once WebAssembly is fully implemented), is that Unity will use that as web build framework instead.

But what about WebGL?
Well, WebGL is just a port of OpenGL to browsers, WebAssembly could be better compared to an assembly port to browsers.
So this means nothing really changes! Why?
Because WebAssembly can just as easily use WebGL (and not really the other way around), so it's not as if WebGL will suddenly fade away.

Probably what Unity will do in the future (at least that's what I expect, haven't checked any official word about this), is use WebAssembly, which will internally use WebGL, if required/wished.
This would result in the current WebGL build option to be replaced with WebAssembly, since there's no real reason to use just webGL (once WebAssembly has been standardized).

Offline

Wooted by:

#3 2017-05-04 17:28:11, last edited by LukeM (2017-05-04 18:02:11)

LukeM
Member
From: England
Joined: 2016-06-03
Posts: 3,009
Website

Re: WebAssembly

den3107: I think your right, I was thinking that the unity program could just be directly converted to WebAssembly, but I was forgetting that unity requires something to be installed on your computer for it to run, so for it to run completely in your browser, you would also need to compile the unity engine to WebAssembly (probably not a good idea)

So yes, im guessing that things will still be ported to WebGL, just compiled and converted to WebAssembly after. This will still be a really good thing, but not quite as good as I thought it would be //forums.everybodyedits.com/img/smilies/sad

Offline

#4 2017-05-04 23:27:56

den3107
Member
From: Netherlands
Joined: 2015-04-24
Posts: 1,025

Re: WebAssembly

destroyer123 wrote:

you would also need to compile the unity engine to WebAssembly (probably not a good idea)

I'm not sure where you got this information but... I again think you're a bit off-mark.
An engine is something where you create something in. The engine then makes sure it's compiled into something everybody knows (OpenGL, DirectX, .Net forms (dunno what technology forms and such use)).

In the old web version of Unity (back when NPAPI was supported), you indeed had to download a Unity webplayer.
Now that WebGL is a browser standard (and WebAssembly probably following soon enough), Unity basically "rewrites" you code so it works with WebGL. There's nothing left of Unity (obviously they still use certain structures, but there's no such as an "engine" in there). It obviously doesn't require you to have Unity installed to be able to play your game.

WebGL is NOT something Unity made, in case you were thinking that //forums.everybodyedits.com/img/smilies/tongue
Obviously for WebAssembly the same story will apply.

Offline

#5 2017-05-04 23:53:40, last edited by LukeM (2017-05-04 23:55:16)

LukeM
Member
From: England
Joined: 2016-06-03
Posts: 3,009
Website

Re: WebAssembly

den3107 wrote:

I'm not sure where you got this information but... I again think you're a bit off-mark.
An engine is something where you create something in. The engine then makes sure it's compiled into something everybody knows (OpenGL, DirectX, .Net forms (dunno what technology forms and such use)).

I was thinking (while I was writing the OP) that you could just compile the main desktop unity code into WebAssembly, instead of using WebGL, the same as you could compile some other desktop programs, but was forgetting that it required the unity engine to run it, so if you were to compile it directly to WebAssembly (like I said, not a good idea, and probably never going to be supported), then you would also need to compile the unity engine with it so it could run the program which is dependant on it

Also, Im pretty sure that unity does still have an option to compile to an exe or something which requires the unity engine to run

PS: oops, just noticed how badly I explained in my previous post what I was originally thinking, for it to make more sense, replace 'so for it to run completely in your browser' with 'so for pure unity (not WebGL or anything) to run completely in your browser'

Edit: I might still be explaining what I was thinking terribly, but im tired so cant do any better atm //forums.everybodyedits.com/img/smilies/sad

Offline

#6 2017-05-05 12:29:36

den3107
Member
From: Netherlands
Joined: 2015-04-24
Posts: 1,025

Re: WebAssembly

destroyer123 wrote:
den3107 wrote:

I'm not sure where you got this information but... I again think you're a bit off-mark.
An engine is something where you create something in. The engine then makes sure it's compiled into something everybody knows (OpenGL, DirectX, .Net forms (dunno what technology forms and such use)).

I was thinking (while I was writing the OP) that you could just compile the main desktop unity code into WebAssembly, instead of using WebGL, the same as you could compile some other desktop programs, but was forgetting that it required the unity engine to run it, so if you were to compile it directly to WebAssembly (like I said, not a good idea, and probably never going to be supported), then you would also need to compile the unity engine with it so it could run the program which is dependant on it

Also, Im pretty sure that unity does still have an option to compile to an exe or something which requires the unity engine to run

PS: oops, just noticed how badly I explained in my previous post what I was originally thinking, for it to make more sense, replace 'so for it to run completely in your browser' with 'so for pure unity (not WebGL or anything) to run completely in your browser'

Edit: I might still be explaining what I was thinking terribly, but im tired so cant do any better atm //forums.everybodyedits.com/img/smilies/sad

I think you're still missing the point... But I don't think I can explain it any better, so I'm just gonna leave it as it is.


WebAssembly will probably soon enough be supported in all major browsers, and as a result Unity will most likely provide an option to build for it, there's no downside to building your web game to WebAssembly instead of pure WebGL.

Offline

#7 2017-05-05 15:24:39

LukeM
Member
From: England
Joined: 2016-06-03
Posts: 3,009
Website

Re: WebAssembly

den3107 wrote:

I think you're still missing the point... But I don't think I can explain it any better, so I'm just gonna leave it as it is.

WebAssembly will probably soon enough be supported in all major browsers, and as a result Unity will most likely provide an option to build for it, there's no downside to building your web game to WebAssembly instead of pure WebGL.

I was just trying to explain why I originally thought that you would be able to export to WebAssembly without needing WebGL or anything, but now understand why not, although im bad at explaining things, so it probably didnt sound like I understood what I was saying //forums.everybodyedits.com/img/smilies/sad

Your right about the second bit though, I think they have already said that they will be replacing the normal export to WebGL with an export to WebGL with WebAssembly, which also suggests that they would agree that there is no need for WebGL with normal javascript. I think the WebAssembly people are also adding a javascript library thing that can automatically convery WebAssembly back to javascript, for older browsers which may not support the former //forums.everybodyedits.com/img/smilies/big_smile

Offline

#8 2017-05-05 19:57:02

den3107
Member
From: Netherlands
Joined: 2015-04-24
Posts: 1,025

Re: WebAssembly

Unity's blogpost about WebAssembly seems to suggest they're planning on providing both formats, as they think that sometimes WebGL might still be a better choice than WebAssembly. Or something.

Offline

#9 2017-05-05 20:12:24, last edited by LukeM (2017-05-05 20:13:15)

LukeM
Member
From: England
Joined: 2016-06-03
Posts: 3,009
Website

Re: WebAssembly

den3107 wrote:

Unity's blogpost about WebAssembly seems to suggest they're planning on providing both formats, as they think that sometimes WebGL might still be a better choice than WebAssembly. Or something.

We plan to switch Unity WebGL to output WebAssembly bytecode once the feature becomes available in browser releases. On browsers which don’t natively support the feature, the bytecode can very efficiently be translated to text-based asm.js code using JavaScript – which in most cases still results in faster content load times due to the download time improvements.

This sound to me more like they are going to completely replace (or at least replace in the menu I guess) WebGL with WebGL + WebAssembly, as even if browsers cant run WebAssembly, it can easily be converted back to javascript

Offline

LukeM1494011544658626

Board footer

Powered by FluxBB

[ Started around 1713987374.1998 - Generated in 0.048 seconds, 10 queries executed - Memory usage: 1.53 MiB (Peak: 1.68 MiB) ]