But not everything were sunshine and rainbows. The performance varied in different platforms and browsers. Some features like sound and video seemed to be supported in many different ways and formats depending on the browser developer. But most importantly, specially for Ludei, mobile devices had really poor performance while running simple 2D canvas based games. The rendering was done by software. Then, our tech department saw that CSS3 has 3D transformations and that many browsers (including Apple’s iOS Safari) supported these features using hardware acceleration. It was a great opportunity to try our game engine’s abstraction layer (Our development team is a true believer in abstraction when addressing software design) and see if we were able to make a transparent HTML5 rendering context that was able to use Canvas or CSS3 whenever available. It worked. But CSS3 didn’t turn out to be as flexible as it could seem at a first glance and although we added canvas and CSS3 rendering support to our game engine, the latter showed up as a non viable option for many animation needs in games. Moreover, only Apple mobile web browsers offered hardware acceleration, so our cross platform dream could still not be true.
Having our game engine rendering abstraction, we started to look at WebGL. After solving many difficulties related to this new web feature, we end up with a full game engine that supports rendering abstraction for Canvas, WebGL and CSS3. It worked like a charm in desktop web browsers, but mobile devices were a different story. We concluded that Canvas was the best option (at least nowadays) for our games in these platforms, as CSS3 had many problems and webGL support is nearly inexistent in mobile web browsers. But the performance was still really poor for real time animation and videogames. This was the moment when Ludei’s technology department started to look for an alternative.
By that time, we already had our native multi-platform framework up and running, which by the way was called Cocoon. Once again, in our pursuit of abstraction, we developed most of our code in C/C++ (around 80%) with some parts in Objective-C for iOS and some parts in Java for Android (around 20%). It means that most of our code base is multiplatform. We also designed it as a service oriented framework that allowed us to include new features easily:
- Ad network integration. There are multiple services that allows integration with some of the main ad networks in both iOS and Android platforms to show banner, interstitial and video ads.
- In App Purchases (IAP). There are services for both iOS and Android IAP support.
- Analytics. Cocoon supports app tracking via third party SDKs or even server to server management.
- Multiplayer infrastructure. We already have both GameCenter support for iOS devices and our own backend infrastructure.
- Online resource update. Our applications can update their resources (images, sounds, texts, configuration files) online without having to create a new app version.
- Access to device hardware specific features like the camera and the GPS.
We are currently working hard to provide new interesting features like:
- A cloud based compiling system. Any developer that has tried the CocoonJS launcher will be able to get both an iOS and/or an Android final binaries that will be prepared to be uploaded to the app store and the android market.
- More Canvas primitives. Although we think that the most commonly used Canvas primitives are supported right now by CocoonJS, we are trying to add as many new rendering primitives as possible.
- A brand new multiplayer game that will demonstrate the true cross platform capabilities that CocoonJS offers. It will be playable from a desktop web browser, from an iOS device and an Android device, all using exactly the same code base.
- Multiplayer online infrastructure. We already have a Game Center extension that allows multiplayer capabilities for iOS applications. We are working on providing a full online multiplayer experience.