Eve DevBlog 32: Pixel Perfect


Well, I have a screenshot…


Now, the particle effects look a lot better here, and I wish I could claim that that was the product of a week of fruitful labors, but in fact that took about an hour or two the day after the last DevBlog to get working. No, in point of fact, this week has been spent largely in reworking more-or-less functional classes to make them better, more optimized, more flexible, etcetera. The reason for this you can see in the upper left corner: 43 is the current framerate with the particle effects you see there, which is well below my stable 60fps target.

This is interesting work, this is challenging work, this is rewarding work– and it makes for lousy screenshots since, most of the time, it means I’m refactoring classes and can’t even build the program. Sigh.

So what is my actual goal with all of this refactoring, you might ask?

I’m working on a toolset of graphical classes which will be highly flexible and efficient. Using these, rather than rotating images, scaling, and rendering them each frame using Flash/AIR’s software renderer, I’m going to be storing each rotation and scale as a cached image which I can then draw using Flash/AIR’s incredibly fast copyPixels direct blitting method. This also means that I’ll be able to use the techniques that I was using on my level details to apply depth of field and other special effects to my particle effects without huge performance penalties. It will take a TON of memory to do all the caching, but frankly since, as I understand it, I have about a gig to work with before Flash gets wonky and it’s a 2d game where all of the assets that could be on-screen at once are unlikely to add up to more than a hundred megs, I don’t think that will be an issue.

The stuff I’m working on now is actually generally useful enough to anyone working with Bitmaps in Flash/AIR that I’m strongly considering releasing it as an open-source thing. It will probably take a fair bit more engineering to bring it up to professional release standards, and I need to do a ton of commenting and code documentation, but I’m proud of the work I’ve done here and I think some other people may find it useful.

Anyway, continuing on, I think I’ll have this new work re-integrated into my level detail class today, and after that I can get back to the particle effects and get them operational in this new system. At this point I’ll be basically where I was a week ago in many ways, but in a much stronger position moving forward, with a robust bitmap toolset to use for future effects.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: