Project Qnightmare

[Q-Con XIII] Friday 16th - Sunday 18th June 2006



This page will show the evolution of the Qnightmare [Q-Con XIII] event, from the prototype to the final version. The purpose of this project was to see if it would be technically possible to recreate (albeit in a limited fashion) a version of the original Knightmare children's TV show using off-the-shelf computer components.


Thursday 23rd March :: It's ... ALIVE!

With the majority of the costumes having arrived, we did the first filming test on Tuesday. I'm very pleased with the results. :)

The video still needs a little work. If you look closely at the picture (below) you can see a green sparkly effect around the outside of people. It's likely that this is because we used no special lighting for this test. It might still be worth adding some code to clean up the artifacts, but I'm happy enough with it for the moment. This will give me more time to work on other stuff.

  video testing (lord fear)  

The Lord Fear part seems to come far too natually for Ben (Dragonslayers Club President). Plans for world domination are suspected. Andrew (Q-Con XIII director) plays the part of the assassin. The string things hanging down from his neck are because he put his costume on back to front - and even after he told us all he was used to wearing a dress! (There was this one time at band camp you know ...) ;p


My next job is to work on the audio. Although the audio will be recorded separately at the event, I would like to get it up to a more acceptable quality for this application, in case it is ever used again. This shouldn't be too difficult (I hope anyway). I also got some wood and paint samples this week. The plan is to have a wooden flooring and paint it green. If it turns out well, it will make a much better green screen room than having a load of green cloth getting trampled over. If not, the cloth will have to do, unless I can think of a better (and cheap!) alternative.

The test video will probably be available for downloading soon. As there is limited bandwidth available on my site, I will need to find somewhere to host it first.

What sort of PC do you need to run this?

I haven't quite worked this one out yet. The video test ran on an Athlon 64 3200 (2GHz) machine, with 2GB of RAM, a SATA II hard drive and a budget range GeForce 6200 video card. The format was raw (uncompressed RGB) video running at 12.5 fps (half the frame rate of a DVD) and PCM (uncompressed) audio. There were very few dropped frames. At the time of writing, I would consider this a mid-range PC, which would cost about 600 - 700.

Thursday 16th March :: The dungeon shifts

Time passes. The dungeon shifts. Lord Fear's domain expands.

This week has been a very mixed bag. There is now a plot! The script has a definite beginning and end now ... it's just the middle that needs some creative inspiration. There is a bit of pressure to turn the event into a competition between the actual teams, but I'm still determined to keep it as a competition against our dear friend, Lord Fear, with a storyline that people can watch unfold over the convention weekend.

The first dungeon rooms have been created. Due to the script being based on plot, with the dungeon design coming later, only very select rooms have been created so far. Included are Lord Fear's lair (below), a couple of the puzzle / trap rooms, and a couple of plot specific rooms. I was going to put up a gallery of what is being created, but I wouldn't want to give anything away now would I.

  lord fear's lair  

Lord Fear's lair. It has the very chic, unfinished "I'm a dark lord that likes to vaporize my builders when I'm in a bad mood - even if it's not finished" feel to it. Cosy.


  lord fear's lair  

The special broken designer wall for his close-ups. Yes, I borrowed heavily from series 6 for the design of the lair. So sue me ... oh wait ... no, please don't. :(
(We did actually ask permission to run a Knightmare event!)


As was used for the prototype, UnrealEd from Unreal Tournament 2004 was used to build the scenes. I had a look at the Half Life 2 editor, Hammer. It doesn't seem too bad and there are some very good tutorials for it. Unfortunately the texture sets used in HL2 aren't as dungeon-esque as the ones in UT2004. It's just a pity Unreal Tournament 2007 won't be out until a few months after Q-Con XIII. The updated graphics engine in it could have been put to good use. Still, as a programmer rather than someone very creative, I'm happy enough with the results.

In other news, the first batch of costumes have been ordered. The great thing about making a tribute event such as this, is that you get to pick and choose which characters will be in it. So you can expect to see a variety of characters from all the seasons as well as a couple of new ones. Lord Fear will be there (well duh!) and the part has been cast already. There will be a promo video being made at some stage over the next few weeks. More news on that closer to the time.

What is the red bit on the screenshots?

The large areas of red colour are areas of transparency. When drawn onto the screen, they will not overwrite the area behind it. This will allow me to render dynamic objects in the background, such as a dramatic swirling sky. It's not really something that can be easily shown as a static picture.

Friday 10th March :: Michael Cule is coming to Q-Con!

Michael Cule, who played the characters "Brother Mace", "Fatilla the Hun" and "Doorkis" during series 4 and 5 of Knightmare, has agreed to be a special guest at this year's Q-Con!

As a follower of gaming in general, this is not only great news for Knightmare fans, but the entire gaming community.

Friday 10th March :: It's ... ALIVE!

I missed my Wednesday update but better late than never I always say. Yes ... I always say that!

In a shock move, I actually made my deadline! Filming is now working great, so it's full steam ahead with finishing the application, the writing of scripts, making of the dungeon, choosing costumes and props, finding actors and actresses, getting video and audio equipment, and making the 'green-screen' set!

... simple no? :p

I was considering posting a short clip of the new video recordings, but with my limited bandwith I think I'll save it for the promo video that we are going to do. Ben (Dragonslayers Club President) has agreed to play the part of Lord Fear, as it means he can pre-record the scenes. If it this Q-Con is anything like last year's event, he will probably be spending every waking moment of the convention, trying to make sure that things don't bollox up :)

Live in fear!

Wednesday 1st March :: U-turn

I have gone in a complete U-turn since last week. Once again I am back to using Video for Windows (VfW) for video capture. It may be obsolete, but it's also a hell of a lot simpler than WDM. Although DirectShow (or whatever it is being called now) is the accepted way for capturing video, it was taking me far too long to figure out how exactly I was meant to be writing the application. Instead I have come up with a plan to multithread VfW so that I can do all the blue screen stuff while still having a decent frame rate.

Eventually I will move onto DirectShow, but not for this Q-Con. Time is fast slipping away and with only just over 3 months until show time, I want to start focusing on the actual content instead of still worrying about the blue screen stuff.

In a potentially suicidal move, I will state now that the application will be ready to record the first video clip at next week's DragonSlayers society meeting (Tuesday 7th March).
... of course if it's not complete by then this notice will probably disappear and I will deny all knowledge of its existance! :p

In other news... I have been looking at costumes for our actors and actresses. I am not sure what the costume budget will be yet, but I am hoping there will be enough left over to buy or rent something professional. I haven't decided on a final list of characters yet which obviously complicates things. I think that I would like to have a mixture of both traditional characters that appeared in the show as well as some new ones. I want to remain faithful to the original TV programme, but I don't want to fall into any traps of making things too familiar. The last thing I want is for a team to make a decision because character xxxx would never have the other option as the correct one.

Time to get back to work, deadlines to meet!

Wednesday 22nd February :: Qnightmare reloaded

The current Qnightmare application has been completely scrapped. Due to technical limitations of the Video for Windows (VfW) API, I wasn't getting the performance that I wanted. Frame rates were fairly poor and there was about a quarter to a half second delay between something happening live and the same thing being shown in the virtual world.

And so the project is being moved to Windows Driver Model (WDM). A lot of people have probably never heard of this, or at least know very little about it (myself included until a couple of days ago). It's all horribly complicated but it does mean that, if I manage to figure out how it works(!), frame rates will increase significantly.

Before, with VfW, the application worked like so:
    capture frame --> process frame --> capture frame --> process frame --> etc.

With WDM, the same application can now do:
    capture frame --> capture frame --> capture frame --> capture frame --> etc.
                  \-> process frame \-> process frame \-> process frame \-> process frame \-> etc.

Updates on the Technical side will probably be a bit slow over the next few weeks, until I have something working.

In other news, the first few victims have already signed their souls away for some of the acting roles that are being prepared. The actual scripts are still at a very early stage of development, but it is likely to follow a fairly simplistic format like in the early seasons. As much as I would love to have an animatronic dragon flying the dungeoneer between levels, it's just not going to happen! News on the creative side will follow over the next couple of weeks.

Wednesday 15th February :: Development begins!

Development of the new Qnightmare application is under way! This time, the "blue screen" effects will be linked directly into the video stream capture, which will allow video recording for the first time. I am also developing a new (and hopefully better!) algorithm for removing the background. I am optimistic that I will have an early working version for next week... no promises though!

Not much else to report this week, however I did take another screenshot with the prototype software yesterday. It was taken at the <insert blatent plug here> QUB Dragonslayers weekly Tuesday gaming session, David Keir building, 6pm - 11pm :) </end plug>.

  prototype screenshot  

After fairly successful animal testing (Gromit :p), human trials began! Meet Ben, Dragonslayers Club President. As always, he is so busy with club business and preparing for <insert second shameless plug here> [Q-Con XIII] </end plug> that he cannot afford the 2 seconds required to look at the camera for the screenshot. The now-legendary green cloth also makes an appearance. You can find it for sale on ebay after the event in June! ;)


Wednesday 8th February :: The Prototype

Below are a couple of screenshots of the prototype that was developed. Written in (unmanaged) c++, and using the Video for Windows (VfW) API for video capture, it took approximately 3 days to code. After the suggestion of running Knightmare at Q-Con XIII, its purpose was to see whether the idea could take form, or if it was just going to be a waste of time and money trying to get the event off the ground.

It is currently very slow (only a few frames per second) due to the current implimentation. This is because it uses a snapshot to generate each "blue screen" frame, instead of linking directly into the video stream feed. While not perfect, the result is fairly good, especially when considering the backdrop setting. The use of a solid colour and better lighting conditions produces a much 'sharper' blue-screen image.

  prototype screenshot  

The before shot. The 'blue-screen' effect is currently disabled. The left hand picture usually displays the virtual environment (which is why the crap fire particle effects which I added in is showing). The right hand side of the screen shows the live picture. As it was taken just after xmas, I placed a bunch of decorations on the sofa to really test the image processing. The green cloth is draped down to highlight the differences that a plain light coloured background, can make.


  prototype screenshot  

The after shot. The 'blue-screen' effect is switched on and Gromit (shame on you if you don't know who that is!) is placed on a stool in front of the camera. The resulting image is fairly good., The curtains and xmas decorations appear to be a bit of a problem with large areas of Gromit disappearing on the left hand side. Mounting the camera on the laptop wasn't such a good idea either, with movement of the camera causing small artifacts to appear elsewhere in the image! However, the area behind Gromit, covered by the green cloth gives a near perfect picture!


And so, Qnightmare was born!
Many hours have since been spent jumping around in front of the camera in the virtual world! :)

Why green cloth for a 'blue-screen' effect?

The colour of the background isn't important. The image processing works by looking at the differences in the image between what was there before and what is there now. Any colour could have been used but the objective is to keep it as different to what people would be wearing on the day. Black and white were immediately rejected as almost everyone seems to have one or the other somewhere in their clothes. Even though the you would associate blue with a blue-screen room, a lot of people wear jeans to conventions, ruling that out too.

When processing an image, every colour is broken up into their red, green and blue components. It makes sense to choose one of these colours for the background as it is less likely for them to be mistaken as another colour. For example the colour yellow is made up of a combination of red and green. If a yellow background was used, there is the chance that the camera might not recognise someone wearing red OR green, and large holes would start to appear in the image.

No matter what colour we picked, it is possible that it some people might not get the chance to play the dungeoneer and would have to play one of the advisors instead. The decision to pick green over red was a purely technical decision.

How did you make the dungeon background?

The background for the prototype was created using UnrealEd from Unreal Tournament 2004 (Epic Games). It took about 20 minutes to create and then a screenshot was taken in game. The lighting was pre-rendered in the editor before taking the screenshot. I was then just able to use my crap torch flame particle engine thingy(!) at the lighting coordinates. Using a pre-rendered scene will save a whole heap of processing power when it comes to the full Qnightmare application, but may limit what exactly we can do with the dungeon. It will be possible to have the pre-rendered backdrops and still have active elements in each room.

Errr ... are you allowed to do this?

Yes! We got permission to run the 'Knightmare' event at Q-Con.