Get your blits out for the lads

30.09.11 Alex Stanbury

At the moment I'm working on a Flash platform game in my spare time. This has given me the opportunity to experiment with some of the clever techniques employed by game makers of years-gone-by in order to squeeze every last bit of performance out of their game engines. One of these technique is called blitting which is used to decrease load on the processor and therefore increase the frame rate of the game.

Usually in Flash you would create Movieclips or Sprites for all your game objects and add them all to the display list when needed, moving them around using their x and y properties and so on. With blitting you do not use the display list for everything, rather you only have one Bitmapdata object added to the display list, commonly referred to as the canvas. The idea is to update the pixels of the canvas with the pixels of whatever it is you want to be displayed in your game. This method is much faster because the overhead of creating complex objects is avoided as you are working solely at the pixel level.

You can see a simple example of using blitting here - From looking at the code you can see that the Box is being drawn into the canvas at a different position on every frame, in this case the box will move diagonally down the screen. This is a very simplified version of the method I have implemented in my game but you should be able to see how it works and the benefits this technique provides. You'll notice that I have only added a few properties to the Box object - If I was using a Sprite or MovieClip then I would also be adding a lot more complexity which I wouldn't necessarily make use of.

Of course you'd want to be using something more interesting than a pink box in your game unless you were making a game where the protagonist was in fact a pink box...but that would be a pretty shit game. One way of adding your own graphics is by using sprite sheets, another very common practice used when making games. You can read more about sprite sheets here

With Adobe's recent anouncement of the Starling Framework (an open-source Actionscript API for utilising the GPU directly) game development using Flash may not be so much about optimisation as it has been in the past but it's still useful to know the techniques that many thousands of classic games such as Legend of Zelda and Super Mario World have used.

For more reading on this and other equally interesting subjects head over to 8-Bit Rocket where there are many well written and highly useful tutorials.

Also, there is an excellent 3 part video tutorial on gotoAndLearn.com that deals specifically with blitting and sprite sheets, well worth a watch!

What a load of blit.

zelda mario spritesheet




Digital Shoreditch quick notes

09.05.11 George Profenza

The week that just passed was filled with all things digital around Shoreditch as part of Digital Shoreditch I wasn't humanly possible to attend everything available, so I will share a few opinions on a few of the events I had the chance to see.

Lately I've been insterested in 3D in general (be it modeling on a computer or analog, scanning, printing, augmenting reality, etc.) so it made for me to start with a visit to the nice people at Inition. I was blown away by the 3D technologies they had available: 3D scanners, ZCorp 3D printers, 3D displays in different formats(with or without 3D glasses) and in different sizes, depth cameras, AR solutions, Motion Capture solutions, etc. It would be awesome to work with some of these technologies at some point, and I'm sure our talented Motion Artists would be very interested in creating amazing content.

Started my Saturday early morning with a visit to the "From Digital to Analogue, and back again" session hosted by the London Metropolitan University. Had the nice surprise to get myself scanned while I was there.Thanks to Chris, from Metropolitan Works, I've learned more about how 3D scanning works, the different solutions available depending on the scale of the scan and different techniques used to 'stitch' 3D scans which was very interesting. Since the event was hosted in the Shoreditch building, we could only see recordings of how the 3D printers works. The actual printers are at Metropolitan Works, which work in partnership with the University. Pia Jonsson, who teaches the animation courses at London Metropolitan University demoed an interesting blend of 3D scanning, 3D printing and photography for stop motion animation and lip synching. A similar technique was used in Coraline I was informed.

Later I joined the friendly folks from SketchPatch and tried to lend a hand with their drop in session. Anyone interested in picking up a bit of Processing, even completely new to programming, could take part in an introductory workshop/session using nothing more than the browser itself. In case you haven't tried SketchPatch before, I recommend you do. It is a nice little environment to get started with programming without installing anything, and you can learn by modifying existing sketches and share your creations with the world. It is interesting to see what your creation evolves into as it gets cloned and 'remixed' by the community.

Finished my day by visiting qMedia research group at Queen Mary, University of London. Augmented Instruments, Kinect driven instruments, wearable technology, real time avatar responsive agents, they had plenty interesting projects as well.

Overall, it was great to take advantage of the knowledge shared out there. Got home inspired and hoping to get involved with innovative technologies in my current work. I've only covered little of what Digital Shoreditch had to offer, but there are plenty of nice thoughts shared via twitter. Don't forget to check out the resources on the main site.

George 3D scan George 3D scan textured SketchPatch site SketchPath polylines qMedia

Alex
2011-11-04   16:19

Awesome!! thanks man!!






Easy way to make Box2D games?

08.12.10 Euan Millar

Jesse Sternberg at sideroller.com has created the "World Construction Kit" It's a toolset / framework for rapidly developing physics based games / websites within the Flash IDE. WCK allows you to layout your 2d worlds / game levels entirely within Flash and have them hook into the physics simulation without writing any code.

Have a go at the game. Click "Next Demo" then use the arrow keys:

The kit is damn cool. You can lay out your Box2D physics worlds within the Flash IDE and also use the component inspector to configure the shapes. Easy-peasy.

He's also created the Box2D Flash Alchemy Port. An AS3 interface to the Box2D C++ 2D physics engine compiled with Adobe Alchemy. Documentation located on his GitHub wiki page.

Box 2D World Construction Kit




Kinect - not just a toy

26.11.10 George Profenza

Although the main purpose of the device Microsoft recently released is games, it has been hacked very soon after it's release and used for a lot more.

There is quite a lot of buzz on the subject lately and I am amazed to see how quickly things move. I've never seen people so enthusiastic about any technology before, in such a way.

Open source drivers to this device were released. Now there are libraries for the major creative coding projects out there (openframeworks, Cinder and Processing and MaxMSP) and even javascript (thanks to the MIT Media Lab).

There are already some impressive demos made using this technology, like Robert Hodgin's Body Dysmorphic Disorder:

Theo Watson and Emily Gobeille's Interactive Puppet Prototype

or Henry Chu's Reflection:

Initially started as Project Natal, Kinect allows to access depth information related to what it's camera can see. Where as before the input you got was from flat, 2D, just a projection of the 3D space, now developers can use this depth information to compute 3D point clouds.

Imagine indy game developers doing 3d motion capture for their animation in-house for an affordable price. Imagine gallery spaces that blur the line between what's augmented and what's not even further. These are just some of the things that pop from the top of my head, but considering the fact that now digital artists/creative tinkerers have this tool at they're disposal, I'd expect a lot more I'm pretty sure we'll see more results soon.

With all the commotion out there, I'd hate to regurgitate everything that's been said already. Mehmet Akten wrote a very informative article called Kinect - why it matters which I recommend.

Funny how Microsoft, well known for being closed source, suddenly found themselves in this probably unexpected situation.

Kinect driven Puppets