Memory leaks in Adobe AIR Mobile / AS3 project

As many Adobe Flash / AIR / AS3 projects we have been using Event Dispatcher. This concept seemed to be too uncontrollable and lacking of many wanted information. Doubts about garbage collector made us to recreate the idea to take more of control and information about event listeners.

Keywords: Garbage Collector Which Sucks, Event Dispatcher, Event Bus, Event Listener, Object Pool, Disposable Objects

→ Continue reading

Time update issues with Keyframe-based animation

Some time ago I joined to some project developed since 3 months before by a 3-4 person team. After next 4 months I made a refactor request to modify whole engine and game to make game frame update based on the time, rather than device power. Yeah, there was a constant constraint set – maximum 30 Frames Per Second.

Many of world-existing mobile devices couldn’t achieve those constant 30 FPS-es. On the other side some devices could show 60 without a problem but couldn’t because of constraint.  It seemed crucial to me to change that. I have seen a game in previous company where 60 FPS were desired and some devices didn’t make 30-40. Those games felt totally too slow.

I was developing a whole animation system then but I’d like to describe one element of it all – keyframe-based animation which was a huge part, actually most crucial. I tried to look for solutions, even tried to look into Spine (which is a great software, I recommend it!) libgdx “runtime” which is open-sourced. Unfortunately, our needs were too wide.

→ Continue reading

Adobe AIR trick: Faster file loading on development machine

I had pretty weak company computer in my recent job and also pretty old rubbish Windows installation. Because of that, duration of loading our Adobe AIR game was about 14 seconds. Colleagues had better times, like 11 seconds. I was curious if I could make it faster.

Every change in code made whole application recompile, restart and load again. I disliked it more and more, then a simple idea came to my mind:

if you don’t want to waste time on loading every time, then load it once!

Actually, why not. Easier said than done, right? Load whole data into RAM in another application and then send it through sockets to the application.

So I wrote simple application in C# which reads all files (graphics, sounds, etc.). I have also added new option of loading data to the game – through sockets. Result – came down from 14 seconds to 7 seconds! I could have done it earlier.