10 ms·
Mozilla and Unity Bring Unity Game Engine to WebGL
- JelteF 13y agoI would love to be able to play Unity games on Linux in the browser. Currently there is no Linux plugin and that kind of sucks. WebGL support would be the ultimate solution of course.
- tomcam 13y agoArticle does not address licensing terms; what's in it for Unity?
- Cakez0r 13y agoMore sales, I imagine. If Unity can add chrome support then this could a pretty big deal for gaming on the web!
- withjive 13y agoThey have already proved (Lego Starwars demo IIRC) that they can target the NaCL runtime for Chrome (and ARM Chromebooks). But I'm not sure when/if they plan to release that publicly.
- doktrin 13y agoI think it makes more sense for them to aim towards some sort of unified platform. NaCL is cool and all, but it's very Google specific. WebGL is now even supported in the latest versions of IE.
- gfodor 13y agoAs a company they surely do not care if something is Google specific or not. They only care if they can sell enough licenses for it to make the development costs make sense. In light of chrome's adoption curve it seems to be a not terrible idea to target nacl.
- Yorrrick 13y agoOr they could just target WebGL and asm.js, which already works in Chrome, and let's see how long Google sits around with Chrome being slower at a popular use case.
- withjive 13y agoExactly, and it was also driven by the fact that it was easy for the Unity guys to get their existing toolchain building on NaCls LLVM toolchain. Now with ASM.js maturing, its another great opportunity. Also we saw Unity developed a target for the Flash runtime (now with Flash pretty much dead, thats being shelved). Gotta give props to Unity for trying.
- TazeTSchnitzel 13y agoYeah. Target asm.js and WebGL and you'll get Internet Explorer 11, Chrome, Firefox, IE and probably eventually Safari. With NaCl you get Chrome only. The choice is simple.
- RussianCow 13y agoThe choice wasn't so simple when asm.js was only supported by Firefox, and Microsoft had no plans to support WebGL in IE. :)
- TazeTSchnitzel 13y agoasm.js is supported, inherently, by all modern browsers. It is just JavaScript, after all. However, only Firefox has a second compiler path especially for it. Chrome has some optimisations for asm.js-like code in V8.
- RussianCow 13y agoWell, yes, but I find the WebGL port of the Unreal Engine demo (for example) unplayable without asm.js-specific optimizations. So by "supported" I really mean "optimized".
- camus2 13y agoa subset of a language is not the language itself. asm.js is not javascript.
- krsunny 13y agoWait a sec, are they saying the Unity5 webgl exporter will only work in firefox?
- withjive 13y agoUnity is a tools company. This is just another target platform for them, so they can sell more licenses for their software.
- gisenberg 13y agoEach platform for Unity has another license associated with it (eg: $1500 for Android Pro, another $1500 for iOS Pro). Another web target would be another $1500 license for folks to buy annually, I imagine.
- TazeTSchnitzel 13y agoMaybe they'll give it away in the free version like with Web Player authoring. Well, I can hope :)
- jonaphin 13y agoUnity has an Asset Store as well as a yearly subscription to their software's Pro version. More users = more sales + more conversions to Pro
- Cakez0r 13y agoI'm curious to know how networking behaves in a webgl build. Will my tcp sockets just work straight out of the box? That would be seriously impressive!
- RyanZAG 13y agoThey won't, but changing your server to accept websocket instead shouldn't be too bad.
- TazeTSchnitzel 13y agoDon't even need to do that. There are a bunch of TCP-WebSocket bridges out there.
- soapdog 13y agoEven though you can go with websockets or a tcp-websockets bridge, Mozilla has a proposal for TCP Sockets API in JavaScript. Its being used in Firefox OS right now and is quite cool. More info at: https://developer.mozilla.org/en-US/docs/WebAPI/TCP_Socket https://developer.mozilla.org/en-US/docs/WebAPI/TCP_Socket In the future this could become a standard and everyone would benefit.
- basicallydan 13y ago"This is a big day for evolving the Web as a platform for gaming and we are very excited to see what experiences developers will bring to the Web using this powerful technology." Slightly off-topic: I wonder if we're going to see more games being written to run in Web Browsers, or more games being written using web technologies like JS + WebGL but for desktop/mobile devices using things like phonegap/node-webkit [0] and then sold through various app stores such as Steam, iOS & Android. The infrastructure for monetising web games in the same way that Steam and the App Stores has done isn't there yet, but maybe it will be soon? [0]: Like A Wizard's Lizard http://steamcommunity.com/sharedfiles/filedetails/?id=205801629 http://steamcommunity.com/sharedfiles/filedetails/?id=205801...
- kayoone 13y agoAs the game development pipelines from traditional engines are much more mature i think the premier way will be to develop there and just export to HTML. Resulting Apps are heavier though, so for small web only games or just some enhancement effects, there is still room for lightweight WebGL engines like three.js But with Unity you can have one codebase and export to Win/OSX/Linux/iOS/Android/HTML5 and even consoles while some HTML5 engines offer an acceleration wrapper for iOS but thats basically it.
- deleted 13y ago[deleted]
- papa_bear 13y agoIs there an straightforward way to solve the issue with crazy load times on big WebGL games? If I remember correctly, I played one a while ago and it had to download assets for ten minutes before I could play it and it was a huge downer. If this becomes the norm I'm sure it wouldn't be too hard to get used to, but I was coming at this game from the mindset of playing instant gratification flash games. It would be cool if the engine could figure out what assets to download on-the-fly, but I have a feeling that's not the case so game makers would still have to do a bit of work before making the games web-ready (instead of ideally just hitting an "export to webgl" button).
- Touche 13y agoIf it becomes popular I'm absolutely certain those types of techniques will be developed. Just as with the XBox One and it's ability to let you start a game that it's still downloading
- valarauca1 13y agoYou can read/write local files from within a webpage. So I guess its possible. It would require looking into how WebGL loads assets and overriding this with diskIO operations not difficult. The next problem would be asset management, but this isn't an important issue. A lot of game data is already stored locally with little to no protection. I'd have to look at how javascript handles file I/O it might not be 'that' difficult.
- TazeTSchnitzel 13y agoThere's localStorage and there's IndexedDB. The former is blocking and not ideal, but I think you can store blobs in IndexedDB and it's async.
- valarauca1 13y agoIt depends. I was talking about storing files in user-land not browser-land, like c:\program files (x86)\company\our cool game\art\texture.png That can handled currently in HTML5. Even written too if you give it permission on load. This would side step warnings of IndexDB going over 50MB would be easier with large textures/models. Also side steps that webworkers can't really do asynch indexDB stuff. I'm not a web developer at all. I'm just researching this as I type it.
- kayoone 13y agoWow, i have been waiting for this for years and wondered what took them so long. I love Unity and while its not free, other HTML5 engines will now have a hard time.
- chii 13y agoi wouldn't say they'll have a hard time - unity is just another choice among the hundreds of engines out there for web. I would say that it benefits more people who aren't interested in programming. Unity is the visual basics of game programming.
- mrspeaker 13y agoI do like Unity (especially the component/entity system) but recently I've been enjoying making games in plain ol' JavaScript (2, and 2.5D - granted). Everything is just so open: I don't obfuscate or hide anything, and it's all available via "view source". With an inspector/console you can quickly see how stuff works and start messing around with it. Of course, 99.99% of people just want to play games - but the way I got interested in coding was by hitting RUN/STOP on C64 Basic game, tweaking the values, and seeing what happened. Pushing proprietary file formats through asm.js is a neat trick and gives amazing results with little effort. But the long-and-potentially-boring "learn yourself webgl for real" route seems more "web". And if someone, someday, gets into game or web dev by trying to cheat at my games (the same way I did, back in the day) - that would be flippin' awesome!
- kayoone 13y agoDepends on what you want. If you want to achieve the same results that are possible with Unity, you would need to use some more complex opensource engines like Turbulenz and would be restricted to WebGL for now. Rolling your own engine doesn't make sense other than learning and maybe for simple 2D stuff. If you want to create games in a very efficient way and have a quick time to market supporting a lot of different platforms, there is hardly a way around Unity now.
- null_ptr 13y agoYou're a dying breed my friend. Most software developers, game developers including, have no appreciation for the technical aspects of their field, and no appreciation for the importance of thoroughly learning and understanding the foundations on which their patchy work is standing - they're glorified product managers and all they care about is the end product they can make a quick buck off of until it's superseded by another, not how well-crafted it is.
- comex 13y agoGoing from OpenGL to a game engine with a modern lighting and rendering pipeline, physics, an editor, etc. is a huge amount of work, though. It's worth knowing how it all works and being able to write parts from scratch, especially since what's in a game engine is nowhere near satisfying every use case, but there is also no shame in using a preexisting game engine; if programming and (in the case of a one-man show) designing assets for a game is going to take a lot of time as it is, getting bogged down in game engines would be foolish.
- Touche 13y agoWhen will Dead Trigger 2 be available for purchase on the web?
- deleted 13y ago[deleted]
- wildpeaks 13y agoThat seemed like the obvious next step for Unity after they dropped Flash and with browsers increasingly dropping NPAPI plugins; always nice to see predictions come true :)
- neovive 13y agoVery exciting. This is a great way to get people playing your game without worrying about plugins. It will be interesting to compare the weight of a basic 2D game using Unity 4.3 2D engine to one written in a HTML5 framework such as Impact. I'm sure the use case is more for 3D gaming on WebGL, but using one toolkit for all development is definitely easier for the developer. Regardless, this is great news and great trend. Corona SDK also announced WebGL support is coming soon [http://coronalabs.com/blog/2014/03/07/coronacards-is-cool-heres-something-even-cooler/ http://coronalabs.com/blog/2014/03/07/coronacards-is-cool-he...]. Lots of great new tools to play with.
- GavinB 13y agoThis is HUGE news if it performs as well as advertised. We have been creating games in Unity for a couple years and eyeing HTML5 as a possibility that just was never capable enough to trust with a major project. Unity as a development platform is a joy to use, and now we won't have to have the same "Unity plugin or messy HTML5 game?" conversation for every new project.
- endemic 13y agoYeah, I stalled with my plain 'ol Javascript games after the Unreal Engine demos, since I assumed it'd just be a matter of time before Unity got a plugin-less web export.
- davexunit 13y agoMozilla, please stop promoting nonfree software. It would be better to assist in the creation of a free game engine for the web instead of Unity.
- azakai 13y agoI am a FOSS advocate as well, but I disagree that this announcement is a bad thing. First, Mozilla has and does assist in the creation of FOSS game engines and tools (Gladius, CubicVR, help to various web ports like JSMESS and various open source game engines, etc.). Second, even the LGPL shows that absolute avoidance is not always the best thing to do regarding closed-source code. Reality is more complex. Sometimes interoperability with closed-source code is good for everyone including free software. In particular, a big benefit for free software here is that Unity games can now run on the web, an open platform. Before they required a proprietary plugin that did not work on Linux or BSD, but as JS+WebGL they can run on those platforms. (Yes, the games are proprietary, but visiting websites using proprietary code is basically unavoidable, both on the client and server-side. At least we can do it using FOSS tools now.) So this helps support free software OSes. A final point, while the Unity engine is a proprietary codebase, they also have lots of code that is FOSS, see their github page. They are also working with even more open source code for the WebGL port, as it uses emscripten.
- devcpp 13y ago>First, Mozilla has and does assist in the creation of FOSS game engines and tools Parent comment didn't imply the contrary. "stop promoting nonfree software" doesn't mean "stop only promoting nonfree software". >even the LGPL shows that absolute avoidance is not always the best thing to do regarding closed-source code If you ask the FSF, the LGPL should really be used as a last resort. Unity is not too common yet (and hopefully will never be as long as it remains proprietary), so I don't see why we should push it forward by helping its integration. Same goes for HTML5's EME. I'd rather have a purely open platform with less features and popularity than a platform with an open base and countless incompatible binary blobs sitting onto it. And even the abomination that EME is would at least be an actual standard. >Unity engine is a proprietary codebase, they also have lots of code that is FOSS If you can't build it, it's not worth integrating. The only thing this is good for is making a FOSS alternative (although I guess they keep the important bits secret). I'd be using Google Chrome if "99% open source" was good enough. By using Firefox (though Chromium would be fine if it weren't for the user-hostile features), I precisely want to keep a clean FOSS platform. Conversely, I only use an Android ROM because there's no good alternative, which is not the case for Unity. So I wish they'd keep it out for now.
- wildpeaks 13y agoI'm curious if they'll also add features such as In-app Purchases given that's a recurring issue in threads about HTML5 games.
- TillE 13y agoAmazon is one good option for IAPs with web games: https://developer.amazon.com/public/solutions/platforms/webapps https://developer.amazon.com/public/solutions/platforms/weba... edit - Forgot to mention, they even have a Unity plugin: https://developer.amazon.com/public/solutions/platforms/cross-platform https://developer.amazon.com/public/solutions/platforms/cros...
- socialist_coder 13y agoThat is only for Android (Kindle) apps afaik
- wildpeaks 13y agoInteresting option indeed, it even has an AIR version.
- socialist_coder 13y agoI really hope so. They should work with a partner like Steam or Google Checkout to make it easy to do IAPs in the browser.
- Yoric 13y agoAre you talking about https://developer.mozilla.org/en-US/docs/Web/API/Navigator.mozPay https://developer.mozilla.org/en-US/docs/Web/API/Navigator.m... ?
- wildpeaks 13y agoThanks, that's an interesting option as well indeed.
- beefydude 13y agoIs it just me, or it is a bit hypocritical for Mozilla to be talking about the wonders of the Open Web and then embracing two very proprietary developer platforms to promote Asm.js If they cared about the open web, and they cared about open source, they would be helping open source game engines like Ogre3D and Torque3D. Instead, for the sake of expedience, we see them promoting proprietary components. It was not too long ago that they were lecturing the world on the evils of proprietary video and audio.
- gcp 13y agoIs it just me, or it is a bit hypocritical for Mozilla to be talking about the wonders of the Open Web and then embracing two very proprietary developer platforms to promote Asm.js There is no contradiction here, on the contrary (heh!). Mozilla doesn't believe an Open Web precludes proprietary applications. In fact they've strongly argued that the web should be properly standardized so that it's possible for anyone, including commercial parties, to make clients for it, and that just opening up source code (ala WebKit, PNaCl, etc) does not do this hence is a bad way to achieve an open web. The point has also already been made that this makes it possible for Unity games to run on open platforms without requiring closed source blobs. they would be helping open source game engines Uh, emscripten and asm.js have been enhanced to properly port many open source engines and game libraries long before this one was announced. I'm going to guess Unity was possible because they provided engineering resources to port their own engine.
- deleted 13y ago[deleted]
- devcpp 13y ago>Mozilla doesn't believe an Open Web precludes proprietary applications By definition, it must. It's a slippery slope and it's the reason Mozilla is vehemently against EME. The rest of that line sounds like nonsense to me in that context. >The point has also already been made that this makes it possible for Unity games to run on open platforms without requiring closed source blobs. Awesome, the joys of running proprietary software on Linux. Ah, why even have a FOSS OS then? Ditch it and get Windows! /s
- zenbowman 13y agoThis is awesome. I worked in educational technology building virtual humans (http://alelo.com/ http://alelo.com/), and have experience with a variety of game engines. Unity is far and away the most pleasant developer experience, despite being 1/100th the cost of some of the other commercial engines. Pre-Unity, game engines were truly stuck in the dark ages.
- coldcode 13y agoWhat is the performance like for asm.js and WebGL compared to a native app for PC or Mac? What do you lose?
- azakai 13y agoWebGL is basically at native speed. The only issue might be if a GL extension you need is not in WebGL yet, but that is moving along quickly. asm.js can run close to native speed, depends on the JS engine of course, but it's not far off. See for example https://github.com/joelgwebber/bench2d https://github.com/joelgwebber/bench2d
- Joeri 13y agoTo qualify, close to native speed means about two thirds of native speed in a best case scenario. Fine for games that don't stress the hardware to its limits, but not for top tier.
- azakai 13y agoFirst of all performance is CPU+GPU, and the GPU side is basically at native speed. Many games are mostly GPU bound, so for them they would run at full native speed. For games that are CPU bound, two thirds of speed is the current average on a set of benchmarks on Firefox, yes. But it will vary on codebase, and is constantly improving. Regardless, you say that top tier games won't work. What is UE4 and the higher-end stuff Unity demoed, if not top tier?
- deleted 13y ago[deleted]
- coldcode 13y agoWhy does asm.js run so crappily on Safari/Mac?
- ahoge 13y agoBecause it uses JSC instead of V8.
- outworlder 13y agoSo, that's why they've been doing, instead of fixing the 64 bit version and improve multi-threading support. Let's hope it works as advertised then.
- aras_p 13y agoYou do realize that exactly the same Unity 5 announcement also announced 64 bit editor and improved multi-threading?
- thetannedman 13y agoI'm seeing parallels between Unity and Flash (circa 2000). In a few years, we'll have the "Unity is dead, use <insert some other shiny technology> arguments popping up all over HN
- jiggy2011 13y agoIs that a bad thing? If something better comes along then it deserves to displace unity!
- danabramov 13y agoDid Flash ever compile to JS+HTML?
- drawkbox 13y agoGreat announcement. With plugins starting to go away due to browser changes and as a delta to mobile, this was needed. The end of 2014 Chrome will disable plugins that don't use PPAPI and all NPAPI plugins will no longer work (Unity, Silverlight and some other popular ones won't work). So glad they updated it and in the right direction to WebGL.
- higherpurpose 13y agoToo bad it's not WebGL 2.0.
- mixedbit 13y agoI wonder if and how C# scripts (a big part of the Unity framework) are supported for the WebGL target.
- drawkbox 13y agoC# scripts aren't used in the final output. Unity is an engine where the scripting portion is Mono based, upon export it is converted into C/C++/Obj-C/Java for Desktop/mobile/web platform of choice. It will be similar for javascript, the exported asm.js supported javascript will emit from the export to WebGL. Unity runs in the native platform it is in but Mono is their 'scripting engine' and part of their core engine much like UScript/UnrealScript is UDK's scripting engine. Unity uses Mono a little deeper than that but the resulting export is optimized for the platform it exports to. Since it is built on .NET it is alot like LLVM/JVM languages in that the IL/CLR/DLR are used to export all common languages used in scripting to a common output and this is also the reason you can use C#/Javascript/Boo (Mono versions) as they export to the same thing in the end native to the platform they are on. I am sure there will be pluggable areas of the outputted javascript but for the most part you'll develop it as usual in Unity and won't mess with the output as much except to plugin third party toolkits etc.
- bilbo0s 13y agoTo clarify a bit here... Unity didn't say that 100% of Unity features will be supported in WebGL. Some scripts will, most likely, not be able to run in the WebGL builds initially. Also... Things like GI, or the new PhysX... I wouldn't count on if you are wondering how to prepare a game to be WebGL ready. That said, I'm certain they will improve the WebGL build tech as time goes on, and eventually MOST of what anyone would need will be available. It just won't be available on day 1 of Unity 5.
- jon_cham 13y agoThe exported user scripts are actually .Net assemblies. They are run via the mono VM using it's JIT (just in time) compiler on platforms that support it, and are AOT (ahead of time) compiled on platforms that don't like iOS. In the case of WebGL the .Net assemblies are processed by a tool to convert them to C++ and then compiled into javascript using emscripten.
- wildpeaks 13y agoI'm curious if the generated JS files will have Source Maps to trace back runtime issues to the C# code.
- pekk 13y agoI find it annoyingly disingenuous for Mozilla to pride itself on a "plugin-free web" when they are the ones making decisions that ensure languages other than Javascript will NEVER run without plugins. Please stop hurting all of us with this artificially imposed Javascript monopoly
- CmonDev 13y agoYes, let's invent/promote a bunch of select technologies to the extent of directly integrating them into _some_ browsers and then call-it a "plug-in-free web". At least they came up with asm.js...
- Hawkee 13y agoI followed this link looking for a live demo. I was sadly disappointed. This is certainly something I need to experience before passing any judgement.
- SimHacker 13y agoWho would be interested in "Unityify", an adaptation of Browserify that supports Unity3D's dialect of JavaScript? It would package npm modules so they ran in Unity, and include some shims to wrap the native Unity3D classes in node APIs.
- tarun29061990 13y agoThis is a really good news as I have developed some small games in unity and I wished that I can create it using HTML5. So will there be a tool for creating graphics also or we have to follow same old html and images for that. And will there be an option to port games to android, iOS and blackberry??
- jokoon 13y agoyou say what you want, I doubt professional, experienced game devs choose to release quality game with unity. unity is great for young devs, prototyping and content creators, but it's not that much open so I doubt many dev really like to use it. still a great thing for mozilla though
- jon-wood 13y agoYup, little teams like Rovio with there obscure games about pigs trying to steal eggs wouldn't dream of something like that. Or that game no one's heard about where you launch aliens into space. couldn't possibly work in Unity.
- jokoon 13y agocoolish indie games, not that much popular either
- CmonDev 13y agoYes, it's good enough for games that rely on brand/marketing more then tech. Also good to increase the profit margin, since you don't need to hire developers - scripters should be enough for most cases.
- rando289 13y agoImmediately after a flash video is the quote "... strengthens support for Mozilla’s vision of a high performance, plugin-free Web," ...
- dharma1 13y agolooking forward to a demo. This could be a nice way of getting Unity3d games to platforms unity doesn't support yet (Firefox OS devices, Ubuntu Touch etc) if the performance will be good enough.