Morgan's Projects: BlockBlast

BlockBlast is a simple but challening game written using C and the SDL (Simple Directmedia Layer) libraries. It is far more advanced technically than Breaker in that it makes use of much more of SDL's supporting libraries (audio, font and networking) and aims to provide a more compelling play experience using them and a complete game structure (iÇıtro screen, high scores, etc) for one or two players.

I project was conceived around November 2011, when I and my wife (Amy Evans), along with many of our friends were regular competitive players of a game called Collapse Blast on Facebook. Like many Facebook games, however I found the experience quite shallow and the high demands required for the resources to run the Flash game smoothly were quite eye opening for something so simple.

As such, I decided to create a native game that would not only run much more efficiently (as of now, the game uses ~12% CPU time as opposed to the ~60% used by Collapse Blast) but also take the basic idea and build on it to make both solid single and competitive real-time multi-player experiences. The game will still have the addictive "must beat" online high scores system, but will also many new features, such as:

Developer Blog

11th July 2012

Eight months (yes, months, give or take a day!) prior to today, I had created only a very basic demonstration, where the blocks would move up the screen, shake if they reached the maximum height and the "game" would end if they weren't moved down.

The crux was, that there was no rollover so that when the very bottom row of blocks moved up there would just be space beneath, not more blocks. I resolved that and I also got around to sourcing a really nice font and put in a basic scoring system. The result can be seen in the screenshots and video below.

On top of that, I made a number of behind-the-scenes improvements, like moving a lot of the game logic out of the main routine (you have to remember the game was in a very early state when I left it), optimized the maximum height check and thought about some new features for the game.

If you'd like to play the game as it stands, feel free to download it below.

13th July 2012

Started implementation of themes today along with some other small changes. The game now makes use of a folder called "themes" which itself holds subfolders for any pre-installed / user generated content. I might implement a theme repository and in-application browser but those are very long term wishes and I expect may not surface for a while after the final release.

I also got around to making use of SDL's gfx sub libraries to provide the semi-transparent play area backing which was originally drawn onto the background image (which was a horrible cludge) and the score is now properly centered when using variable-width fonts. Other little touches include the use of a make file for easy building and subversion for managing revisions.

If I get time today, I'd like to finish off theming (fonts, sounds and music) support and actually add a music and sound effects. Once they're in place I can get on with increasing the difficulty (more colours, faster scrolling) of the base game before adding other features.

16th July 2012

Wow, it's been three days but I've made some major changes to the code.   Firstly, BlockBlast now makes use of SDL_mixer to provide music and sound effects. More on that later. Secondly, the project is now running under subversion version control. Finally, theming is coming along really nicely, with a simple theming API and folder structure which means backgrounds, blocks, music, sound effect and fonts can be switched around easily and the API is stored in a seperate file so it's easier to maintain away from the main code.

If I've learned anything over the past few days it's that Subversion is a bit of a ball-ache when you add new files and folders and SDL_mixer seems to be a bit touchy under Linux.

Why SDL_mixer is acting up is beyond me at the moment, but it plays music fine and even some samples, but others often come out as a tiny crackle.   Bizarre.  Anyhoo, I'm sure I'll get to the bottom of it. It might just be driver support under Ubuntu 10.04 but it's still weird how the samples play fine externally, but often not in game. I thought it may be a buffer/lag issue but so far I haven't fixed it. I'll post an update as soon as I do.

Update!  Sorted the sound sample issues out. I was playing them using SDL_mixer's auto-allocated next available channel, rather than being sensible as using a fixed channel, so it was all going a bit Pete Tong.

So, here it is: another video (sorry, still no audio, screencasting's a bit touchy with audio under Linux). This time I'm making use of the default theme (although don't expect any of the backgrounds, samples or music shown on this page to find their way into the final game unless I get permission, they are just place-holders) and as you'll notice, the pace has been upped a bit too.   Now the player only has two seconds to reduce a max-ed out stack and the stack grows quicker too. Oh, and the player can now manually scroll the stack using the spacebar.

18th July 2012

So much going on now. I drew up a design and flowchart for how I want the intro screen to look and behave and have spent the last couple of days working on implementing the code for the animation and menu based user interface elements of the game (it's basically a strip with a set of rolling icons for the user to select) I also managed to get audio capture through ffmpeg so any new game videos will now have sound.

I'm just finishing up on the compositing routine for the menus and my next task is to provide the particle effects for breaking blocks as they're essential to the experience both in game and for the title screen routine. I will hopefully have something solid posted up in the next couple of days and maybe even an alpha release if things progress really well.

25th July 2012

Things have progressed a fair bit, if not as much as I'd have liked over the past week. The title screen is now nearly complete and I've implemented block explosions now, although they're currently only being used in the title screen routine at as writing. The menu strip, used for selecting game types, features and options is also in place and again has first been tested in the title screen. Check out the screenshots and video below.

Things I'm definately going to have implemented for my next update will be in-game explosions, title screen (the routine wraps around with the next available theme) and menu UI interactions. Sadly, the project will be on hold for the next couple of weeks as I am moving home, and I'm on holiday and I'm setting up a small, general purpose server for demonstrating my PHP / server admin capabilities to potential employers, which is more important currently.

10th August 2012

A little update! This morning I put explosions into the main game and I've also uploaded two zip files with source and executables for 32-bit and 64-bit Linux distros.   Please be aware that you'll need base SDL, SDL_ttf, SDL_mixer, SDL_sound, SDL_gfx and SDL_image libraries installed before you'll be able to run any executables.   I'll probably put a 32-bit Windows archive up later today.

Downloads

Click here to download Block Blast pre-alpha for Linux (32-bit) Click here to download Block Blast pre-alpha for Linux (64-bit)

For the time being, you can download a snapshot of my source code from my subversion repository URL:


svn://80.229.38.241/BlockBlast

Please be aware that the code is very much in pre-alpha state and hence I won't assume any responsibility for its use (in whole or in part)   Also, please be aware that other than the block graphics and any menu icons, the assets currently being used are only placeholders and are not meant for end-user release.