Sunday 29 January 2012

Video Production

I've done a small video before lasting just a few seconds but now I have put together a longer sample.  The Alien in this clip is not scripted it does all the behaviour seen based on the AI of the game.

It still needs a lot of polishing but it is workable already.  I say already but I have been working on the Artificial Intelligence and the behaviours for a couple of months.


Slightly stepping away from the game I want a little moan about how difficult putting the video together was.  I'd captured video screenshots before and I assumed it would be fairly easy to edit out the bits that I didn't think people wanted to see, like the opening menus and the levels loading.

I used Microsoft Expression Encoder 4 SP1 to capture the video of the game.  That initial video capture works very well.  Simply select the region to capture and press the record button.  Easy.   The result of that capture needs to be transcoded in to something usable by YouTube.  To do that it is necessary to use a different programme in the Expression suite.  This is where is all goes wrong. 

Microsoft have so restricted the free version of the Expression programmes that they are a pain to use for editing.  It defeats the object of a free trial version because having used that and taken all afternoon to remove a few frames I am unlikely to buy the paid for version.

Firstly the version I was using could only have one section of the video selected at any one time.  Therefore to remove several sections it was necessary to do each cut one at a time and spend minutes in between encoding and then reloading each completed bit.  To make matters worse it only used the original file name so I had to rename each clip in between.  That all sounds easy enough but I had to work all that out before I came up with a workable production method.  Wasting several hours.

The most frustrating bit was that along the way several of the encoded videos ended up with bad artifacts at their starts and the Encoder programme hung once and corrupted the xml file used for saving the jobs.  I was not impressed.


Following on from the above I now use Windows Live Movie Maker.  It is still limited but for a free product it does a good job and is easy to use.  I still need the Expression Encoder to capture the video in the first place:
Microsoft Expression Encoder 4 to capture up to 10 minutes of video.
Windows Live Movie Maker to edit the video, add transitions and background music.

Wednesday 25 January 2012


Diabolical: The Shooter has just reached a significant milestone...   The Aliens can now shoot back.

It's taken over two and a half years of evenings and weekends, a lot of frustration mixed in with some fun but at last I can start to see something that resembles a game.

There is still a long list of features that have to be added and lots of adjustments to get the action to feel right.  I was concerned early on in the design about how to make the Bots target players without being too accurate.  I am pleased to say if anything they are not good enough shots but I have several ways to tweak that...

Perhaps I spoke too soon.  That hurt!

Monday 23 January 2012

Behaviours are Working

I had enough coding time at the weekend to sort out the troublesome behaviours.  My test Bot will now run, walk, strafe or face the direction being travelled and hardly ever gets stuck.  It even ducks down behind cover.  Not always quite where expected but it does not look daft.

Compared to the frustration of a week ago I am very pleased with the results.

The main change was to be consistent with what code updates the movement.  It now always uses a route generated from the path finder class even if that ends up being a straight line.  There was a lot of tidying up to be able to do this.

To be able to strafe I had to add an enemy target location and then a bit of tweaking to smooth the movement, especially aiming up and down, to stop it looking too jerky.

I reached a convenient point to test it on the Xbox 360 and I am pleased to say it works well and I still get a solid 60 frames per second.  Not surprising because all the Artificial Intelligence (AI) and pathfinding code are carried out in separate hardware threads.

Now to make the behaviours find cover properly and to shoot back!

Blog Comments Problem with IE9

There has been a problem using Microsoft Internet Explorer 9 (IE9) to view this blog for the last couple of weeks.  The problem started sometime mid January 2012.   IE9 failed to display pages that contain comments even in compatibility mode!

Google Chrome and other browsers would display the pages correctly!

I have changed the comment posting method to use a Pop Up window instead of being embedded in to the page.  That appears to fix it.

Microsoft have not done themselves any favours with IE9.  First I could not order my Pizza because the payment page would not display!  The tick box to remember my login to this blog can't be used with IE9 because it stops some of the edit icons appearing and now the comments.

I have preferred to use IE since about version 4 but now I find myself using Chrome more and more often!

Tuesday 17 January 2012

Bot Behaviour Is Difficult

I didn't think it was going to be easy but I am finding getting good responses from my Bots is more complicated than I had anticipated. 

The mechanism I designed works and I can add various types of behaviour but the slightest omission in my thinking and the Bot does something peculiar or just stands there.

I'm adding more and more detailed debug information to help work out what situations trigger what responses from the Bots.

I found there is plenty of information available about the high level designs of various methods like Behaviour Trees or State Machines but not a great deal about what behaviours a First Person Shooter (FPS) Bot needs to process.

I've spent a lot of time with paper, pencil and eraser sketching out charts similar to the following:

Then coding those and now trying to fill in the gaps that testing has highlighted as problems.

It is very frustrating at the moment but I am sure it will be worth it in the end.