Pages

Thursday, May 27, 2010

NaCL, advantage or disadvantage

recently Google announced a technology called native client or simply NaCL.. we can run native code through it in a secure manner. it has it's own compilers and the hole machine code will be checked for security problems. your code has no access to drivers and operating system calls. it's multi platform and it's code will be compiled before running from an intermediate language. NaCL exposes some useful APIs for it's developers to use in their apps. one of those APIs is OpenGL ES 2 so game engines can be ported to NaCL. as most of you know unity works closely with Google to port it's engine and in Google IO they showed Lego star wars running on Linux using NaCL.
NaCL will fill the gap between games and users and removes the need for plug ins completely for it's users. if other browsers follow it we should forget the plug in word at all. some features will be covered by HTML 5 and some others by NaCL. two questions will come up. 1 what will happen to platforms like flash and silverlight? 2 is it an advantage for unity or not? surely the second question just will come up in our minds (unity developers).
Microsoft and Adobe invested much in RIA platforms and they don't want to lose their market. hey NaCL is not their enemy or competitor! you can write any app for your desktop using C++. oh you can write it using assembly! you don't do that always. people even use flash and silverlight for desktop applications. so they remain great platforms for creating apps fast and easy. flash will harm from this because silverlight now has great features and flash's main advantage it's wider platform support and plug in install base. the first will be killed by moonlight and the second by NaCL. Microsoft added much to it's silverlight and continue and i think this competition will result in 2 great platforms. maybe silverlight kill flash just like unity that killed director. so middle wares will not be killed by Nacl, adobe might use it for creating a web based premier or video conversion software and many other CPU bound applications but middle ware will remain important. it just will become easier for middle wares to come and say hello to users.
now the second question and my answer! it means that torque, shiva, dx studio, unreal, unigine, cryengine can be all on the web just like unity. yes it means! is it bad for unity? no no no! why and how?
1 UT guys showed that they are creative guys with correct vision. they choose write add ons and write great code. it's the only engine that uses mono for it's scripting. why? because DHL and other UT guys have the correct vision.
2 even now unity's plug in penetration is not too much and the competition is open for others. 30M is much but it's not like flash available everywhere. do you want that much! let's donate UT to show world cup games with unity player for free and anyone will install it. it's what Microsoft did on Olympic with silverlight :) just kidding. let's make great games and users will have to install it. when it's not the main power of unity we should not afraid. it might just make unity a better engine because it should compete.
3 it will remove the player size limitation of unity because each game will have parts of the runtime that it uses in itself. it's good and bad. it's good because they can add features without even thinking about size. it's bad because all game's size will become bigger than before. we might find work around but unity's engine is about 4MB now and this will be added to every game. maybe unity exposes it's engine as APIs for NaCL users using unity and Google might be kind enough to preinstall it on chromium. :) in this way we can have best of both worlds but someone might say it's just like having a plug in another might say Google will not do it but Google will ship flash with it's browser so why should not ship unity? from the other hand each game should carry parts of the engine that it really uses. some parts like rendering and input and physics are needed for all games both all parts of the physics are not. for example cloth simulation can be added to unity in a seporate module and just games using it will carry it with themselves.
4 unity has other features for web games that other engines don't have because either they don't want to be in this market or they are not mature enough yet. for example WWW class or mono's abilities to work with databases or web services are not available in those other engines. server side middle wares has clients for making MMOs and virtual worlds using unity because it uses mono and but they don't have clients for other engines. for example netdog, photon and smartfox server all have unity clients and C++ clients or flash clients. using them in unity is easy but try integrate them with torque's source code and use them. how much will it take to integrate?
there is much more to say but i have much work to do these days.