Category Archives: AIR on Android

At the NASSCOM Game Developers Conference

ngdc stage

Another year of the NASSCOM Game Developer’s Conference, India has ended. Another year with a better turnout than the last! What a way to celebrate the gaming community of India.

The NASSCOM Game Developer’s Conference (NGDC as we call it) took place on the 15th and 16th of November 2013 at the JW Marriott at Pune. Located right in the hub of the Pune university area, the location is better connected than the earlier one in Pune city and probably encouraged more to attend the event.

The conference had 3 simultaneous tracks focused on Indies, Business and Technology. There were also workshops on Unity development, Game Design, Mentorship by industry experts, BYOG (Build Your Own Game) and Nasscom Gaming Awards.

I went to the event not just as a delegate but also as a speaker. As delegate I attended a lot of the indie talks. My favorite was the talk by one of the founders of Simogo. With just two people in their company, they have done some amazing games. Their postmortems were precise to each game but it was great to see their unique game mechanics.

A workshop for Unity got me introduced to working with 2D on the new Unity 4.3 platform.

Another good talk was by Martine Spaans from Gramble.com on Best Practices for Publishing Mobile Games in the Western Market. While some of the points were known from the best practices materials available online, the presentation was good with points from personal experience.

Interesting it was to attend the Crowdfunding and Kickstarter session by Pyrodactyl Games because they are a success story on Kickstarter from India for their game Unrest.

I spoke about Adobe AIR games on Multiple platforms. The presentation was basics of Adobe AIR but there was so much to share when talking it – Tools, Scout, Stage 3D, Starling, Native Extensions, Feathers UI, Away3D and it just goes on. I hope the audience (a lot of them non AIR developers) could understand it well.

The best the conference had to offer was meeting old friends, colleagues, twitter friends and networking with new people. Waiting for the event to repeat the success next year!

Mariam

Build a URLRequest with headers of multipart/form-data content type with ActionScript

BitmapData

 

 

 

 

 

 

 

Posting an image on a platform which requires it to be of a ‘multipart/form-data’ content type is different from posting a URL link of an image or sending an image as binary data.

For example, both Flickr and Facebook APIs require the ‘multipart/form-data’ type for uploading images and in the latter case I never realized it because there was an existing Facebook API which was doing the work behind the scenes.

Incase of Facebook, if you are using the Facebook Actionscript3 SDK for posting images to your own wall, you are required to convert your image into a ByteArray and then use the API to POST the image. The classes that handle this are the FacebookRequest.as, AbstractFacebookRequest.as and PostRequest.as, but as a developer you may never know of these classes or use them directly.

For instance the code below captures a Movieclip from the stage as a bitmap, encodes it as a PNG and then uploads it to your Facebook wall using the Facebook Actionscript3 SDK.

In my case I did not have any SDK or classes to work with this particular content type. That’s when I read about the UploadPostHelper.as class written by Jonathan Marston. It is an old class written in 2007 so it needed minor modifications to work with today, but nonetheless, it served the purpose of building a POST request with properly formatted headers required by the server to interpret the content of multipart/form-data type.
Assuming if I had to rewrite the code to post an image to Facebook without an SDK, the code below would work just as well.

Write to me if you want the UploadPostHelper.as class with the changes I’ve made to it or have suggestions to work with image data.

Mariam

Box2D for Flash Games – Book Review

Box2D For Flash Games

Box2D is a highly popular physics engine. Its popularity lies not only in it being a free open source engine, but also because it has many features to produce realistic physics effects in games. It has also been used by many popular games across the mobile and web.

Flash is one of the supported platforms, therefore this port of Box2D has become almost a priority for many game developers wanting to use realistic physics with AS3. The book “Box2D for Flash Games” written by Emanuele Feronato is therefore a great resource for understanding of the Box2D physics concepts and getting your hands dirty with actual game development.

The book dive starts with basic examples without going too deep into the engine theory. Every new line of code added to the examples thereafter is further explained in detail. Concepts such as friction, density, primitive and complex body types, shapes and collisons are all covered . The chapters then take a step by step approach towards developing actual game levels from popular games such as Totem Destroyer and Angry Birds.

I personally follow Emanuele Feronato blog and know that he comes with tremendous experience in gaming. He contributes to the community with his gaming articles and this book only lets him share more refined and in depth information with his readers.

 

The story of Adobe AIR and game development

Will Flash ever be able to get rid of it’s tag of being a quick prototype and animation tool? In India where we have a large developer base working on small games and animations for the web, the stereotype that a lot of people hold about Flash will probably always stay true.

Whenever the word Flash appears, people expect magic and quick turnaround times with development. At such times, the fact that “Flash” is going to be used for a more a sophisticated development on limited memory devices is completely ignored.

Whenever we begin work on a game on iOS or Android, my first suggestion is that if technology is not a restriction, we can provide game development services using the Adobe AIR platform. Most of the times there is never an argument on that because we are trusted to know our work well and deliver projects according to the brief given to us irrespective of the framework or tools.

The trouble comes when I explain what Adobe AIR really is. The fact is that Adobe AIR is a cross platform runtime using Flash and AS3 to write applications across platforms. But on hearing the word “Flash”, there is an instant expectation of quick results even for complex games.

So I’m sharing a list of of points that I felt kept coming up during AIR development on mobile/tablet game.

  • Development with AIR may be familiar ground because of AS3, but the development workflow is the same as with other technologies, especially with good OOPs practices.
  • There are plenty of frameworks available which provide support to Adobe AIR to enhance game development. A developer who wants to give the best to the project considers the time he/she will be spending on including those frameworks in the game.
  • Development of game logic or controls is not about copy pasting code from different places. Each game logic has its flow and limitations which cannot be solved by existing code (unless if it is a port of a game owned by the developer).
  • Mobiles have limited memory. There is a possibility of the game taking up too much runtime memory thus leading to crashes and low frame rate. Optimization of code and graphics is top priority when developing for non-web platforms.
  • Sprite sheets, no matter how much fun they may be to work with, are not easy for replacing the graphics in a game.
  • Compilation of game for devices take time. The workflow of deploying and debugging a game on devices is a time consuming process.
  • Comparison to an existing game is fine, but assuming that the game could have been developed in 2 days and wanting the same time frame for a new game development is an unheard story.
  • Any existing game code of a web game cannot be picked and pushed on Adobe AIR. If the game was developed using AS2, the process of converting the code to AS3 is tedious. What’s even more tedious is optimizing badly written code.

I’m ranting about the way game development with AIR is thought of by some people in India and it really saddens me to think they take it for granted. I know this will change over time, but till then we have to bear the brunt and keep educating people about it.

Mariam

Working with Debug Mode in Starling with Box2D – AS3

I recently started work on a Box2D game project using Starling, and one of my concerns was getting the debug mode to display correctly.

Box2D is a very popular physics engine. It has a debug mode which draws shape outlines, defines center of mass and shows joint connectivity, all very useful while debugging shapes behavior in a physics world. Debug mode is also very useful during prototyping when artistic graphics are not ready. Box2D has its own API but still uses native Flash objects and events.

Starling on the other hand is a game framework developed on top of the Stage3D APIs which helps write fast GPU accelerated games without having to access the Stage3D APIs. The Starling API is very similar to native Flash AS3.

Once a Starling stage instance is created, all display objects subsequently become part of this core Starling instance.
Since Box2D uses native Flash Sprite, the best way to work with Starling is to add a native Flash sprite on top of the Starling stage instance. I’ve given a quick example of how this will work in the example below –

The PlayGame Class is where the Starling framework is initialized. Within the PlayGame class, the Box2D debug sprite instance is defined. The Box2D debug Sprite instance is a native Flash and not a Starling class.

The Box2D class

Flash vs Unity vs HTML5 at Nasscom GDC

The Nasscom GDC 2011 ended in Pune yesterday making it one of the well attended events in India. Since we don’t have many conferences like these happening here, it was great seeing this one unfold connecting the Indian gaming community on a single platform. It was also encouraging to see gaming now being accepted as an industry with students taking it up as a career option – something which did not exist some years back.

The 2 days of the event had back-to-back sessions covering various aspects of the state of the gaming industry, gaming platforms and technologies and sessions for budding entrepreneurs.

I was invited as a part of a panel discussion covering Flash vs Unity vs HTML5 and it was a fairly well attended session (we had 2 very competitive sessions running parallelly so a well attended session is a compliment!). It was great to see that most of the audience were into Flash development at some level and keen to know what the panel had to say about the three most spoken about technologies in the recent times. The panel came with their expertise and spoke about the strengths of the platform they specialized in.

HTML5 is a platform that Zynga believes will be the future with social games. They are already looking into it; their Words with Friends being a classic example of a successful HTML5 social game going cross platform.

Cha Yo Wo on the other hand felt that HTML5 has it’s disadvantages and is better suited for enterprise applications rather than game development, especially when getting it across multiple platforms. They had some good talk to share about their engine allowing easy porting of code across different mobile platforms.

Glu Mobile belives in Unity and had some good points to share about using the platform to develop freemium games.

I spoke about my experience of working with Flash on different platforms, specifically devices. My thoughts were that Flash developers have the advantage of taking their ideas to multiple mobile platforms through the Adobe AIR runtime, but that can come with some limitations. The native platform for devices offer more polished APIs than AIR thus giving it an edge over Adobe AIR. With the introduction of native extensions, Adobe AIR can open up better development options but that will only be known in time.

However having said that, HTML5 is an new standard for the web that developers can be excited about, especially since Apple has been talking about it for a very long time, Adobe is investing heavily in the tools, and companies like Zynga believe that they can push the envelope of online social gaming with it.

The consensus was that a developer should never be limited with an idea because a technology is known and comfortable to work with, instead choose tools and platforms that best help bring the idea to life.

Flash vs Unity vs HTML5 Panel at Nasscom GDC

Mariam

Flash Facebook Cookbook Review

Facebook IS building the social web! It has more than 800 million active users and connects more than 500 million users monthly on its Facebook Platform through devices, apps and websites (source Facebook Statistics).

With such a huge demand for content on the Facebook Platform, the requirement for developers has also grown, thus leading to more learning material being available; material especially related to tips, best practices and simple guides to help one progress with the platform.

One of the newest resources for Facebook Developers is – the Flash Facebook Cookbook by James Ford. I received a copy of this book and decided to write a short review for it while reading it.

The Flash Facebook Cookbook contains around 60+ recipes for integrating Flash applications with the Graph API and Facebook. The recipes are simple and start with the basic explanation of Facebook and Flash integration. It graduates to moderate and complex examples such as News Feeds, working with the photo albums, uploading pictures, working with events and integrating HTML5 geolocation capabilities etc.

The book does not expect the developer to know the Facebook platform, but does expect some knowledge of working with Flash Builder and the Flex framework. It uses the Facebook Actionscript 3 SDK available from Github. Apparently this version is supposed to be more community driven than the official Facebook Actionscript SDK supported by Adobe and Facebook on the Google Code repository. I’ve always worked with the official version of the SDK, so I didn’t try using the Github version with the receipes.

I think it is fair to say that the book is a good resource for Facebook development on the Flash platform for the web and desktop. It does not cover the mobile platform, although a refined developer will be able to adapt the knowledge gained from this book to multiple Flash supported platforms.

Mariam

 

Adobe AIR 2.6 for Android

Adobe recently announced the availability of Adobe AIR 2.6 for Android smartphones and tablets. AIR 2.6 for Android adds support for Android 3.0 and the latest Android tablet devices, including the Motorola Xoom, as well as improvements to performance and GPU-based rendering, updated Android gesture support, and improved handling of HTML content within AIR apps.

AIR 2.6 for Android can be downloaded from the Android Marketplace and is available on devices running:

  • Android 2.2 (Froyo)
  • Android 2.3 (Gingerbread)
  • Android 3.0 (Honeycomb)

A list of mobile devices that meet the AIR system requirements can be found at http://www.adobe.com/flashplatform/certified_devices/.

AIR 2.6 for Android have performance improvements which include:

  • Up to 20% faster scrolling performance
  • H.264 video decoding at 30fps
  • GPU-based animation and games at up to 50FPS

AIR 2.6 for Android also have functional improvements which include:

  • Support for the latest Android system gestures
  • Bitmap Capture for StageWebView, which provides tighter visual integration between Flash and HTML content
  • Asynchronous Bitmap Decoding, which improves the performance of transitions in image-intensive applications

Applications developed with the Adobe AIR 2.5 SDK are compatible with the Adobe AIR 2.6 runtime.  Adobe is on target to deliver the AIR 2.6 SDK and desktop runtime before the 2nd half of 2011.

Mariam