My Super-Happy Development Setup

iceberg.png

As I've previously mentioned, software development is divided into two very distinct parts. The fun part that everyone loves, and the tedious bits that suck away your energy.

You can think of it like an iceberg. There's the top that everyone sees, where penguins frolic and hold parties. Then there's the sub-surface part. A dark and dreary place that people try to ignore. You can thank that part for the sinking of the titanic.

Today I'll be talking about the 90% you wish wasn't there. Sorry about that.

It's not all boring!

OK, so maybe it is, but if you're a programmer you'll know there's a certain satisfaction you can only get by automating some part of the development process. As Steve McConnell puts it in "Code Complete", if a programmer can do a job comfortably in five hours, or spend four hours and 45 minutes writing a tool to do it in 15 minutes, they'll choose to write the tool every time.

My tools directory is littered with quick, one off scripts I've written to get a job done, or other small applications I've downloaded. Today we'll be taking a brief look at my setup.

The IDE

dev-screen1.png

The language I use most frequently is Blitz Plus, so my development environment is tuned to making me more productive in it. My IDE of choice is Protean, which became a free product earlier this year.

The main reason I chose Protean was the excellent code completion support, as well as the project support. These two features alone have probably saved me hours worth of work. The standard Blitz IDE is a little clumsy for larger projects, and it was quite a hindrance.

I keep the Windows taskbar auto-minimised on the left of the screen. This helps when I have several windows open, and also maximises the amount of space the IDE gets. It's not a huge gain, but every little helps.

I also like the colour green.

Plenty O'Tools

My tools directory contains dozens of applications, ranging in size and complexity. There are far too many to list in detail here, so I'll stick to the ones I use most often.

  • PHP – I use PHP for a lot of "glue" scripts, because it's quite easy to knock up a simple script to do something useful. My original build scripts were written in PHP, but I'm slowly migrating them to BlitzBuild. I've used PHP for all kinds of things, from generating code distributions to parsing source files for variables. I considered using Python for these tasks, but I felt more comfortable using PHP. It's not just for websites!
  • pngcrush – A simple tool to compress png files a little further. Not really essential, but I'm still stuck in "this has to fit on a floppy" world so every saved byte counts.
  • ResHacker – Blitz doesn't add much information to executables, so I use ResHacker to add a fancy exe icon, as well as resource information. It can be used from the command line, so it's part of my post-build script.
  • Subversion – I run a Subversion server on another machine, and it's saved my bacon on several occasions. I use TortoiseSVN for the front end, because it makes life so much simpler.
  • xsltproc – I've recently started using DocBook for documentation, and I use xsltproc to convert it into something pretty. I prefer running it on Linux, as it seems to run much faster.
  • Kate – I use this for editing DocBook XML files, and it supports code completion and code folding. I sometimes dabble with XXE for DocBook work, but I find it to be overkill for most of the documents I work on.

Putting It All Together

As powerful as these tools are on their own, they really shine when joined together in a build script. At the moment, my Blitz projects have three batch files: "pre-build", "post-build" and "build-resources". The pre-build script is for auto-generating source files, and the post-build script takes care of adding resources to the exe and compressing it. The resource builder compresses sounds and graphics, processes any extra files (such as XML files that need converting) and creates all of the data files.

In the future, I want to move all of this into a single BlitzBuild script, as I feel the three batch files are a weak link in the build chain. I'd much rather run a single command and have the whole process work automatically, than run different batch files. I also want to add support for different configurations. This will allow for quick builds that don't create resources, as well as special debug builds that add extra information to the exe.

What tools do you use in your development process? Do you have any novel uses for existing tools? What single application saves you the most development time?


Games I Designed as a Kid

There's an interesting discussion going on at the IndieGamer.com forums about games we designed as kids. I still have the notebook I used to design games in, and although their scope far outweighed my ability, it's fun to look at them to see how things have changed.

Some of the designs were detailed, spanning pages of documentation, maps and game elements. Others were just paragraphs describing a concept, and usually a pretty unoriginal one at that.

It's amazing how much confidence a small amount of programming knowledge gave me back then. Copying a listing out of a book made me feel like a king, and my ideas reflected that. These days I'm far more grounded in my approach, which is surprising considering how my abilities have increased.

(Some of these ideas are typed directly from my old ideas book, and I've included the mistakes for comic effect.)

The Cream of the Crop

Psycho Bean

Not so much a game idea, as an entire franchise. I can't take full credit, as it was something my brother cooked up whilst high on sugary "Lemonade Dippers". It started out as an audio tape recording. Due to my brother's high pitched voice and the tape recorders "double speed" facility, Psycho Bean was blessed with a voice worthy of Alvin and the Chipmunks.

The story followed a happy bean called "Cutie Bean" that gets struck by lightning and turns into "Psycho Bean", a ruthless killing machine that destroys all in his path. Other characters included "Granddad Zimmobean" and "Baby Bean". Complicated stuff.

Psycho Bean's power came from lemonade dippers, but if he ate too many he would be sick. Levels included such original locales as "Bean Town", "Bean City" and "Bean Laundry". The penultimate level took place in the lemonade dipper factory, with a bloody finale in the Lemonade Dipper Burglar's Hideout.

Like most of the games I designed in my youth, I got as far as designing the sprites. Perhaps I should have been an animator instead.

Unfortunately, Psycho Bean was retired once my brother's voice broke. It was a cruel reminder of the brevity of youth.

Sonic Blast / Sonic Boom

sonic-blast.png

OK, so now we're into "Watch out for lawyers" territory. Sonic Boom started out as the sequel to a text adventure I wrote called "Sonic's Adventure". Sonic's Adventure was actually the first game I'd written without any outside help, and the finished result was relatively playable. A sequel, Sonic's Adventure 2 was started, but lost due to a corrupted disk. Many tears were shed that day.

Like most of my ideas, Sonic Boom started out as a small idea and grew into a mammoth undertaking. I wrote it for the Atari ST, long before I had the Internet, so I drew all the graphics myself. I remember painstakingly copying the Sonic 3 sprite from a sticker album. Tough days.

The game didn't get particularly far, but it was my first foray into graphics so I was relatively pleased with how things went. There was no scrolling, it had annoying music and I'm not really sure what I intended for it. It had colour cycling though, which made for pretty waterfalls and sparkly gems.

sonic-boom.png

Sonic Blast then mutated into Sonic Boom, which was more of a strategy RPG in the style of Shining Force. There were three different level types; side-scrolling adventure stages, top-down exploration stages and top-down turn-based battles.

Sonic Boom was easily the most playable game I ever wrote for the ST, and although the code was an absolute mess, I got quite far. There were four levels, and I had plans for approximately six chapters (that's about 36 levels in total).

Another feature was "P-Life", which was loosely based on NiGHTS's A-Life. Every time you defeated an enemy, you would collect part of their DNA. This could then be fused with the creatures in a special garden, and you could create interesting hybrids.

As time went by and I switched to a PC, the dream of my own Sonic game lived on. DarkBasic was the first language I tried, and before long I had a terrible model of Sonic sliding around a terrible level. DB didn't get much further than that.

I still have many folders crammed full of ideas and drawings, and of course I still have the dream. Sadly, most companies frown quite heavily on fan-games, so the journey will have to stop here.

Shining Force Online / Shining Force IV / Shining Force X / Shining Online

atari-shining-online.png

As with Sonic Boom, Shining Force Online was inspired by another commercial game - "Shining Force". Many, many hours were spent playing it, so it seemed only right to devote more hours to creating my own version.

Clearly, I should have spent more time thinking up a decent title for it.

I can't really take credit for this idea, as it followed the same pattern as most games these days; 1) find a forum about games, 2) tell everyone you're going to make the best game ever and 3) find people to do it all for you.

My brother and I signed up to help a fellow fan with his Shining Force game, but it quickly became apparent that he had no idea of what he was doing. Thankfully, he had quite a big team and had put all their email addresses in the "To:" line, so we instigated a coup to overthrow his leadership.

We should have realised that some of those emails belonged to his friends, and he quickly found out. I can't remember exactly how the email exchanges went after that, but I don't think he was very pleased. First lesson of mutiny: Make sure you're not the only people that want to rebel.

Once the excitement died down, my brother and I set about writing our own game. I'd already written most of the engine for Sonic Boom, so it was merely a case of adding new graphics and a plot. As you can see from the screenshot above, graphics were something of a challenge at the time. The Atari version even got reviewed in UCM Issue 23, although I think they were a little bit generous with the score.

pc-shining-online.png

After migrating to the PC, the game got a new title and a complete facelift. Two PC demos were released, and they generated around 4000 downloads between them. Not bad for a demo.

Other notable achievements include 3000 pieces of hate mail, all from the same guy. Downloading 3000 large emails via dial-up was no fun, especially as the connection liked to die during the process. Still, it was fun to inform his school of his transgression.

The source code also contains a set of quotes to inspire me. Most of them are of the "This game sucks" variety, but there were a few nice ones in there.

I made a lot of good friends whilst making the early demos, and I still keep in touch with them. It would be fair to say that the response to my early work helped me make the decision to become an indie developer. They were good times, and James and I still have piles of paperwork spanning all of our ideas.

Of all the game ideas I want to complete some day, this is right at the top.

The Bottom of the Barrel

Battle Racers

Description: "A racing game where you fight opposing cars or just race".

That's about as detailed as it got, apart from the "other details" section which had the following important information: "The car is red, with with [sic] white stripes, the opponents cars are white with black stripe." With detail like that, it's hard to understand why I never made it.

Immediate Action

Description: "You have to progress through various missions and achieve various goals".

Somewhat inspired by Andy McNab's book of the same title, this was set to be an army game with multiple vehicles, missions and weapons. As you can see from the description I wrote, it was thoroughly planned. From what I remember, designing the game was as complex as looking through books to find pictures of cool weapons and vehicles, and then writing their names down.

All Good Things…

That brings us to the end of our journey through my childhood dreams. Will any of these ideas ever see the light of day? Let's hope not.

Do you have any ideas from your childhood you'd like to share? What ideas are you proud of, and which ones make you cringe?


The Boring Parts of Game Development

Let's face it, most of what I've been working on over the past few weeks has not been particularly exciting. In fact, it's been downright boring. Unfortunately, game development is not all fast cars and multi-coloured particles. A lot of it is dull, tedious and less exciting than watching a race between paint drying and grass growing.

As if things weren't bad enough, skipping over the dull bits to work on exciting things will always come back to haunt you. Talk about kicking a man when he's down.

The Slightly Boring Bits

The blank canvas

It's more intimidating than boring, but starting out with an empty project is boring in itself. Although there's the initial rush of starting something new, it's quickly followed by the realisation of how much work needs to be done. Creating the initial skeleton is a lot of work, and you'll probably end up rewriting it at least once. That's something to look forward to.

Setting up tools

It's easy to waste days, even weeks, on setting up your build environment. Choosing a language, setting up working directories, version control, customising your IDE and creating build scripts are all part of the initial fun. You might even write a set of coding standards if you really want to put yourself off the project before it's started. Remember to spend at least a page debating over how many spaces a tab should contain.

The Really Boring Bits

Testing

Hopefully most people realise that being a game tester is not the same as playing games for a living. Testing your own game is much worse, because by the time you're ready to test you'll be sick of the sight of it. To make matters worse, you have to wade through all your code and fix all the bugs that crop up. It's bad enough having to test something you hate, but being reminded that you make mistakes (and lots of them) adds insult to injury.

Documentation

Need I say more?

Anything that involves accessing files

Ever been excited when a game reads something from the hard-drive? Thought not. Spare a thought for the soul that coded it.

The "glue"

Games are lots of fun things stuck together by lots of boring bits. Error checking, file manipulation (as mentioned), resource management and all the bits that glue the main components together are all parts of the job you'd rather never see.

It's fun to watch things fly around the screen, but there's a lot of work to be done behind the scenes before anything can start flying. It should come as no surprise to realise that coding all of this is no fun at all.

The Good News

You could have to clean up this kind of thing for a living.


What's going down...

As many of you will know, hot weather and software development do not go together. The last few weeks have seen temperatures in Britain hit the high 90s, which wouldn't be so bad if I had air conditioning. Suffice to say, my productivity hasn't been as high as I'd like it. Still, at least I have a mild sun-tan.

Here's what's been cooking (almost literally) over the last few weeks:

Flexible Resource System

So far this has turned out to be a huge time saver. Instead of altering code every time a new resource should be loaded, the application will scan the resource directory and load resources as required.

The current system uses XML to define which resources should be loaded. XML makes the whole system nice and flexible, and it's easy to read and modify. Every resource used by the game can be loaded using this system, and each resource file has a namespace to avoid naming collisions.

Future improvements will add a "load on demand" system and a resource cache to help lower memory consumption.

Debugging System

small-log-output.png

The standard Blitz debugging system is somewhat lacking. It does the trick if you're running your program from the IDE, but once it's in the wild it's useless. Naturally, I had to write my own system.

The logging component is quite simple, uses XML for storage and XSL to make it look pretty. It's not particularly powerful, but it's useful for getting system information and tracking function execution times. So far it's saved me from a few problems, and helped me to smooth down a couple of time consuming functions, so it's powerful enough.

Debug Console

I created a Doom style console that allows the user to manipulate game objects using a command line. It can also display internal information that can be useful for debugging purposes. It's the sort of component that isn't vital, but is super handy when it's there. Just the ability to spawn objects manually is worth the time it took to create.

An Object / Entity System

This is easily the most time consuming thing I've worked on, and it's also the most complex and frustrating. It's still not finished, but it's usable.

The main idea is to have a "pluggable" object that will be given different behaviours. At the moment, each object is made up of States, and each State is made up of Triggers. These triggers fire "Actions" when they are activated. For example, a treasure chest would have two states ("Opened" and "Closed"). A chest with the "Closed" state would have an "onInspect" trigger, which would run several actions when the character inspected it. These actions could include giving an item to the character, as well as playing sounds, animations and changing the state of the chest to "Opened".

BlitzPlus doesn't support true Object Orientation, so the whole system has been a bit of a battle. I've been using the "Blitz Virtual Machine" to script behaviour, and it's working nicely so far.

Some Flexible Tools

To save time, I created an automatic build script that will build resources using a simple script. At the moment it's a series of batch files and smaller tools, but I've started writing a Blitz builder that's loosely based on nAnt.

The Blitz Builder uses an XML script to build the application and its resources, and each script can have various configurations. It's quite simple at the moment, but it's being built in a flexible way so new commands can be added easily using plugins. It also has much better output, so the full build process can be built and timed. No prizes for guessing what file format the output logs use…

Other Bits and Pieces

Other tasks I've been working on include designing a nice website for the project, trying out various project management tools and cleaning up some of my code libraries so they can be released at a later date.


Fixing the Office 2007 error - "Document could not be registered"

As I've mentioned before, I'm currently running the Office 2007 beta. Recently I've been getting the error "The document could not be registered" every time I create a new document, change the style set and at other times.

Apparently the problem is due to the "DCOM Server Process Launcher" service not starting. I was unable to start it manually, but after setting it to start automatically I was able to repair the Office installation and get things running as normal. It also fixed a problem I was having with the MSI installer service, which had stopped me from updating Windows as well as running most installers.

Fixing the DCOM Server Process Launcher

First of all, you need to open the "Services" manager. You can do this either by selecting "run" in the start menu and typing "services.msc", or going to "Control Panel", then "Administrative Tools" and selecting "Services".

You should see a window similar to the following:

services-manager.png

Select the item named "DCOM Server Process Launcher", right click and select "Properties". This should bring up the following dialog:

enable-service.png

Select "Automatic" from the "Startup type" drop down, and then select "OK". Close the service manager, and then you'll need to reboot.

Repairing the Office 2007 Installation

Once you've rebooted, you should be able to repair your Office installation. Go to the control panel, select "Add or Remove Programs" and select the entry named "Microsoft Office Professional Plus 2007 (Beta)". Click the button called "change", and then select "repair" from the options. This should then start the repair process. It took quite a while for me, so you might want to make a cup of tea or knit a jumper whilst you're waiting. Once it's finished, it'll ask you to reset. Once you're reset your machine, everything should be back to normal. Phew!

Update: Jack and Mike have both found that giving the document file a shorter name can solve this problem too. Cheers!

Updated 2: Al Simon also encountered this problem, which was caused by a corrupted file. You can view his solution in the comments below.