I’ve been asked quite a lot how we organize our projects. I tried to explain the best I could and today I was going to write a huge blog post about it. Instead of that, I’ve put 9 minutes of video that show how and why Bruce Ali is organized the way it is.
Today was FANTASTIC! A super productive rainy Thursday brought the rewrite of the blit core. Marco complained he can’t see anything… well… debug and tracing is all I can offer right now since textures and blit entities are not working yet, but at this pace a lot of goodies will appear soon.
To celebrate the sensation of being (finally) at full speed, I’ll prepare a sweet thing tomorrow that I hope will be good for new developers and bring a lot of discussion for more experienced ones. Stay tuned!
So I coded and recoded, tested and retested a Object Pool class with a high degree of success and frustration. I wrote and tested three different pool managers, here’s the story…
Objective: Centralized management of pools
This one was easy. There is a PoolManager that has a static method to get a pool for a certain class. If the pool for that class does not exist, it is created, if it does, it is returned. Objective achieved.
Objective: Lightweight pools
I don’t need pools to be amazingly complex, I just need the pools to get the job done, which is: be faster at getting new objects at the expense of memory. That didn’t go very well. The pools were lightweight alright, but I was not able to make it any faster than creating a objective directly.
This lead to the three versions of the pool manager and still the best performance gain is below 5% for any Bold Pixel entity. I was so frustrated, but then I saw the light!
Not my fault really
After testing and more testing I had a epiphany! What if Bold Pixel’s entities are simply too light to make pooling worth. It would not be something I’d consider. It really never crossed my mind that a instancing a object could be faster than getting it from a linked list kind of pool, but it is and the classes I was dealing with are somewhat heavy considering the inheritance and and composition of several.
The highest gain I got was 8ms in 1000 object. Creating 1000 objects took 54ms and getting 1000 objects from the object pool took 46ms.
The unexpected success
So either my classes are very light or flash behaves rather poorly in managing this. So I tested against some movie clip I had around. Creating 1000 movie clips took 102ms, almost doubling the worst case scenario.
Not only I was happy to note that my classes are lightweight, both pool manager and entity type classes, but I also proved that getting movie clips would make a difference.
Conclusion
I’m not happy with the pool manager for now, but I’ll work on it some other day. It gets the job done, but the objects I really wanted to make a better use of pooling are the ones that problably will have less impact.
If I regret anything in this bits of code is that I over engineered it at first. Tomorrow blit engine!
Last monday was an important day for us. While Marco and Pedro were working on the final systems of Hajime, I had a nice day with Pre.
Pre is a great coder and a great example of a entrepreneur. We met him and two friends of his when they launched Orion’s Belt, a MMO browser game. The game got some visibility and won a some accolades and it resulted in getting the three of them contracted by a company to proceed with the game development of version 2. Marco did the graphics for the game’s 2nd version already as a Vortix Games gig.
I think everyone felt that sooner or later something would happen that involved people from Vortix and Orion’s Belt. It just did. Pre decided to make a big change in his life and pursue his own goals and business and started a project with us that has nothing to do with anything that anyone has seen from us. It is highly inspirational and motivational to find people that embrace risk, just like me, Marco and Diogo did and go for it. It is even more motivational because what we are trying to achieve is the original plan that brought Vortix Games together in the first place.
So give your warm welcome to Pre and wish him and us luck for the project ahead of us.
Good evening traveler! Vlad here to serve you… and by the way this is our 100th post!
I was just opening the blog admin panel to write this post as someone no need being *cough* Rasmus *cough* mentioned that we were not updating Bruce Ali’s journal… well that is true and the reason for it is that this week was still slow unfortunately but for wonderful reasons, most of them at least.
Hajime is now on Flash Game License for developer viewing only currently which is an important milestone. All objectives related to the Nape wrapper are met and now it’s time to solve the bliting part in order to have gameplay.
Looking back I feel I’m a week late, but with stuff I would need in some weeks already done, so maybe I feel we’re late, but it will payoff later. Right now I don’t know… still… while a lot of people were complaining about their jobs I was coding a box that explodes when it hits the floor… this has to be the best job ever!