Mozilla and Unity Bring Unity Game Engine to WebGL
blog.mozilla.org
blog.mozilla.org
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!
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.
I'm all for learning how stuff works and for taking pride in doing things well (showing appreciation for the craft, as you say), but how many people do you see making their own web framework to develop a web app? Maybe it makes sense in some cases, which is true for games as well. And it is even more true if your purpose is to learn, or to make something in a different way from established frameworks.
We stand on the shoulders of giants in lots and lots of ways, and we should make the most of it to continue to build great stuff (games, or anything else).
With that said, I stand by the opinion that knowing how the low-level stuff works makes you, if nothing else, more capable of using the higher-level stuff. We just need to choose the best way of doing what we want to do, with the time, money and tools we have :)
It's nice that you're happy coding things up in JavaScript and WebGL just for the web browser, but Unity has a much wider scope than that.
Eventually somebody will write something like Unity that runs entirely in the web browser, and figure out how to make it target all the different platforms that Unity does (once Apple has their brain tumor removed and supports WebGL in their iOS browser for use in anything other than advertisements). But right now there is nothing like it for web development, and it brings a lot to the table that many people really need.
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.
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-he...]. Lots of great new tools to play with.
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).
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.
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.
Also how can you load say models but not textures? All files are just binary data.
I guess your only option is to play around with indexDB. Also it that per file 50MB, or overall 50MB. I guess with more aggressive compression could could achieve decently small disk usage.
CORS and the Same Origin Policy.
https://developer.mozilla.org/en-US/docs/WebGuide/API/File_S...
Progressive downloading technique (like AssetBundle) is a must for both loading time and server costs. Every developer should use it because if many games have massive long loading time (like Epic Citadel or BananaBread or Monster Madness. Whatever Mozilla says, these demos are not commercial ready), end-users will hesitate to click game links. I feel many gamers already stopped considering the web as a game platform these days. Kids know how to download games from App Store, but they don't know how to use Mobile Safari. All App Store, Google Play and Steam are growing. Many users will continue to prefer download apps for a long time.
Ultimately, time may solve the problem. The internet bandwidth is growing 50% per year. Many PC browser games will start instantly 5 or 10 years later, Mobile will have more trouble.
You could mitigate this by asynchronously loading certain files, or outright designing a game to be quickly downloadable (for example, by using an art style that uses only shading and mesh coloration instead of textures, or by going all demoscene and procedurally generating everything), but for anything resembling a modern "AAA" game, a long download time is probably unavoidable.
Actually, I was toying lately with the idea of making my own modules loader * insert mandatory xkcd strip about competing standards * because I wanted an hybrid loader that can pack multiple modules per file, but that doesn't have to have all modules in a single file either (e.g. 3d models could be packed with their textures, or levels packed with the models they need) as I haven't come up with a satisfactory setup to do so in r.js or browserify yet, however Unity already solved that issue in its Web Player, so making a JS version of it should be trivial.
Or how about this: Game Loading Lobby MMO, where you can hang out and chat with everyone waiting for their real game to load - IN 3D!. Maybe you can break out the character builder and have people do that, then get dumped into the MMO lobby while they wait for game assets to load.
Or you can just put a reddit iframe above the loading bar and call it a wrap.
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.
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.
Even with Unity (and Unreal and others) porting to the web, web browsers remain open, while web content (what ported Unity is) was always non-open (since practically all websites are not FOSS).
I agree with you on the other hand that EME would in fact be a danger to the openness of the web.
>Unity is not related to standards in any way
I know, I mentioned it. I believe a standard at least has some practical positive impact, unlike the integration of a particular closed platform.
>web content was always non-open
It's true that obfuscated JavaScript makes, in a way, a closed platform, but much less so, in my belief, than straight-up binary code (which Unity delivers and EME enables).
I get your overall point, but it just seems a slippery slope...
7 of the top 10 iOS games were developed with Unity, so it is already a really big deal for game developers.
First, build the infrastructure to support amazing things. (Asm.JS, WebGL, WebRTC)
Second, encourage people to spend real money developing for it, however they want to. (Unity 5)
Third, the open source competitors come around. (???)
Examples: Linux, FirefoxOS. On the other hand, no DRM in HTML leads to the platform still being free.
It's easy to integrate proprietary solutions but it's incredibly hard to remove them. IT is way easier to not adopt them in the first place. In that regard, proprietary software is similar to AIDS.
Bananabread? https://developer.mozilla.org/en/demos/detail/bananabread
I don't see it as a sell-out, I see it as competition to the braindead/insulting 'Upgrade your browser' Google notifications and similar nonsense. A sign that Mozilla is very much alive and innovating.
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.
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.
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
https://news.ycombinator.com/item?id=7423703
to which I can add that we have in fact helped, and are helping, port open source game engines like Ogre3D and Torque. These things do not preclude each other. (Yes, we all have finite time, but helping all such ports is a major priority.)
Also, it is not just that they do not preclude each other - they benefit each other as well. For example, you can see some pull requests from Unity developers to emscripten, those fixes and improvements then get to all the projects using it, many (most?) of which are open source. The same goes for fixing a bug that Unity hits, that bugfix benefits all other projects too.
Pre-Unity, game engines were truly stuck in the dark ages.
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=205801...
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.
asm.js can run close to native speed, depends on the JS engine of course, but it's not far off. See for example
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?
Please stop hurting all of us with this artificially imposed Javascript monopoly
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.
I would say that it benefits more people who aren't interested in programming. Unity is the visual basics of game programming.
https://developer.mozilla.org/en-US/docs/WebAPI/TCP_Socket
In the future this could become a standard and everyone would benefit.
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.
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.
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.
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
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/cros...
...
Let's hope it works as advertised then.