11 min read

So, you’ve just completed your awesome project, and your game is ready to be played: it features tons of awesome characters and effects, a beautiful plot, an incredible soundtrack, and it sparkles at night. The only problem you’re facing is: how should I distribute my game? How do I reach my players?

Fortunately, this is an awesome world, and there are plenty of opportunities for you to reach millions of players. But before you are even able to reach the world, you need to package your game. For “packaging” your game, I will cover both the integration inside of a web page, and the actual packaging inside of a standalone application.

In the first case, the only thing you need to do is be able to host your HTML page wherever you want, making it accessible for everybody in the world. Then, you will spread the world through every channel you know, and hopefully your website will be reached by a lot of interested people. If you used an HTML5 Game Engine (something like this ), then you should have a lot of tools to easily embed your game inside of an HTML page. Even if you’re using a much more evolved game engine, such as Unity3D, you will always be able to incorporate the game into your website (of course, the only thing you need is to make sure that your chosen game engine should support this feature). In the Unity3D case, the user is prompted to download (or give access to, if already downloaded) the Unity3D Web Plugin, which allows the user to play the game with no problems at all. If you don’t own a website, or you don’t want to use your personal web space to distribute your product, there are a lot of available alternatives out there.

Using an external service

So, as I said, there are a lot of services that give you the ability to publish and distribute your game, both in standalone application, and as a “normal” HTML page. I will introduce and explain the most famous ones, since they’re the most important platforms, and they’re full of potential players.

Itch.io

Itch.io is a world famous platform and marketplace for indie games. It has a complete web interface, and unlike Steam, itch.io doesn’t provide a standalone client, and users have to download game files directly from the platform. It accepts any kind of games, like mobile, desktop and web games. Itch.io can be considered as a game marketplace, since every developer is able to set a minimum price for his/her product: every player has the ability to choose the amount they thinks that game deserves. This can be seen as downside of this platform, but you have to consider that you can set a minimum price, and giving this ability to players cash spread the knowledge of your game more easily.

Every developer can freely upload his/her content with no restrictions (except usual restrictions, like the ones concerning copyright infringment), with no entrance fee and with a fast profile creation procedure. Itch.io takes a 10% fee on developers’ revenue (which is an absolutely amazing ratio) and allows developers to self manage their products, even allowing pre-orders if your game is still in development. Another awesome feature is that you don’t need an account to play hosted games.

This makes Itch.io a very interesting platform for those interested in selling a game. Another alternative, yet very similar to Itch.io, is gamejolt.com. GameJolt has basically the same features as Itch.io, although players are forced to create an account in order to play. An interesting feature of Game Jolt is that shares advertisements revenue with developers.

Gog.com

Gog.com is a more restrictive platform, since it only accepts a few games each month, but if you’re one of the lucky guys whose work has been accepted, you will get a lot of promotion from the platform itself: your new release will be publicly shown on social media channels, and a great number of players will surely reach your game.

This platform tries to help developers build their own community with on-site forums: every game has its own space inside the platform, where players and developers can share thoughts and discuss topics such as new releases or bugs to be fixed. Another interesting feature is that Gog.com helps you reach the end of your development path: they give you the possibility of an advance in royalties, to help your game reach its final stage.

Finally, we can talk about the most famous and popular game distribution service of all time, Steam.

Steam

Steam is famous. Almost very player in the world knows it, and even if you don’t download anything from the platform, its name is always recognizable. Steam provides a huge platform where developers and teams from all over the world can upload their works (both games and softwares), to get an income.

Steam splits the revenue with a 70/30 model, which is considered a pretty fair ratio. The actual process of game uploading is called Steam GreenLight. Its main feature is being the most famous and biggest game marketplace of the world, and it provides its own client, available for Mac, Windows and Linux.

The only difference from itch.io, gog.com and gamejolt.com is that only standalone applications are submittable.

Building a standalone application

Since this is still a beautiful world with a lot of possibilities, we can now build our own standalone game in a very easy way. At the end of the process I’m about to explain, you will obtain a single program that will contain your game, and you will be able to submit it to Steam or your favorite marketplace.

The technology we’re about to use is called “node-webkit“, and you can find a lot of useful resources almost everywhere on the web about it.

What is node-webkit?

Node-webkit is like a browser that only loads your HTML content. You can think about it as a very small and super simplified version of Google Chrome, with the same amazing features. What makes node-webkit an incredible piece of software is that it’s based on Chromium and Webkit, and seamlessly fully integrates Node.js, so you can access Node.js while interacting with your browser (this means that almost every node.js module you already use is available for you in node-webkit). What is more important for you, is that node-webkit is cross-platform: this means you can build your game for Windows, OS X and Linux very easily.

Creating your first node-webkit application

So, you now know that node-webkit is a powerful tool, and you will certainly be able to deploy your game on Steam GreenLight. The question is, how do you build a game? I will now show you what is a simple node-webkit application structure, and how to build your game for each platform.

Project structure

Node-webkit requires a very simple structure. The only requirements are a “package.json” file and your “index.html”. So, if your project structure contains a index.html file, with all of its static assets (scripts, stylesheets, images), you have to provide a “package.json” near the index page. A very basic structure for this file should be something like this:
  

{

       "name":"My Awesome Game",
    
       "description":"My very first game, built with amazing software",

       "author":"Walter White",

       "main":"index.html",
    
       "version":"1.0.0",
    
       "nodejs":true,
    
       "window":{
    
           "title":"Awesomeness 3D",
    
           "width":1280,
    
           "height":720,
    
           "toolbar":false,
    
           "position":"center"
    
       }

   }

It’s very easy to understand what this package.json file says: it’s telling node-webkit how to render our window, which file is the main one, and provides a few fields describing our application (its name, its author, its description and so on). The node-webkit wiki provides a very detailed description of the right way to write your package.json file, here. When you’re still in debugging mode, setting the “toolbar” option to “true” is a great deal: you will gain access to the Chrome Developers Tool.

So, now you have your completed game. To start the packaging process, you have to zip all your files inside a .nw package, like this:

   zip -r -X app.nw . -x *.git*

This will recursively zip your game inside a package called “app.nw”, removing all the git related files (I assume you’re using git, if you’re not using it you can simplify the command and run zip -r -X app.nw .). We now need to download the node-webkit executable, in order to create our own executable. Every platform needs its own path to be completed, and each one will be explained separately.

OS X

Since the OS X version of node-webkit is an .app package, the operations you need to follow are very simple. First of all, right-click the .app file, and select Show Package Contents.

What you have to do right now, is to copy and paste your “app.nw” package inside Contents/Resources . If you now try to launch the .app file, your game will start immediately. You’re now free to customize the application you created: you can change the Info.plist file to match the properties of your game. Be careful of what you change, or you might be forced to start from the beginning. You can user your favorite text editor.

You can also update the application icon by replacing the nw.icns file inside Contents/Resources. Your game is now ready to run on Mac OS X.

Linux

Linux is also very easy to setup. First of all, after you download the Linux version of node-webkit, you have to unzip all of the files and copy your “node-webkit” package (your “app.nw”) inside the root of the folder you just unzipped. Now, simply prompt using this command:

   cat nw app.nw > app
   chmod +x app

And launch it using:

   ./app

To distribute your linux package, zip the executable along with a few required files:

  1. nw.pak
  2. libffmpegsumo.so
  3. credits.html

The last one is legally required due to multiple third-party open source libraries used by node-webkit.

Windows

The last one, Windows. First of all, download the Windows version of node-webkit and unzip it. Copy your app.nw file inside the folder, which contains the nw.exe file.

Using the Windows command line tool (CMD), prompt this command:

copy /b nw.exe+app.nw app.exe

You can now launch your created .exe file to see your game running. To distribute your game in the easiest way, you can zip your executable with a few required files:

  1. nw.pak
  2. ffmpegsumo.dll
  3. icudtl.dat
  4. libEGL.dll
  5. libGLESv2.dll

Your Windows package is ready to be distributed. You can use a powerful tool available to create Windows Installers, which is WixEdit.

Conclusions

Now you have your own executable, ready to be downloaded and played by millions of players. Your game is available for almost every platform (I won’t cover the details on how to prepare your game for mobile, and since it’s a pretty detailed topic, it will probably need another post), both online and offline. It’s always been completely up to you decide where your game will live, but now you have a ton of multiple choices: you can decide to upload your HTML content to an online platform, or to your own website, pack it in a standalone application, and distribute it via any channel you know to whoever you desire. Your other options is to upload it to a marketplace like Steam.

This is pretty much everything you need to know in order to get started. The purpose of this post was to give you a set of information to help you decide which distribution way is the most suitable for you: there are still a lot of alternatives, and the ones described here are probably the most famous. I hope your games will reach and engage every player in this world, and I wish you all the success you deserve.

About the Author

Marco Stagni is a Italian frontend and mobile developer, with a Bachelor’s Degree in Computer Engineering. He’s completely in love with JavaScript, and he’s trying to push his knowledge of the language in every possible direction. After a few years as frontend and Android developer, working both with Italian Startups and Web Agencies, he’s now deepening his knowledge about Game Programming. His efforts are currently aimed to the completion of his biggest project: a Javascript Game Engine, built on top of THREE.js and Physijs (the project is still in alpha version, but already downloadable via http://npmjs.org/package/wage. You can follow him also on twitter @marcoponds or on github at http://github.com/marco-ponds. Marco is a big NBA fan.

LEAVE A REPLY

Please enter your comment!
Please enter your name here