Unity, Web-based Games and Build Targets / Platforms

in #unity8 years ago (edited)

Hey Steemers,

I thought I would go ahead and make a post about this because there seems to be some confusion regarding game engines and build targets / platforms and in particular games played through web browsers.

The Flash Plugin

Obviously, for the longest time, a lot of games were built using Adobe Flash (or Macromedia Flash if you are an old fart like myself). These games required that your browser have the Adobe Flash plugin. Flash was incredibly popular but due to security issues as well as better options as technology evolved (in this case, HTML 5 and WebGL which is part of the HTML 5 specification), Flash is being phased out.

The NPAPI

The Netscape Plugin Application Programming Interface (commonly known as NPAPI) allowed developers to create browser extensions. It was originally used for (as you might have guessed) the Netscape's browser; however, other major browsers adopted the use of NPAPI as well.

A Wikipedia article about the NPAPI can be found here: https://en.wikipedia.org/wiki/NPAPI

The Infamous Unity Web Player

Game engines like Unity, therefore, created NPAPI-based browser extensions that could launch executables that were built using their development tools. For Unity, this was the Unity Web Player. Below is a screen shot of Unity's Build Settings window, which enables developers to build for specific platforms, like their now deprecated Unity Web Player:

On the development side of things, people would use Unity and within Unity choose to build their game for the Unity Web Player. After the game is built they would have to upload the web player version of their game to some host accessible on the Internet. Players would navigate to the URL where the game was located (or in the case of Facebook an iFrame that served this URL automatically as Facebook doesn't host the actual games themselves on their servers), the game would download and then Unity's NPAPI plugin (the "Unity Web Player") would then run the executable, assuming that the player downloaded and installed the Unity Web Player first. Otherwise, they would get a message telling them that the Unity Web Player is required.

Unity's Support for a Wide Variety of Build Targets / Platforms

The Unity Web Player is not the only build target / platform that Unity supports. Developers can make their game once and then choose to build it for:

  • iOS
  • Android
  • Windows Phone
  • Tizen
  • Windows
  • Windows Store
  • MacOS
  • Linux
  • WebGL (HTML 5)
  • Playstation 4
  • Playstation Vita
  • Xbox One
  • Xbox 360
  • Wii U
  • Nintendo 3DS
  • Oculus VR
  • Google Cardboard
  • Steam VR
  • Playstation VR
  • Samsung Gear VR
  • Microsoft HoloLens
  • Android TV
  • Samsung Smart TV
  • tvOS

Notice that the Unity Web Player is not on the current list. A blog post explaining why can be found here.

Bye-Bye NPAPI

The NPAPI has always suffered from security issues. Google has since decided to remove NPAPI support from its Chrome browser, Mozilla from its Firefox browser, Microsoft from its Edge browser (its still in Internet Explorer). This means all sorts of plugins that depended on the NPAPI can no longer be used, like the Unity Web Player.

Hello HTML 5 and WebGL

Furthermore, with the adoption of HTML and its support for Web GL it is no longer necessary.

Building Games in Unity for the HTML 5 / WebGL Platform

So today, developers can select from any of the above build targets / platforms (assuming they have a license for some of them like Playstation and Xbox) and Unity will build their game for that platform. At that point the game is built native for the platform selected. There is no Unity Web Player to download because the game wasn't built to be used with the Unity Web Player plugin. It still is a "Unity" game in that the game is developed in Unity, its just that the game isn't built for the Unity Web Player (as browsers can no longer support NPAPI plugins).

So basically, anyone who thinks they are not playing a "Unity" game because its HTML5 / WebGL, think again. Its a very real probability that you are playing a game made in Unity that was built for the HTML5 / WebGL platform.

About Me

I am a software engineer with over 8 years of experience in the video game industry. Titles that I am credited on include Assassin's Creed II, Assassin's Creed: Brotherhood, Ghost Recon: Future Soldier, Rocksmith 2014 and Far Cry 4. I have also either worked on or worked on the technology for Far Cry 3, Rainbow Six Siege, and The Division. I have personally been a Unity Pro licensee since version 2.64f. Today I am enjoying a respite from the grind of AAA development while working with friends on smaller projects utilizing Unity and determining the next big thing I would like to do.

Sort:  

Liked this article even though they're already things I know... This is pretty useful for people who don't know a lot about gamedev or didn't gamedev for years.