[AS3] New Library: Blitting Engine + more. (soon to be open source)

13 posts

Flag Post

i have this lib. it will be open sourced and githubbed when i find a name for it.

www.fileden.com/files/2007/1/31/717072/td01/game.swf

it supports blitting, waypoints, tilemaps, mouse, multiple cameras, movement interpolation, automatic 8 way objects, and will handle pixel perfect collisions.

all the graphics of this demo are obviously placeholders.

the primary objective of this library is to minimize the impact of the garbage collector on performance, so everything is pooled and every object is recycled.

let me know if you try it, and any name suggestion will be well received!

thanks!

 
Flag Post

Looks pretty good. I can’t wait to see the source.

EDIT Renamed thread title to something more interesting.

 
Flag Post

The demo doesn’t really show much. Give us some kind of info to see how the performance is.

 
Flag Post

How about naming the library “Flitter”? (Flash runs on frames, and it’s a blitting engine. Also the verb ‘to flit’ means ‘to move swiftly and lightly’.)

 
Flag Post

thanks for the tittle change!

and thanks for the name suggestion and the feedback! i like the name jasonjie88 suggested.

i will add a fps meter soon. it is using the miner in debug players, and it has a meter so i didn’t needed it so far.

it runs at 30 fps, with 15 fps logic updates and interpolation between.

 
Flag Post

aaaaaaaaaaand…. i’m new here and i will thank forever everybody if anyone can point me to any topic, if it exists, discussing replacements for bitmapdata getcolorboundsrect , because in my quest of delete every garbage collector intrusion, i’ve hit a wall with the rectangle created by that function.
i need a replacement that doesn’t create an object.
i know that the simple answer is “is only a rectangle, it does nothing to the garbage collector”…. but is the primary objective of the library and the cause of it’s performance the intention of eliminate every single possible hidden allocation.

thanks!

 
Flag Post

I’m working on my own blitting engine for myself and I ran into some of these issues. I ended up dropping the bitmapdatas and using a ByteArray instead (with the alchemy opcodes for the fastest possible access). Of course it has to be put in a Bitmap at the very end to display it on the screen, but otherwise I avoid the class due to it taking and returning Point and Rectangle instead of simple ordinates.

I also use Haxe which makes it a lot easier to get awesome performance. I implemented by own scaling and rotation algorithm and it runs great. So I recommend checking it out.

 
Flag Post

thanks drakim!
i readed your blog, your particle system is awesome!

i’ll update the first post to include another example.

 
Flag Post

i can’t :P

so here is the other example

http://www.fileden.com/files/2007/1/31/717072/starforce01/game.swf

obviously again, the graphics are placeholders, and this is only a demo of lots of shoots on screen with pixel perfect collision.

i’m still fighting with the hidden allocations on that, but it seems to feel smooth anyway.

 
Flag Post

i was testing with bytearrays and vector, and both are faster, but allocates bytearrays or vectors at the same rate that was allocating rectangles with the other method.

i’ll continue the testings with the vector version anyway, it seems faster. i’ll do the alchemy tests later.

 
Flag Post

I don’t think you’re able to eliminate “every possible allocation” out of your library, after all, if a function you implement returns something more complex than a Number, you need to allocate memory for this, or else you risk spoiling your library’s user’s data. You can, however, accept a return-to parameter of Rectangle type, and return void, like oldstyle C functions do.

 
Flag Post

that’s what i’m doing, passing with parameters the object to fill. but i can do that with the build in functions like getcolorboundsrect.

 
Flag Post

http://www.fileden.com/files/2007/1/31/717072/td01/game.swf

updated with framerate