Web Publishing Following Chrome NPAPI Deprecation
With Google about to complete the deprecation of NPAPI support in their Chrome browser, we’ve been receiving some questions about what the best options are for publishing games on the web and reaching Chrome users at the same time. Given Chrome’s wide usage, these are fair questions.
On the off chance that you’re creating web games and hearing about this for the first time, here’s a quick overview. In 2013, Google announced that they would be deprecating and then disabling NPAPI, the plugin framework that Unity Web Player relies on to enable the richest interactive content experiences on the web. Currently, there is a workaround to get the NPAPI support back on in Chrome, but Google plans to completely remove NPAPI support from Chrome in September 2015. There is not an explicit timetable for NPAPI deprecation in other browsers, though it will happen.
Following this announcement, we began serious investigations into alternate avenues for web games. We decided on moving forward with WebGL, which we announced at GDC 2014 and is now available in preview as a build target in Unity 5. You can read more about that here: http://blogs.unity3d.com/2014/04/29/on-the-future-of-web-publishing-in-unity/
The State of WebGL
What seems to be the obvious solution to this is simply to make games in WebGL. While this solution will eventually be excellent and we are working hard on WebGL with browser manufacturers like Mozilla, Google and Microsoft, the base WebGL technology is still limited in comparison to Unity Web Player. This includes a performance gap we are working to narrow though the issue is made more complicated by widely varying performance in different browsers. For more on WebGL performance, see our earlier blog post here: http://blogs.unity3d.com/2014/10/07/benchmarking-unity-performance-in-webgl/
WebGL is totally feasible for “lighter weight” web games and apps in it’s current state but it is important to set realistic expectations. It’s unlikely that you’ll be able to simply float your game over from Unity Web Player and expect everything to work perfectly. Heavy games with high performance needs will likely find the WebGL option currently won’t fit their needs due to the aforementioned performance gap, some other platform limitations like networking, and scalability issues due to build sizes and browser-side memory constraints. Unfortunately, because the technology is still in heavy development, both on our side and on the browser side, we cannot provide support through our premium support channel before we have a full release. In the meantime, the best place to discuss WebGL issues is on the forums (http://forum.unity3d.com/forums/webgl.84/) where our developers are very active.
There is a silver lining!
The great news is that Unity and the browser manufacturers are collaborating closely to solve these issues! Everyone involved is very invested in ensuring WebGL achieves its great potential so we have every reason to believe that WebGL will make developer and gamer lives better in the long run.
The State of the Unity Web Player
The Unity Web Player is still the best option for high performance games on the web. Given this, we will continue supporting it for as long as it’s useful for developers.
It’s also very important to note that Unity Web Player still works beautifully on other browsers outside of Chrome, so there are options.
So what do I do if my game needs the Web Player?
If your existing game requires the Web Player to run properly (especially for those of you with complex high performance games), here’s some suggestions of what you can do in the meantime:
Option A: Encourage players to use alternate browsers where plugins are still available. Create a page to pop up when the plugin won’t start that informs people of what has happened and list browsers that still work well with your game.
Option B: Provide instructions on how to allow plugins to function in Chrome before the plug gets pulled completely on NPAPI in September (at which point there is no way to enable NPAPI plugins. Sample instructions follow:
Step 1: In Chrome’s address bar, type: chrome://flags/#enable-npapi
Step 2: Find “Enable NPAPI Mac, Windows” in the list, and click “Enable”
Step 3: Hit the “Relaunch Now” button at the bottom of the page
What if I’m developing something new?
We recommend that those of you creating new web games with Unity start new projects with Unity 5 WebGL as the default target. WebGL games are more limited in terms of functionality and performance than Web Player games, so you can port your game to the Unity 5 Web Player later if you choose and add some additional functionality to leverage the greater capabilities of the Unity Web Player. This way, gamers will be able to play a WebGL game on Mozilla Firefox, Google Chrome, Apple Safari 8.x or play it as a Unity Web player game on Microsoft Internet Explorer, Apple Safari 7.x, or Yandex.Browser which should provide the widest audience possible.
Keep in mind that with Google well on their way to removing NPAPI support from Chrome entirely, other browsers will follow suit. This eventuality (there are no confirmed timetables for this) makes it very hard to recommend beginning new projects with the Web Player in mind at all.
The short of it
WebGL will be amazing – even better than The Unity Web Player because there will be no plugin barrier for players – but there’s no avoiding that it’s not yet as capable as the Unity Web Player and there’s no spectacular technological option to get around the deprecation of the framework that made it possible. We understand this is a rough transition and feel your pain as we would love the Web Player to continue functioning across all browsers, but unfortunately that decision ultimately is not ours to make. For the time being, if you’re maintaining a very complex game that you want to run well on the web, you’ll need to use the Web Player and direct customers to other browsers.
And we’ll keep collaborating with browser manufacturers to make the WebGL platform and our WebGL tools as powerful as we know they can be!