Subscribe to GameFromScratch on YouTube Support GameFromScratch on Patreon

27. May 2013

So a couple weeks back there was an announcement that the Turbulenz HTML5 game engine was being open sourced. It was one of those projects I had intended to check out when I got the time…. which I finally did.


What is Turbulenz?

Turbulenz is an HTML5 game engine and platform. You can create and publish your game on Turbulenz and they take a 30% cut of sales ( this of course is their business model, and 30% is fast becoming the digital norm ). You can also publish to other sites ( your own, Facebook, Kongregate ) completely free. The most recent version of Turbulenz now offers TypeScript support.



You need to sign up and verify your email then log in to the developer portal.

There are downloads available for Windows, MacOS and LInux. Windows ships as a exe installer, while the other two ship as .run files. On Mac or Linux simply open a terminal window and chmod +x the file you downloaded, then execute it.

Before you install you need to install the CG Toolkit! It is available from nVidia right here. With that done, the install is simply a series of yes/no questions. The script will however prompt for your admin password. I was running Snitch ( packet detector ) during the install and no outbound requests were made, so you should be safe entering it.


What you get?

Now that it is installed, you should see a file hierarchy like this:

Turbulenze doc structure


Samples are pretty impressive, there are dozens of them covering topics from physics, to video, particles, model loading and more. In the assets folder, there are a fair number of resources to get you started. They include models, shaders, materials, fonts, video etc.


Perhaps most impressive though is the documentation. In the docs folder there is a pdf and html… now get this...

Turbulence Doc Length


That's the end of the table of contents, and yes… that is 949 pages! So, lets just say Turbulenze is well documented! You should be able to access the documentation online by clicking here.


Running Turbulenz

Open a Terminal and change directory to the SDK install location. In my case, installed using the defauls the directory is /Users/Mike/Turbulenz/SDK/0.25.1

Then type source env/bin/activate

Now finally run it by typing ./

Local turbulenze running in browser

Here is one of the samples, a 3D model sample, running in the browser. Please not, the choppiness is the results of the gif framerate, not the demo. It runs at least 30fps on my Macbook Air.





Hello Turbulenz -- A simple Turbulenz project

We are going to create a "simple application" that displays a Hello World graphics on scene. We may be redefining the word "simple" in the process!

First you start off creating a new project using the Turbulenz web interface ( ). Full instructions are in the documentation.

Creating a new application



Once your project is made you need to run a build process.

makehtml --mode canvas-debug -t templates -t . -o HelloTurbulenz.html HelloTurbulenz.js

This generates the HTML file ( HelloTurbulenz.html in this case ) for your project. Each time you change your source, you need to run this process again. I have to admit I found this annoying, as the lack of a build cycle is exactly what I like about HTML5 development in the first place! Anyways, next up we need to create a resource mapping file. You can't simply access files like "myImage.png", you need to create a mapping.

Create a new file named mapping_table.json and add the following contents:


{    "version": 1.0,    "urnmapping": {        "textures/helloWorld.jpg": "helloWorld.jpg"    }}



This file basically says The file at "/textures/helloWorld.jpg" actually resides in the file "helloWorld.jpg". Once you have defined your mapping table, you need to add it to your application configuration in the Turbulenz web app!


Configuring the mapping table




You need to create a folder in your application directory named staticmax ( no idea why that name btw… ) and put your image there, I used the following image:



Textures in Turbulenz need to be power of 2. This particular image is 512x256 and named helloWorld.jpg.


Now let's take a look at the code:

/*{{ javascript("jslib/draw2d.js") }}*/

/*{{ javascript("jslib/requesthandler.js") }}*/

/*{{ javascript("jslib/services/turbulenzservices.js") }}*/

/*{{ javascript("jslib/services/turbulenzbridge.js") }}*/

/*{{ javascript("jslib/services/gamesession.js") }}*/

/*{{ javascript("jslib/services/mappingtable.js") }}*/

/*{{ javascript("jslib/canvas.js") }}*/

/*global TurbulenzEngine: true */

/*global TurbulenzServices: false */

/*global RequestHandler: false */

/*global Canvas: false */


TurbulenzEngine.onload = function onloadFn() {

var intervalID;


var gd = TurbulenzEngine.createGraphicsDevice({});


var draw2D = Draw2D.create({graphicsDevice: gd});


var requestHandlerParameters = {


var requestHandler = RequestHandler.create(requestHandlerParameters);


var helloTextureLoading, helloTexture = null;



var mappingTableReceived = function mappingTableReceivedFn(mappingTable) {

helloTextureLoading = gd.createTexture({



onload: function(texture){

helloTexture = texture;





var gameSessionCreated = function gameSessionCreatedFn(gameSession) {

TurbulenzServices.createMappingTable(requestHandler, gameSession, mappingTableReceived);


var gameSession = TurbulenzServices.createGameSession(requestHandler, gameSessionCreated);


function tick() {



if(helloTexture !== null)


texture: helloTexture,








intervalID = TurbulenzEngine.setInterval(tick, 1000/60);




If you run that code, you see:



One thing that needs to be looked at right away is the comments at the top of your code:

/*{{ javascript("jslib/draw2d.js") }}*/

/*{{ javascript("jslib/requesthandler.js") }}*/

/*{{ javascript("jslib/services/turbulenzservices.js") }}*/

/*{{ javascript("jslib/services/turbulenzbridge.js") }}*/

/*{{ javascript("jslib/services/gamesession.js") }}*/

/*{{ javascript("jslib/services/mappingtable.js") }}*/

/*{{ javascript("jslib/canvas.js") }}*/

/*global TurbulenzEngine: true */

/*global TurbulenzServices: false */

/*global RequestHandler: false */

/*global Canvas: false */


These are build instructions for Turbulenz and are processed when you run makehtml. These are the dependencies of your application. You will spend some time adding and removing libraries to resolve various build snafus.


The rest of the code is fairly straight forward, if a bit more involved than you would normally expect. If you are new to JavaScript asynchronous programming, following the programs execution might be a bit confusing.


We start off creating a number of required Turbulenz subsystems. Then we define a method that will be called once the mapping table is loaded. Inside we create our texture, then when it's unload function is fired, we assign the results to our variable helloTexture. Next we create our game Session, this is where createMappingTable is actually called, leading to the above callback being fired.


Next we create a function tick(), which is essentially our game loop. Each "loop" through the game loop ( or each time tick is called ) we call beginFrame() on the GraphicsDevice and begin() on our Draw2D object. If you have done any OpenGL programming, this will look immediately familiar. If our texture is loaded ( the joys of async processing… ) we draw our texture on screen.


After we define our tick() function, we then set Turbulenz to call it every 60th of a second by calling setInterval.



Of course, this is a very simple example, it doesn't use 95% of what Turbulenz has to offer, but does show you the workflow of working an Turbulenz, as well as what a simple application looks like. The framework itself is amazingly comprehensive and performs quite well on every browser I tested. On the other hand, it's complicated… sometimes needlessly so. This simple sample took me FARRRRRRRR too much time to figure out all the various hurdles ( adding assets, project layout, running and hosting applications, the compilation process, etc… ), but you only have to do that once. In all honesty, I spent about 3x longer on this than I expected to! Turbulenz has very good documentation, but you need to know what you are looking for and that is often the most difficult process. What I haven't shown today are the supporting tools that ship with Turbulenz, like the Collada -> JSON converters, nor the platform services that the Turbulenz server offers.


If ease of use or simplicity is a priority for you, I highly suggest you look elsewhere ( three.js perhaps ). If you want to bundle your application for portables using PhoneGap, CocoonJS, etc… I think you are out of luck with Turbulenz. However if you want a complete and capable 3D HTML engine, with a complete asset pipeline and backend services and are willing to put up with the build process and the occasional bout of head scratching, Turbulenz is certainly worth checking out. Just advanced warning… it aint easy!


Edit there is a nearly 2 hour getting started webcast I've embedded below



23. May 2013

Earlier this week Unity announced iOS, Android, WP8 and BB10 targeting will now be included in the base package.  There was another small change that wasn't given the same exposure.  You can now purchase Unity pro on a subscription basis.


So, what does it cost and what do you get? In Unity's own words:


Create with Unity Pro for just $75/month

Our new limited-time offer brings the power of Unity Pro to even more developers!

  • Subscribe and pay by the month for a minimum of 12 months
  • Prices start at $75/month for Unity Pro
  • New releases during your subscription included at no extra cost
  • Add any Unity Pro add-on to your plan whenever you want at just $75/month per add-on


It's too bad there is a 12 month minimum, as there would have been a heck of an opportunity here.  Another thing to keep in mind, you need to get pro for each supported platform, so for example if you wanted to target iOS, Android and PC/Web at pro level that would cost $225/month.  In the end I suppose it comes down to how often Unity release new versions.  By their prior release schedule, if you purchased early in 3.x's life cycle, these prices would be worse.

Right now for example, PRO + iOS + Android would cost $4,500 to buy.  Via subscription it would be 2700$ a year.  So basically, if a new version ( Unity 5 ) is released within 2 years, subscription is a good deal or break even at worse, otherwise outright purchase is your better road.  Do I expect to see Unity 5 within 2 years?  My crystal ball says yes.


What exactly do you get with pro over basic anyways?

I suppose that is the ultimate question, now that Basic is free, what do you get for going pro anyways?  Well the full feature matrix is available here.

The key advantages ( at least imho ) are:

  • Native code access.  Want to integrate with a 3rd party C++ library…  you can't, at least not if you aren't pro.
  • Improved graphics ( 3D Textures, Realtime Shadows, HDR, Lightmapping with GI, Render to Texture, Deferred rendering, Occlusion culling and Full Screen Post Processing effects are all pro only graphic features ).  You may or may not need them
  • Code and GPU profiler
  • Build size stripping ( on mobile, pro can create smaller EXEs )
  • Splash screen removal
  • IK rigs for Mecanim
  • LOD
  • Playing video and streaming
  • NavMesh/Pathfinding

So, if you are creating a cutting edge FPS, pro is almost a must, at least if you want post DX9 fidelity graphics.  If you are creating a puzzle game or less graphically intensive game, almost none of these features is going to be important to you, except perhaps the exe stripping.


Anyways, you can purchase Unity via subscription right here.

21. May 2013


Well this one was out of left field:


Today, we’re taking another step on this long road: as of right now, independent Unity developers will be able to deploy their games to Android and iOS platforms completely free of charge. Update Unity and you will find Android and iOS build options (previously basic add-ons) ready and waiting for you to use.

There are no strings attached, no royalties and no license fees. This is just an extension of Unity Free which we launched in 2009. Individual developers and startup studios can simply download Unity and get going on mobile game development. As before, companies and other “incorporated entities” (you know who you are) with a turnover in excess of $100,000 in their previous fiscal year are required to use our paid version. That way, we can keep the lights on and continue to make Unity better for everyone.

(You can make as much money from your games as you like – this limitation is about large companies not using our free products, not about sharing your future revenues.)

And we’re not stopping there. In the coming months, we will make Blackberry 10 and Windows Phone 8 deployment available to everyone all over the planet on those exact same terms. Completely free of charge.


Nutshell version, if your company made less than 100K last year, you can now target iOS and Andrid using the free version of Unity!  Other great news is the BB10 and Windows Phone 8 versions will also be available for free.


This is pretty awesome.  I have to wonder though if Unity aren’t making a bit of a mistake, I would have thought a big part of their revenue base would have been the mobile hobbyists?  Apparently their accountants disagree.  Oh well, it’s a win for Indie devs everywhere.  Frankly it’s getting harder and harder to find a reason NOT to use Unity for your game!


Read the official blog post here.


Or, watch the video:


15. May 2013


So, it is now available for download, although the version is 0.1, so expect some warts!  Oh, the “it” in question is Google’s new IDE for Android development based on IntelliJ by Jetbrains, a developer I am a huge fan of.


Now I am going to take a tour of the IDE.


Welcome screen:



New Project Screen



New Project Part 2



New Project Part 3



New Project Part 4



Code Editing Window / Code tips




Error Dialog



Debug device chooser




Debug Window




GUI Editing



Screen size options:




Theme selector




Multiple Device preview



I experienced no crashes, everything was very intuitive and quick, other than initial loading.  I’m initially quite impressed.  IF you are wondering, this IDE *ONLY* works for Android projects.

News ,

15. May 2013

Today during the Google IO event there was an announcement that both shocked and pleased me.  They are releasing a new IDE for Android development.  Best of all, it's based on IntelliJ, easily my favourite Java IDE.



(Photo's are from Verge )


One of the coolest new features is the addition of a tool allowing you to see your code running on a multitude of different devices at the same time:

Verge super wide


I can say easily one of the things I hate most about Android development is Eclipse, which is pretty much the defacto tool for Android. You could always work in IntelliJ or Netbeans, but it was never quite as seamless and always seem to have a gap or two in functionality.  Any news that might potentially keep me away from the hateful IDE that is Eclipse is great news to me!


You can read more about the announcement over at The Verge.  As of yet, no downloads are available on Googles websites.



Edit: Download link now available.  Also, so hands on screenshots available here.

News , ,

Month List

Popular Comments

Introducing the Cool Thing of the Week
Subscribe to GameFromScratch on YouTube Support GameFromScratch on Patreon

19. December 2011



In the process of scouring the net, either out of my own interest, as research for possible articles or as part of my own development process, I come across tons of absolute gems.  This new weekly column is going to be showcasing these various sites of interest, I hope you find them as interesting as I do!


I spend a lot of time on the web, but I can’t be everywhere!  So if you came across a really cool site, project, game or something else that you think will be of interest to a bunch of game developers, let us know and it may be featured as a future cool item.  This is all about raising exposure to items that might be of interest to your fellow developer!





Now, let me introduce the first ever Cool Thing of the Week! – List of free game development libraries




There are an absolute ton of free libraries out there covering all facets of game programming.  One of the biggest problems is a matter of finding them!  Often times, Google provesEbonyFortress completely useless and forum links you may come across have long since been abandoned, leading you to page after page of dead links.  Today’s entry really isn’t all that much of an exception, as it hasn’t been updated in close to a year.  That said, it is still perhaps the most timely and complete list of free game related libraries I have ever found.



This site breaks entries down into their general category ( 3D Graphics, 2D Graphics, Sound/Music, Networking, Video, Compression, Artificial Intelligence, Math/Physics, Scripting, etc. ), each entry contains a link to the library as well as the license it was released under ( such as GPL, MIT ).  There are a ton of entries, well over a hundred and from my own experiences I would say it is pretty comprehensive.  All the libraries I could think to look up were represented on this list, although in a few cases things weren’t where I initially expected them ( such as SFML being under general purpose instead of 2D graphics, although that location makes perfect sense as well. )  There are some entries in there I would probably prune due to their age ( such as Hexen 2 or Genesis ) and I would love to see an indicator to show if thee libraries are still under active development.  These small quibbles aside, the list is nearly perfect.



So, if you find yourself looking for a free library for just about any aspect of game development, this page is a very good place to start!  I can only hope the author continues to update it, to keep it the wonderful resource it currently is!

Stay tuned for next weeks CTotW! Again, we look forward to your recommendations so let us know!. We will be keeping an active archive here, which admittedly is a bit empty now. Comments of course are open on this post as well, let us know your opinion of the sites we choose! Got another similar recommendation, found it useful, didn't find it useful? Let us know in the comments below.

Cool Thing of the Week

blog comments powered by Disqus

Month List

Popular Comments