WebGL is not ready yet

I’ve been exploring WebGL for game development. So far, there are many things that I like. I love the fact that you don’t have to compile anything. Edit your source code, open it on a browser, and click refresh! You can even debug your code directly on the browser (I <3 Chrome)!

If you know Away3D, you might going to like Three.js. Three.js to WebGL is just like Away3D to Stage3D: easy to use, readable example codes, and has some high level functions for animations, particles, and models loading.

Everything sounds perfect, right? Unfortunately, when it comes to mobile and tablet support, WebGL is a big disappointment.

There is NO support for WebGL on mobile browser and tablet. If you check on caniuse.com, there is no WebGL on Android Browser, Chrome for Android, Firefox for mobile, nor the iOS Safari. Not even for the latest versions 😐

I’ve tried FireFox Beta & Dolphin Beta for Android, both claim to have WebGL support. Firefox displayed nothing while Dolphin only managed to show rotating globe with less than 1 frame per seconds. FYI, I tested this using my demo on my Galaxy S with Android 2.3.

Same problem with HTML5 Canvas. Although it is has better support than WebGL, the performance suffers a lot on mobile/tablet devices. I played some HTML5 games and sometimes the framerate drops to 5 fps. It could be the hardware or browser problem since the games run smoothly on iPhone4S/iPad3, or maybe it’s just the common problem of HTML5 games?

Sometimes I wonder, what’s the point of having your game in WebGL if it’s only available for desktop browser. You could’ve done it using Stage3D. Even better, with the help of Adobe AIR, you can compile the same source code and have your game running on mobile and tablet, either it’s Android or iOS.

Don’t get me wrong, I don’t hate HTML5. I do believe HTML5 and WebGL could be the future of web gaming. It’s just that it’s too much hyped but not ready for the present.

Is it useless to learn HTML5? Definitlely not! I can say that learning JavaScript makes me a better ActionScript programmer. How? I’ll write more detailed post about this one 😉

Stay tuned!

Re-learning Javascript

Lately, I’ve been re-learning Javascript.

Back then in 2004, I used to use Javascript for doing some DHTML stuff (popups, DOM manipulation, …). Nowadays, people start using JavaScript in more structure way to avoid spaghetti code. So I learn how to use some MVC frameworks (like backbone.js or ember.js) and also make myself familiar with JQuery.

Here are some wip learning projects on my GitHub:

    • backbone-cellar: Forked from Coenraet’s Backbone tutorial. I implement Node.JS for the backend support.
    • Alaycator, a simple bookmarklet for converting any website into alay, some kind of Indonesian leetspeak which is popular among teenies 😀
    • todotodo-bootstrap: A simple todo list webapp using Backbone, Require.JS, and Twitter Bootstrap for the UI. Supports mobile and desktop, and stores the data on local database. Contains simple Node.JS script for testing on webserver. I plan to make the JQuery Mobile version of this, stay tuned!

I still think that ActionScript, as a language, is still much better than JavaScript. But the thing is, ever since HTML5 got its hype, JavaScript  has gained LOTS of momentum. People get really excited about it and build amazing things using JavaScript, even on server side.

There are lots of open source projects; people trying to contribute for making better tools or libraries, and all of these grow so fast. Even some Adobe Flex evangelists start promoting JavaScript and HTML5.

At certain point, unless Adobe do something, JavaScript will catchup and will be able to do anything that Flash can do. Hey, maybe that’s not a bad thing 😉

I believe Flash will not be dead soon and will focus more on what its best: High performance and rich multimedia web/mobile app, including games. I’m not saying that all of these things cannot be done by JavaScript but right now, I still think Flash performance is still the best.

If you want to learn JavaScript the ‘modern’ way, here are some suggestions:

  • Douglas Crockford’s JavaScript: The Good Parts. This is a must read! I find this book helps me to switch my mindset to JavaScript specific things like object/prototype, function closure, the bad parts, and also tips & tricks to avoid the bad parts which make your code more structured 😉
  • Addy Osmani’s Essential JavaScript Design Pattern. This book is available for free on his GitHub project. This book give some examples how to build more modular and structured JavaScript development.
  • Addy Osmani’s Backbone Fundamentals. Another free book from Addy Osmani, if you want to develop structured, large, and scalable webapp using Backbone.

Pilot Cat: Game Teaser on Android

Teaser for my next game, this time it’s on my Samsung Galaxy S

Pilot Cat Teaser on Android

Pilot Cat Teaser on Android

It runs pretty well, around 30/30 FPS 🙂

I didn’t install the Adobe AIR 3.2 Release Candidate on my phone since the released version will be out soon. So I made the APK file with Air captive runtime, which means the package includes the AIR runtime inside your app.

I use the latest Away3D 4.0 but I had problem during compilation. I got a strange error message with depthAndStencil. Luckily, someone had the same problem with me and post the solution on Away3D forum.

Stay tune!

Hiding List Item

Note: This article is about programming tip for Adobe Flex 😉

ItemRenderer is a great feature to render List or DataGroup items. All items wil be rendered and if you want to remove an item from list, then you have to delete it. But what if you don’t want to remove the item from the list but you don’t want it to be displayed?

I couldn’t find any direct way to do this. I tried to Google this but found nothing related so I decided to make some experiments. After several times failing, I found out that you can ‘hide’ an item on DataGroup/List from being rendered by using ItemRendererFunction and an empty Item Renderer (renderer with height=0).

Click more if you want to read the details on how I did it. As usual, you can see the demo and download the source code below 😉

Continue reading

Flash/Flex: Keep Calm and Carry On

source: Wikipedia

Keep calm and carry on. That was NOT my reaction when I read Adobe news about Flash Player for mobile. And then came another bad news about Flex SDK on the following day.

It was difficult for me. I was sad and a bit broken hearted. It’s even harder if you are surrounded by Flash-haters. It take times for me to recover. But this makes me realize that how much I (and probably other programmers) really love Flash platform.

I started playing with Flash since it was Flash 5. Then came Flash MX 2004 with ActionScript 2.0, and then AS3.0 which I like most. I’ve tried many things like JavaScript & even VBScript, not to mention other languages such as Pascal, C/C++, C#. After a quite long journey, I find Flash/Flex + AS3.0 fits me for making games.

Technology keeps on changing and getting better. Unfortunately, HTML5 isn’t ready and mature yet for game development. There are many things HTML5 has to catch up with. Don’t get me wrong, I think HTML5 has potential. In fact, I recommend you to start learning things like WebGL or trying Javascript-based frameworks.

But despite what people say, I think Flash will NOT die in the next 2-3 years. In fact, if you’re a game developer, this is the best time to use Flash. Finally Adobe starts focusing more in game development. There will be many exciting features ahead. Stage3D is still new and we haven’t seen the best things out of it yet. Molehill2, Starling/ND2D, concurrency, Flash Player 12, fantastics Flash-based 3D or game engines, and many more!

It’s also too early to say that this is the end of Flex. Spoon foundation haven’t start something big yet but I’d like to be optimist. By giving Flex framework governance to the open source foundation, Flex future and roadmap can be deciced independently from Adobe’s business or political agenda 😉 Isn’t that great?

So don’t panic, don’t rush. We stil have enough time, either to switch to HTML/JS/CSS, finish your Flash-based game engine, or do other stuff. No one knows what the future will be. Take your time for getting angry or sad, but after that, clear your head and keep your chin up. It might take 2 years (or even more) until HTML5 is good enough and able to catch up everything that Flash can do TODAY. Meanwhile, Flash is still here and keeps evolving.

So carry on, let’s code better Flash games or Flex RIA 😉