We’ve finally released a developer application for running games created with the Turbulenz Engine on Android. (The iOS version is just around the corner.) The purpose of this app is to let developers start getting their games in shape. This means reviewing screen resolution, touch input, payments via the Google Play Store and CPU / GPU performance. Make sure you check it out if you want to create HTML5 apps that work across all devices.
We continue to petition and work with platform owners to promote HTML5 applications as first classic citizens in their operating systems. Things are looking good on Tizen, Firefox OS, Chrome OS and hopefully the full Windows family, and we’re gradually getting there on Android, with Apple dragging along at the back with OS X and iOS. (Fingers crossed for iOS7.)
Check out the developer announcement on the Turbulenz Engine Users group for details on getting started.
Additionally, there is a README in the Turbulenz docs online.
Make sure you are a member of the Turbulenz Engine Users group to get access to the Android APK on the Google Play Store.
There are a few ways to get started with the open source Turbulenz Engine.
1. turbulenz_jslib repository
This version is great for browsing and prototyping applications with procedural content. However, this repo doesn’t come with any other tools or assets for building applications. This is no problem if you already have a set of tools that you want to connect with a Turbulenz powered runtime app.
2. turbulenz_engine repository
This is the main open source Turbulenz Engine repository on Github. This is where the Turbulenz Engine is publicly developed and contains everything required to create the Turbulenz SDK.
Additional tools and dependencies are required for building assets including shaders and models.
3. Turbulenz SDK releases
If you don’t want to track the development line or build the engine from source but would rather have a QA’d released SDK then you should check out the Turbulenz SDK releases. These are available to download from the Turbulenz developer service at hub.turbulenz.com.
Packaged installers are available for Windows, Mac OS X, and Linux. These installers have a limited set of dependencies but set up a full development environment. This environment can be integrated with your own game development environment. Details on using these SDKs are available in the main Turbulenz documentation.
Last week Microsoft released a preview of Windows 8.1 including a version of Internet Explorer 11 supporting WebGL. This is great news from Microsoft and immediately downloaded and installed the preview version in order to test the game engine running on IE11. Once the installation was complete the first thing we ran was the device initialization sample, and we got a couple of errors on the Console:
Not a great start, but lets look at the stats reported by the WebGL device:
The interesting bit is what is missing from the bottom, after “Extensions:”. Disappointingly IE11 does not support any WebGL extensions yet. This is unfortunate because some of them, for example the ones that provide support for compressed textures, are fundamental to reducing memory usage and improving performance.
Anyway, we pressed on and tried one of the less graphically demanding examples:
You may notice something missing, those cubes are supposed to have a nice crate texture on each face! There are a few reasons they don’t:
1. One of the errors reported by the console is “vertexAttribPointer: Enum SHORT is not currently supported”, you can see it at the bottom of the first image.
This particular example is storing the UV coordinates used for the texture as two 16 bit integers, the values are just 0 and 1 so using integers is a perfectly valid way of saving memory, the alternative is to use two 32 bit floating point values which would double the storage requirements for each UV component. This is not a big deal for a simple cube, but can become a more serious issue for big models. Reducing memory requirements is very important for games, even more so if your game is running on a browser on a mobile platform, so being able to use smaller vertex formats is a requirement for us.
2. Another error reported by the console is “bindAttribLocation: Method not currently supported”, you can see it in the middle of the first image.
Turbulenz relies heavily on using bindAttribLocation to assign vertex components from vertex buffers to their relevant input attribute on the vertex shader. We could use getAttribLocation to ask the vertex shader where it wants its inputs, but this would require late binding of vertex buffers and the update of attribute locations if the shader changes. So instead the Turbulenz engine uses bindAttribLocation to tell the shader where to get its inputs from, which allows us to bind the vertex buffer immediately and to only have to bind it once. This is important because the Turbulenz engine creates large vertex buffers that are shared between several static geometries, independent of whatever rendering technique they use, allowing us to avoid the memory overhead of creating multiple buffers and also reducing the number of state changes. This is part of what makes Turbulenz such a high-performance rendering engine.
Continuing with our experiments we tried the sample app, which is just a rotating duck, and got nothing on the screen. Why? Well, there were more errors reported on the console:
The first error reported is “bufferSubData: Method not currently supported”. The lack of support for this method is significant. As explained earlier, the Turbulenz game engine shares big vertex buffers between several static geometries in order to avoid memory overhead and state changes. In order to do that, vertex information needs to be submitted independently for each model using the method bufferSubData. One alternative would be to keep sharing but to upload all the vertex information at once, but this requires us to hold all the geometry in memory longer than we would like and is also not practical if the game is streaming in and out static geometry. The other alternative requires creating an individual vertex buffer per geometry, which is not acceptable because it will increase buffer overhead and require more state changes.
The other problem we hit with this sample was:
It seems the WebGL implementation on IE11 does not understand GLSL shaders with structure declarations - a perfectly valid language feature that is supported in other browsers. The only reason the first example we tried rendered anything to the screen was because we don’t always use structure declarations in our shaders, for simple programs it is just quicker to declare the varying values independently. Admittedly we were considering removing structure declarations from our shaders because they make the shader code bigger (a concern for us as we try to seriously reduce the amount of data a game needs to download in order to render anything on the screen) so we may rewrite our shaders to work with this version of IE11.
There were more things failing on other examples: triangle fan primitives are not supported, luminance only texture formats are not supported, full stencil support is missing, etc. And, we reproduced the same issues on different machines with different video cards from different manufactures.
Are we going to change our code to workaround the missing WebGL features on IE11? Not whilst it is in development and only a preview.
Some of the workarounds will require substantial changes to the engine, and they may impact performance significantly. This version of IE is clearly not final yet, and we’re keen to help Microsoft deliver a fully compliant implementation of WebGL that would make Internet Explorer 11 competitive with Google’s Chrome and Mozilla’s Firefox. Exciting times for WebGL and HTML5.
Quick note to let everyone in New York know (yes, everyone in New York - pass it on) that Duncan will be presenting details of the Turbulenz platform at the NYCoders meeting today at 7pm EDT, Wednesday 5th June.
For all the details checkout their post.
SDK 0.26.0 is the first SDK release since Turbulenz went open source and there are plenty of new features for devs to sink their teeth into.
Data Shares API
The Data Shares API is a new Turbulenz service that allows games to save information between users, that are online or offline. While the User Data API allows games to save information specific to that user, Data shares allow running games to save key-value pairs that other games can read. One application of this feature is to create turn-based games or share game generated content with other users when the original player is offline. See the Data Shares API for more details.
The Notifications API is a new Turbulenz service that allows games to send notifications to users. These notifications are akin to the short messages that users of Turbulenz receive informing them of site activity, such as badges achieved or scores beaten in leaderboards.
Games are now able to send instant or delayed messages to a user (including the current user), which will be received in real-time (online playing), as a site notification (online) or as an email (offline). They can be used to inform users of activity, such as “It’s your turn” or “Your base is under attack”.
When used in conjunction with the Data Shares API, developers can now write games that combine, turn-based online/offline play with real-time communication. The new Tic-tac-toe app demonstrates how the APIs can be combined. See the apps directory of the SDK/Github repository.
Rapid prototyping with Protolib
See the Protolib documentation to get started.
Local server upgraded
Part of providing the Notications and Data Shares APIs, the local server now has support for logging multiple users in at the same time. This allows games to test multiple users interacting on the same server, which is the same functionality provided on hub.turbulenz.com and turbulenz.com.
In addition to the open source changes to how the Turbulenz local server and tools are packaged, the deployment process has been improved, now remembering which developer was logged in when deploying and making the discover of previously deployed project versions easier.
Rendering performance improvements
This SDK includes additional performance improvements to the 3D renderers focussing on reducing the CPU cost preparing for rendering. There are also improvements to the 2D canvas implementation, confirming it as viable option for accelerated canvas 2D rendering. These improvements should benefit machines that were previously CPU limited.
- Various fixes for the viewer rendering.
- Addition fixes to the dae2json and obj2json importing.
- T1424 - Local does not remember the password when deploying a game from Local to Hub.
More details of these features and additional improvements can be found in the release notes.
The question we get asked more than any other is “does the Turbulenz Engine work on mobile?" Specifically how to use the open source Turbulenz Engine on Android and iOS.
The current answer ultimately reflects the limitations of the mobile operating systems and their associated browsers.
The Turbulenz Engine is designed and implemented with a modular architecture. Hence it is the game that defines which modules from the engine are required and used.
Some of the APIs the engine modules require are:
- Web Audio API
- Web Sockets
- Full Screen API
- Typed Arrays
- Pointer Lock
- High frequency timer
- Binary assets (XMLHttpRequest with “responseType” as “arraybuffer”)
There are two ways that Turbulenz games can run on mobile platforms:
1. Game runs in the browser:
For any browsers that don’t support WebGL, for example Safari on iOS, you can’t use the 3D and high performance 2D rendering APIs. Instead you should use the 2D canvas element and rendering APIs. However you can still use all the other features in the Turbulenz Engine, including the physics engine, animation framework and web services.
The only limiting factor is that Safari for iOS supports canvas 2D rendering but not WebGL. Hopefully future releases of iOS will include a complete WebGL implementation.
2. Game runs as an App:
We are developing a native client which provides both the 2D and 3D hardware accelerated infrastructure required to run games created with the Turbulenz Engine on mobile devices. This can be used in place of the browser to open and run game URLs. The games can be hosted anywhere online as long has they have been correctly built with the Turbulenz tools. Games using the Turbulenz native client will have access to all Turbulenz APIs.
This version of your HTML5 game can be distributed as a native app and can be published to the platform owners app store, including the Apple App Store, Google Play, and Amazon App Store. If the game uses the Turbulenz Store APIs the native app will automatically connect payment requests to the native payment service.
The native Turbulenz client may be thought of as a stop-gap until more mobile browsers improve their support for HTML5 and related APIs.
Forget to watch the Turbulenz getting started live stream? Remembered too late and joined halfway through? Had to take the dog for a walk?
No worries! The recording of the first (of hopefully many) Turbulenz Livestream events is now available for catch-up. You can find the video on:
The session included:
- Getting setup with the turbulenz_engine open source repository.
- A brief introduction to using the Turbulenz APIs.
- A step-by-step walk-through of building a game, combining 2D physics with 3D rendering.
- A demonstration of the example game on hub.turbulenz.com, playable from desktop and mobile.
Q&A with Ian & David from the Turbulenz development team.
The example game “Debris Dodger" created during the session has been made available on Github so you can try it for yourself. Just update to the latest open source version and follow the steps in the README.
Debris Dodge Github repo with all the code and assets to play with.
A few additional links to things we discussed:
- Denki Word Quest running as a native android app
- Debris Dodger running on mobile from hub.turbulenz.com
Any follow-up questions and feedback should be directed to the Turbulenz Engine Users Group.
We are holding a live webcast to introduce users to the open source Turbulenz Engine on Tuesday 21st May. It is free and anyone can join. You can receive email updates on the event by registering online. Whether you’re already using Turbulenz, working on HTML5 games or applications, investigating technologies for an upcoming game, or have a general interest in modern game technologies, this session is worth joining. You can even send us questions in advance on the event page here.
The agenda is:
- Getting set up with the Turbulenz HTML5 Engine
- An introduction to the main features and APIs
- Creating an HTML5 app
- Getting your app online
- Q&A with the Turbulenz development team
Time: Tuesday 21st May at 8am West Coast US / 4pm UK time / Midnight Japan time.
Location: Streamed live online at livestream
Duration: Presentation will last 1 hour. We are leaving an additional hour afterwards for Q&A.
We hope to see you there.
It’s been a really exciting week for us here at Turbulenz and we have been totally blown away by your response to our release of the Turbulenz HTML5 game engine under the MIT license.
It’s always nerve-wracking releasing something into the wild which is why we are so excited that our engine has been trending on GitHub with over 1200+ stars and 140+ forks. It’s great to see so many people trying out the engine, and we’ve even accepted our first pull request.
But it’s not just on GitHub that we have seen plenty of action. Articles on Develop, Gamesindustry.biz, Gamasutra and Gamesbeat have got people talking, with discussions on Slashdot and Hacker News. And we have been really excited about the buzz on Twitter - there have been over 1000 tweets and retweets talking about the open sourcing of the Turbulenz engine.
And it’s not just our open source engine that has been getting your love. Our friends at Wonderstruck knew they would probably get some attention when we made our announcement so they pulled out all the stops to get a new version of Polycraft ready for all our new visitors, including huge new gameplay elements like outposts and a whole range of new enemies. And it looks like all the hard work has paid off as we have had over 7000 new players. If you haven’t had a chance to try Polycraft yet, play it here.
So we just wanted to say a big “Thank You” for all your support and encouragement. But this is only the start for us. We need you to help us to keep on building the best HTML5 engine in the world. Whether you’re asking and answering questions on the engine users forum, reporting bugs and requesting new features, or just saying hi on twitter, we’d love to hear from you!
We’re excited to announce that we have released the Turbulenz HTML5 game engine as open source under the standard MIT license. The open source project is available on GitHub at https://github.com/turbulenz/turbulenz_engine.
You may have seen Turbulenz mentioned somewhere and wondered what it was. Turbulenz provides a game engine that delivers all the building blocks developers need to rapidly create high quality and hardware accelerated 2D and 3D games playable across mobiles, tablets and the web.
Polycraft by Wonderstruck
We initially proved this to ourselves by creating the service and engine capable of streaming and rendering the majority of Quake 4. This continues today to be a great test of the engine as it has evolved. You can see it demonstrated by our CTO David Galeano.
Today, the Turbulenz Engine powers the highest quality 2D and 3D HTML5 games online. If you want to see some examples we recommend looking at:
- The 2D arcade game Save the Day by Denki - watch the trailer - play the game now
- The 3D arcade strategy game Polycraft by Wonderstruck - play the development version now
- The real-time 4 way multiplayer shoot ’em up Score Rush by Xona - watch the trailer - play the game now
Save the Day from BAFTA-winning Denki
We have seen a monotonically increasing interest in the engine and SDK since it was first made publicly available.
If you want to take a look, the best place to start is the README which you can find on the Github project page and included in the source. This details how to set up a development environment and includes a short getting started guide on how to use the Turbulenz Engine APIs. From here we recommend going through the Getting Started guide and reviewing all the documentation online.
The engine is also available bundled in an easy to install SDK for Windows, Mac OS X and GNU/Linux. This might be an easier option if you’re looking for a packaged-up and fully QA’d snapshot of the engine. All future SDK releases will contain the open source engine with the associated MIT license. (Earlier versions of the SDK were released with a partially open license which has now been deprecated.) The bundled SDK is available from the Turbulenz developer service.
What Features Does the Open Source Turbulenz Engine Provide?
The Turbulenz Engine contains an extensive range of features and services for creating games. The engine was designed to be a complete Internet generation game engine. By this, we mean a game engine that was conceived, designed and implemented specifically for building games that are played via the Internet using web technologies, rather than as a native application on a console or PC. This is a single suite of technology that spans the client game application and remote game services.
The libraries contain solutions for all sensibly reusable game services, including: 2D and 3D graphics, 2D and 3D physics, 2D and 3D effects, sound, networking, user input, scene graphs, hierarchical animation, movie playback, resource management, server requests, a range of renderers, leaderboards, badges, payments, save game userdata, user profiles, game profiles, multiplayer, metrics, maths and numerous utilities.
The graphics engine is completely shader driven and hardware accelerated using WebGL. It has been implemented to allow games to efficiently dispatch their scenes. The engine comes with multiple renderers which can be selected depending on the features and performance of a user’s device, this includes, a deferred renderer, a forward renderer and a default renderer. There is also a highly efficient 2D renderer for efficiently dispatching huge numbers of sprites and effects.
The 2D and 3D physics engines are particularly powerful in comparison to the procedurally generated ports of currently available.
Why Are We Open Sourcing the Engine?
We’ve had a lot of interest in the Turbulenz Engine via our SDK packages and many of the people who try it out have praised the features and performance. However, two issues that have often come up are any sort of restrictive licensing and the ease of getting things started.
By releasing the Turbulenz Engine as open source under a standard liberal MIT license we hope to ease the adoption costs and ensure that people don’t feel in any way restricted by using the Engine.
What Are the Design Goals of the Turbulenz Engine?
The main design goals of the Turbulenz Engine are performance, modularity and customizability. Users of the engine should be able to build any kind of game without limitations, in an efficient manner and with an end product that performs optimally when loading and during play.
To achieve this target the Turbulenz team followed these rules when writing code:
- Users should be able to pick what they want and replace what they don’t.
- When possible new functionality should be orthogonal to existing one.
- Strict coding standards to keep code efficient.
- Keep memory allocations to minimum, reuse existing objects or arrays whenever possible, use scratch pads, combine multiple separate objects into a single one.
- Use most efficient storage for each data, Typed Arrays when possible.
- Reduce function calls when possible: write functions that handle arrays of objects instead of loops that make a function call per element, games rarely do a single thing to a single object.
- Be aware of performance differences between browsers.
- Profile often.
- No API should block waiting for a response from the server, avoid polling whenever possible, use callbacks or Promises, to notify of data availability.
- The target should be to make the game a simple dumb player of data, all functionality defined by simple data files.
Simple well documented file formats
- Define simple, easy to create asset formats that can trivially be connected to any tool chain.
- Design interfaces that can be implemented with different level of detail or quality settings in order to scale from mobile to desktops.
Power without control is nothing
- Make sure users can do exactly what they want, with a helper layer put on top if required, document performance implications at every level.
- The engine should keep going even if any type of asset fails to load. The application is able to provide sensible defaults for all asset types making it easier to stay productive and diagnose issues.
- Reduce amount of data to be downloaded, compress data efficiently.
- Use the browser cache efficiently, use unique file names based on content and tell the browser to cache forever.
- Strict coding standards to keep code readable, easy to maintain and debug.
- Write unit tests, samples and documentation for every new code path.
- This is a game engine, for games.
What Have We Made Available?
We’ve made three Git repositories available on GitHub:
Turbulenz Engine - https://github.com/turbulenz/turbulenz_engine
- Documentation of the libraries, APIs and tools
- Code samples demonstrating the engine APIs
- Application samples showing how a basic but complete game can be built
- Protolib high level prototyping libraries
Turbulenz Tools - https://github.com/turbulenz/turbulenz_tools
- Python tools for processing code and assets.
- Also available from PyPi as turbulenz_tools.
- A locally hosted Python development web server implementing the Turbulenz services APIs
- Tools for interacting with the Turbulenz Hub
- Also available from PyPi as turbulenz_local.
Want to Contribute?
We know there is a large and growing community interested in HTML5 game development and we hope that people will find this project an empowering contribution to game and Internet technology domains. Now that the project is fully available as open source and easily accessible via GitHub all contributions are gladly welcomed. Please send the project a pull request or post a git diff patch on the Turbulenz Engine google group.
Please Help Us Spread the Word
Please help spread the word to your friends and followers by sharing this announcement online. We want to make sure that anyone thinking about making a game with HTML5 is aware of Turbulenz as a free and open source solution that comes packed with high performance features.
Sign up for the free WebCast on 21st of May at 9am PST / 5pm BST. This will include an introduction to the technology, show you how to get started, and leave time for Q&A.
Any questions or ideas about the Turbulenz Engine, HTML5 games or anything else, please get in touch.
SDK 0.25.1 is a minor update to SDK 0.25.0 and contains a few fixes and updated documentation. If you’ve just updated to 0.25.0 this update should be a breeze.
TypeScript in Focus
There’s now a whole new section in the “Getting Started Guide" that goes into depth about how to build against Turbulenz TypeScript modules. With a walkthrough example and commands that you can use with your own build system. You should be up and running in no time. Future developments will include a standardised build structure, so watch this space.
More and more COLLADA updates
We’re continuously making updates to our dae2json tool; supporting additional features and making improvements. There’s so much going on we can get them out fast enough. See the detailed release notes to find out what’s new.
A fistful of fixes
Fixes in this release include a bug in the soundDevice.listenerGain property on canvas and the correction of a few missing files in the SDK. See the release notes for details.
Type check… one, two - TypeScript support rocks Turbulenz
You don’t need to use TypeScript to use Turbulenz, but we now provide type definitions for all of our libraries, which is just one good reason to try it out!
The SDK now includes tslib and jslib (generated from tslib) as well as TypeScript versions of apps and samples.
- Existing developers: Use the standard jslib as usual. If you have your own modifications, compare your code to the tslib version which has a similar layout to previous jslib releases. Investigate whether TypeScript would help you with your project.
- New developers: Start your project with either of tslib or jslib depending on preference.
interesting blog article of his findings during developmentOur TypeScript guru Duncan has written an . Definitely worth a read.
The GraphicsDevice now supports the creation of video objects that can render video data as a texture. This feature can be used for cut-sequences and other media playback in the game engine. The video sample shows how this can be used in conjunction with audio to playback a video. Check graphicsDevice.isSupported to find out if the browser supports WebM or MP4 video formats.
Ideal for resetting the state of physics simulations.
Clean-up outstanding API requests
A new destroy function has been added to the RequestHandler to help clean-up outstanding request callbacks and stop them from accessing invalid state on destruction. Make sure to add this to your existing shutdown code.
UV transformation support for the renderers
Updates for dae2json
dae2json, the COLLADA import tools for models, animations, materials and more has had a number of bug fixes and improvements. It has better support for various exporters from Maya/Max to Sketchup. Notable is the addition of the NvTriStrip command which is a recommended step for optimising meshes.
- T152 - An issue where deploygame tool was unable to upload to the Hub.
- A rounding error for certain values in storeitems.yaml that caused an error on the Hub.
- Various fixes to dae2json to avoid crashing and give more warnings for incorrect/unsupported files.
- Fixed an issue where JSProfiling was unable to generate array information in the latest Chrome.
The SDK is available to download from the developer service at hub.turbulenz.com.