I think I'll probably need to ask forgiveness for asking this question in advance. But it really is a subject of genuine curiosity for me.
Is there a reason that someone would use a Javascript engine like Babylon, Three or PlayCanvas over... say... just using UDK or Unity to make a WebGL game ???
My knowledge of Javascript engines other than Three does not go deep... so it's entirely possible that this is a dumb question. I'm just wondering though.
Take this PlayCanvas game for example: http://tanx.playcanvas.com/ It's a mere 1MB. You can play it in the mobile browser, mobile Facebook, Twitter Google+ clients, and mobile messaging apps. UDK and Unity can't hit those platforms. Also, with PlayCanvas, you're making your games online alongside a community that can collaborate with you, comment on your progress, help you fix bugs and so on. So I guess PlayCanvas is GitHub+Google Docs to UDK/Unity's MS Office.
Unity still doesn't have great support for making pure 2d games of the Mario/Metroid/Castlevania variety and is awfully heavyweight compared to an HTML5 canvas.
That, and the accessibility of the API vs. having to download and work in an IDE that you'll eventually have to pay money for mean more JS games.
Phaser.io[1] is a fairly comprehensive JS engine that is totally free. It's used to make professional games that run across a variety of devices.
They added 2d support in 4.3 a couple of years ago, but it was still really clunky then. Like, you still had to texture wrap 3d objects behind the scenes and it made 2d GUIs painful to use with no native pixel measurements.
--Unity requires a plugin be installed to play in a browser. http://unity3d.com/unity/multiplatform - scroll down to "UNITY FOR WEB": "Once a user installs it, the hugely popular Unity Web Player plugin updates automatically."
> --Unity requires a plugin be installed to play in a browser. http://unity3d.com/unity/multiplatform - scroll down to "UNITY FOR WEB": "Once a user installs it, the hugely popular Unity Web Player plugin updates automatically."
Unity 5 introduces WebGL. However there are a few things that don't work in all major browsers
Yes, there's plenty of reasons. First of all, babylon.js for instance, has been made specifically for the web. It's been tested on all browsers & on as much mobile devices as possible. Our shaders architecture has been made for that: to run on as much platforms as possible, mobile included. We're also spending a lot of time optimizing the performance for the web browsers and we're taking into account some of its specifics: offline via IDB, support for multi-touches (Touch & Pointer Events), streaming of assets, GC friendly, etc.
We have plenty of tools to help you testing the behavior of our engine and your code in the targeted env, the web: the sandbox tool, the debug layer, emitting user marks for F12 tools. We even have something we’re very proud of, our playground: http://www.babylonjs-playground.com/. Test & debug your code directly in the browser. Learn by experimenting in the target platform.
Moreover, babylon.js is free & open-source. You can debug your game and our engine directly in the browser. You can tune our engine to your needs if wanted as you have access to the source code, fork it and do whatever you want with it. You’ll also write the logic of your code in pure JS (or any great compiler like TypeScript or CofeeScript).
Babylon.js offers then a pure web experience. You can customize everything you want, handle the UI yourself with the ton of existing libraries, add some cool CSS features on top of it, mix it with SVG. Well, it is the web. Last but not least, we have almost finished our Unity exporter to Babylon.js that will dump all the graphics & sounds assets from the Unity scene to our .babylon format. It even seems much more efficient that the Unity 5 export.
Well, you see that this is a completely different philosophy. On the other hand, Unity 5 benefits from a huge community & assets. But creating a simple scene with a couple of meshes could take several minutes to export to WebGL and create up to 100MB of JS! And it's a very specific JS based on asm.js that can't be read by human nor modified. Plus it will only run correctly on Firefox (soon on Spartan too). At last, you will have to write the logic of your game in C#. But it’s a real great option for games developers that don’t master the beauty of the web. Unity is doing everything for them.
Conclusion: Unity 5 targets people with games already built for mobiles and will offer a very specific WebGL option. It's closed source. Babylon.js targets web games developers that build games specifically for this platform. It's free & open-source.
Note: I'm probably not objective as I'm the co-author of babylon.js ;) But I'm sharing my vision.
The playground is possibly my favorite thing about BabylonJS. Makes it very easy to share sample code and ask for help. It uses daily library builds, so several times I've submitted a bug along with a playground link reproducing the issue, and the next morning it just works.
Firefox seems to have a lot of Web Audio bugs. I've already pinged one of the developer of the web audio stacks on Twitter. But I probably need to open a firebug request also.
Our Web Audio engine runs fine in Chrome & Spartan.
Is there a reason that someone would use a Javascript engine like Babylon, Three or PlayCanvas over... say... just using UDK or Unity to make a WebGL game ???
My knowledge of Javascript engines other than Three does not go deep... so it's entirely possible that this is a dumb question. I'm just wondering though.
EDIT: Sorry .. I meant "PlayCanvas". Corrected.