Jump to content

why babylon.js if unity export webgl??

Recommended Posts

@kenta88 Unity and Unreal Engine 4 both support building games for WebGL by cross-compiling C++ code into JS using technology called Emscripten. This, however, creates a really big junk of JS code that browser needs to compile and run, thus games built inside C++ engines transported into JS experience lags for some time after compilation, which is also highly CPU-dependent (Faster machines will run it better). However, the most important thing here is that, games built in C++ engines are not flexible in Web, meaning that HTML5 elements are not easily "binded" to games during the development, which later creates problems if you want to implement HTML5 technologies alongside the game (or maybe CSS or additional JS), Another main difference between C++ engines and JS engines is that JS engines (for example Babylon) are compiled on the fly in modern browsers, while C++ engines need to actually build and export the game into WebGL. This can slow down development in the testing stage of game development, since after finding bugs and fixing them you need to build the game again (building WebGL inside C++ engine is both resource and time-consuming process) and again for every fix or new feature or updates etc... However, this is not the case for JS engines, where you can simply refresh the page in your browser and see the changes immediately. Perhaps the only drawback of JS engines is the lack of advanced Editors (which is not really important since you can do pretty amazing stuff sometimes with only 1 line of code, considering JS game engines are designed to be simple, Babylon.js can be example for this) and this won't be case in the future, we already see emergence of JS game engine editors like this and there is some hard work going on in this field particularly.

Have a nice day! :) 

Link to post
Share on other sites

Compare a simple spinning cube in Babylon.js and Unity3D.  Babylon.js would be a few bytes, load instantly and can integrate with all other HTML elements.  Can interact via standard Javascript events.  I use Babylon.js for my hybrid website 'cos I need the seamless integration.  Unity3D takes full page, ages to load, 20 MB file sizes.  However, you could pull off Quake in Unity3D webGL.  Babylon.js doesn't have the versatility to do that yet.

Link to post
Share on other sites

my little answer:

bjs is library not an environnement like unity.

babylon was easily integrated with my existing elements (flexiblility). It was a realy good way to switch from flash to webgl.
It's harder to have first result but all i was looking for is in bjs (and community is reactive).

maybe i would have another opinion if i was targeting "phone game".

on my opinion, Webgl game need to be "light" fast and flexible. if your are looking for cross platform game, unity is your friend. If your are looking for webgl only and an "optimized" way, bjs is my choice.


Link to post
Share on other sites
15 minutes ago, eboo said:

if your are looking for cross platform game, unity is your friend

Hmm, maybe...

I'm not really sure what you mean by "cross-platform", because if it is what I think it is then WebGL actually IS cross-platform. It is capable of running almost on any device with a GPU and a browser installed in to it, Perhaps you meant performance issues that we can encounter in mobile GPUs, but as a Unity and (mainly) UE4 game developer I can assure you that C++ engines aren't really "winners" when dealing with optimization stuff as well. Especially UE4 specifically disables its powerful Temporal-AntiAliasing technique if you target mobile platforms for your game. Of course, you can achieve high-end graphics on mobile thanks to Vulkan API recently released by the Khronos Group and I already tested it with UE4 (they implemented this feature to their engine just after the release) and then built it for Android to test it on my Xperia (which later on got overheated as hell just like when I use Google Cardboard VR apps). Long story short, no matter what engine or graphics API you use, you will always face problems when building games for mobile platforms. If you choose iOS though, this problem gets a little bit easier to solve since you will have to test it only on a couple of devices (same with Windows Phone I think) but if you also target Android, then well, good luck with that. My personal opinion on this matter is that you cannot achieve an ideally designed game that runs and looks great on all platforms at the same time no matter what type of technology or API you are using in doing so. What I think is that you have to choose a specific platform for your game and optimize it for that particular "target" platform you've chosen, then even that other platforms (and thus other customers you might have gained) can't play your game, the ones that can will definitely be satisfied with quality and performance you have provided. On the other hand, what makes WebGL superior on this matter, is that it is so flexible and easy that when you target mobile platforms you don't go through a bulk of work that mobile developers usually have to deal with (SDKs, lots of testing because of various  compatibility issues, buying developer license etc.), in WebGL though, just make your game, put it on Web, and that's it! In the past my main concern about WebGL was dealing with all the low-level stuff while programming WebGL games (like writing shaders, then creating programs and linking them etc.) but now we have these powerful WebGL frameworks like this and this that do all the work for you. Now at this moment it's more about you (the developer) and the game (or in general, GPU-accelerated Web App) you are going to make and the way you are going to implement it, rest is handled for you.

Thanks :) 

Link to post
Share on other sites
On 1/4/2016 at 11:40 PM, OMAR said:

@kenta88 the most important thing here is that, games built in C++ engines are not flexible in Web, meaning that HTML5 elements are not easily "binded" to games during the development, which later creates problems if you want to implement HTML5 technologies alongside the game (or maybe CSS or additional JS)....

about c++ events and handle


Link to post
Share on other sites

In my humble opinion, were are indeed in a period of transitioning, I believe even Sony/Microsoft said that the next gen consoles would probably be the last consoles to embed hardware. The next -> next generation of consoles will only be "video streaming boxes with controllers" and the computing will be made on servers directly (some people have hard time believing that, but that's what the guy at last E3 said !).
Apart from that, being 32 years old, I could see the W.W.Web birth and how it evolves, I can tell you I'm very glad I chose NOT to specialize in ActionScript3 when I was a student. Too much complication and difficulty in programming means DEATH !!! There'll always be highly skilled programmers out there, sure, but they don't create the trend alas ...
To some extent, we can observe the same kind of evolution/over-simplification in social networks : remember MySpace ? It was HIGHLY customizable if you knew Html/css/JS. But it died and then came Facebook ! Where there is NO control/customization for people who know a bit of programming. And then came Twitter ! Only 140 characters...
Some famous journalist (don't remember his name ...) once wrote an article about how the WWW was dead (He meant that noone would go to the www anymore, but rather use apps instead). But I believe, on the contrary, a browser is all you need in a device. I believe that in the future, everything will all just be within the browser. Apps are maybe just a way for Apple/Google to "control" the content. I'm from the "pirate bay" generation and I don't like the way everything is "locked" in nowadays devices.

WebGL is highly trending right now, I'm sure you've all heard of Amazon open-source game engine ! Unity and Unreal are getting to it too, and we have Three.js that's been out there for a while. But they are LATE at it, they only work on Firefox and requires plugins. End users hate that ! There is a WAR going on and I'm hoping for BABYLON.Js to win it ! So guys ! Let's make it the FINAL game engine ! What other framework lets you the possibility to create a potential MMORPG if you are skilled enough to do it ? What other framework lets you create, in a few lines of code, a game that will be compatible on ALL devices from Iphone 4 to mac and everything in-between ? What other framework has sound, video, and already VR ready ???
Final note : The community : I've found here on this forum people nice, willing to help and patient. I mean, it's almost a miracle, anybody out there knows for sure that forums tend to be full of trolls and stupidity, meanness ... I've found here only nice people and love ! This is so RARE that it needs to be said !

Long live to BABYLON.JS !!!!

Link to post
Share on other sites

Actionscript was one of my first languages I actually made a full game in... Ahhh memories ?.  Well I guess my pascel text casino would have been the first, but I don't think pascel counts...  as3 is old now isn't it? Wasn't that back with like cs1 or 2?

Link to post
Share on other sites

emscripten reminds of the Windows emulator on pre-Unix Mac systems.  If you had started out wanting to run something in a certain environment, you would have made it in a way which was native to it.  If it was too late to change, some type of runtime would be acceptable to rewriting or maintaining 2 code bases.  Somethings could get lost in translation though.  Further development would also involve longer, possibly difficult, development - testing cycles.

One thing Unity does have is it is in OpenGL, and I am thinking probably a version > 2. When WebGL 2.0 is final, they could take advantage of it, if emscripten updated support for it.  We being much smaller, have to do it ourselves.


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...