Just over four months have passed now since I started contracting at the BBC – four months that have flown by like days!
Today the primary purpose of my contract was released into the wild: the BBC Sports F1 application for Virgin TiVo. The public release of this application means that I am finally allowed to talk about it which is a great relief because not being able to talk about such an exciting project was really quite difficult!
The application enables users to watch all the BBC’s interactive coverage for major sporting events such as Formula One, Wimbledon, Euro 2012 and London 2012 with live streams, on-demand video and other additional content.
Back in 1998 when I was 16, my father bought me my first Windows computer – a Toshiba Satellite 320CDT laptop from PC World in Chester. It had a 233mhz Pentium MMX CPU, 32MB of RAM and a 4GB HDD with Windows 95 installed.
Although new to Windows, it didn’t take long for me to realise that Windows 95 left a lot to be desired. I upgraded to Windows 98SE at the earliest opportunity and boosted the RAM with an additional 64MB taking it to 96MB in total. For the next few years I used that little laptop extensively and I learned a lot from it.
Tired of BSODs I eventually upgraded again to Windows 2000 which offered a much more stable environment at the notable expense of speed and responsiveness. Eventually it became time to upgrade to a desktop and the Toshiba was handed down to my younger twin sisters who, as it turns out, thoroughly abused it.
I dug out the machine while at my parents’ house a couple of weeks back. I was quite mortified to find the keyboard and screen covered with various bits of food, the modem cable was missing, the track pad nipple was missing, the little door covering the PCMCIA slot was missing and the charger socket was loose which meant the laptop would only charge if you held the cable in at a certain angle. Considering I had always kept the machine in good order I was not impressed. I decided to rescue it in the interest of nostalgia and brought it home with me.
The first thing to do was get all the food stains off it, which was quite easy with some wipes after taking out the keyboard. Next I got onto eBay and found a replacement modem cable, track pad nipple and PCMCIA door. I ordered one of each and then set about fixing the loose charger socket. I doubt I’ll ever use the modem again as I have a wireless network card that will fit this, but it’s better complete than incomplete nonetheless.
After finding a service manual for the laptop (mirrored below) I was all set. I opened it up to discover that the machine had obviously been pulled around by the cable as the solder was cracked and broken on BOTH pins! No wonder charging was so hit-and-miss! A little touch-up with a soldering iron and that too was fixed.
Over the next couple of days the various replacement parts arrived and eventually the laptop was as good as new – apart from the Windows installation which was full of all kinds of freeware/adware/spyware. I decided to reformat and re-install, which was easy as I’ve kept ISOs of all my OS disks over the years.
Interestingly Windows Update no longer works for any browser older than Explorer 6 SP1. As Windows 2000 comes with Explorer 5, I had to find an offline installation executable to manually update that before I was able to download the other 100+ updates required through Windows Update.
After hours and hours of downloading and installing updates I now once again have an as-new Toshiba 320CDT laptop, fully up-to-date (as far as Windows 2000 is concerned at least) and ready to go. It’s too slow to use every day, but as it’s where it all began for me I do feel much better having restored it to its former glory.
If anyone else is restoring a 320CDT, here’s a list of resources and software that might be of interest:
Back in the mid-late ’90s, Sega’s 32-bit Saturn was in the process of losing ground to Sony’sPlayStation, mostly due to a series of stupid decisions from Sega themselves. From hurriedly throwing together a machine that was incredibly difficult to program to asking for £400 for it on release (equivalent to between £600 and £707 today), Sega seemed pretty determined to make the Saturn an unattractive proposition for both developers and consumers alike.
As a result of being both difficult to program and the subject of a much smaller user-base, the Saturn was often the recipient of low quality, rushed games that looked (and sometimes played) terribly compared to PlayStation equivalents. Yes, there were obviously a number of greats on the Saturn that, in my opinion, eclipsed much of what the PlayStation had to offer, but I’m not talking about exceptional cases here – I’m talking about the way things were in general.
Sometimes this was down to developers porting over PlayStation code with minimal effort which meant no optimisation (for instance, Acclaim’sAlien Trilogy only used one of the Saturn’s two 32-bit CPUs) and sometimes it was simply down to developers not being skilled enough to get the most out of the hardware.
Sega’s non-existent software libraries meant that writing code in Assembly would yield speed increases of 300-500% over code written in C, but few publishers and developers were willing to spend the time – or the money – to do this. Yu Suzuki himself estimated that only 1% of the industry’s programmers would be skilled enough to get the most out of the Saturn, which compared to the high percentage of developers who could easily get things done on the PlayStation thanks to Sony’s comprehensive C libraries, just wasn’t good enough.
However, while most developers and publishers were happy to release sub-standard crap on the Saturn, there were a few who were willing – or maybe more importantly able – to achieve impressive results on the machine, sometimes even achieving things that were not possible on the PlayStation.
One such company was Lobotomy Software. I remember reading a preview of their first Saturn title, Exhumed, and being overjoyed that finally someone was putting some proper effort into a Saturn FPS. Deadalus, Doom and Alien Trilogy before it had all been horrendous, so I was really looking forward to playing what looked like the console’s first proper FPS game.
I pre-ordered the game and remember being late for school the day it arrived as I had been unable to wait ’til later to try it out. Over the next few months I completed the game several times over and unlocked every single secret, earning the in-game ability to levitate and even fly. The game was just awesome.
On the success of this game (at least technically if not commercially – this was the Saturn after all), Lobotomy Software was commissioned by Sega to also convert Quake and Duke Nukem 3D to the Saturn; both of which also turned out to be favourites of mine.
The brains behind the SlaveDriver engine that powered all three games and put every other Saturn FPS to shame was a guy called Ezra Dreisbach, and although I’d never met him or even seen his photo, I had some serious respect both for him and what he had achieved where so many others had failed.
Back when the Saturn had reached its apex in the US market, I had just obtained a used one and several games and had done some research on USENET for which games I should investigate. Among the games that seemed to be highly acclaimed were three by the company Lobotomy Software. Those titles were all first-person shooters: Quake, Powerslave, and Duke Nukem 3D. The last of these even had the functionality to play over the Sega Netlink modem network device. I bought all three and enjoyed them immensely. As it turns out, I was able to track down Ezra Dreisbach, the lead programmer on Powerslave and actually got to ask questions. Ezra now works at Snowblind Studios where he worked on Baldur’s Gate: Dark Alliance. Here’s the result of that communication.
Matt: You were the lead programmer on Powerslave for the Saturn by Lobotomy, but also on the team for the Saturn ports of Duke Nukem 3D and Quake. Did those all use the same engine?
Ezra: Yeah, they were all based on the Powerslave Saturn engine. It was on the strength of that engine that we were able to get the contract for Duke Nukem and Quake from Sega.
Matt: What were your contributions to that engine? What were your roles on the other games that used it?
Ezra: I was the only programmer on Saturn Powerslave, but after we got the Sega contracts our whole company started working exclusively on those two projects and I moved into more just doing the core game engine work to support them.
Matt: Powerslave and Duke Nukem 3D on the PC both used Ken Silverman’s BUILD engine. Was the engine you designed for the Saturn a port the BUILD engine?
Ezra: Both games were pretty much rebuilt from the ground up. There is no shared code at all.
Those games work very differently from the way that things need to work on the Saturn, so there is really no way to do a port other than to basically remake the game. Doing ports isn’t the most financially or personally rewarding work. So there is no way that we would have wanted to do these if we hadn’t already known how to make Saturn first person shooters.
Matt: What, besides data like textures and models, was carried over from the PC versions? How about porting Quake?
Ezra: For Quake, all the levels were rebuilt by hand using our in house tool “Brew”. For Duke, we had a way to import the level data into Brew, but it still required substantial reworking.
Matt: What kind of system did Brew run on? I presume a PC, but then I’m not aware that I’ve ever heard a Saturn dev kit described before.
Ezra: It ran in Windows. The original idea was that it would be a tool that Lobotomy could use to create first person shooter levels for many games. We used it for Powerslave (Saturn & PlayStation), Mortificator (PC, unreleased) and the Quake and Duke ports.
Matt: You were a member of the “Design Team” for the PlayStation version of Powerslave. Does that mean you were a programmer, or did you fill some other role?
Ezra: No, it doesn’t mean programmer. On a project with so few people, everyone who works on it does some of the design. For instance, I designed some of the boss behaviour.
Matt: How did you feel about the two platforms, Saturn and PlayStation?
Ezra: I did do some work on the PlayStation later. After Saturn Quake was done I did a quick port of it to the PlayStation. Lobotomy was really hurting for cash at that point, and I hoped that we could get some publisher to sign us up to do PlayStation Quake. But for some reason, we couldn’t get anyone to go for it. Lobotomy folded soon after.
Matt: A PlayStation port of Quake? That’s terribly interesting! I’ve wanted a version of Quake on the PlayStation so I could compare versions on all three of the consoles from that “generation”. If you’ve the inclination, I’d truly like to hear how the port turned out on the PlayStation hardware, compared to the Saturn and (if you’ve seen it) the N64 version.
Ezra: The most striking thing about the PlayStation port was how much faster the graphics hardware was than the Saturn. The initial scene after you just start the game is pretty complex. I think it ran 20 fps on the Saturn version. On the PlayStation it ran 30, but the actual rendering part could have been going 60 if the CPU calculations weren’t holding it up. I don’t know if it would have ever been possible to get it to really run 60, but at least there was the potential.
Other than that, it would have looked identical to the Saturn version. Except for some reason the PlayStation video output has better colour than the Saturn’s.
So I know something about the PlayStation. And really, if you couldn’t tell from the games, the PlayStation is way better than the Saturn. It’s way simpler and way faster. There are a lot of things about the Saturn that are totally dumb. Chief among these is that you can’t draw triangles, only quadrilaterals.
Matt: I think I’ve seen an example of this in Tomb Raider on the Saturn. Very early on, in the caves, you can find a rock with a triangular side. In the PlayStation version, a rectangular texture was cut down the diagonal and mapped onto that triangle. In the Saturn version they had mapped the entire rectangular texture into the triangle, reducing one side to a point (in the sense that a triangle is a degenerate quadrilateral with one side of length zero).
Ezra: Ha! That’s pretty weak. What you do if you’re really trying is you pre-undistort the texture so that when you pinch one side down like that you end up getting what you wanted. We had to do this for the monster models in Saturn Quake.
Matt: Do you recall some of the internal differences between the Saturn and PlayStation versions of Powerslave?
Ezra: If you find all the team dolls in the Saturn version, then you get to play Death Tank. I’m not sure what you get in the PlayStation version. Jeff [Blazier] (the programmer of the PlayStation version) was working on a DT-like multiplayer minigame based on asteroids, but I don’t think he put it in the final game.
There are laser wall shooters in the Saturn version, but not in the PlayStation. It was a long time ago. There are plenty of differences, but I don’t remember any more major ones.
You can play a more advanced version of Death Tank if you’ve got Saturn Quake and Saturn Duke. Just boot up Quake so that it makes its save game, then start up Duke and a Death Tank option appears in the main menu.
Matt: Who designed the four exclusive levels for Saturn Quake? And while we’re talking Quake levels, what happened to one of the most memorable secret levels in the original Quake, Ziggurat Vertigo? Was it just too much wide open space for the engine to handle? Or were there other reasons for leaving it out?
Ezra: Yeah, exactly. That level was way too open to run well on the Saturn. One of the main problems with both the Quake and the Duke ports was that, on the Saturn, you can’t just draw a huge flat wall as one huge flat polygon. For one thing there’s no perspective correction, and some other limitations prevent you from even trying to work around that problem by dynamically subdividing the walls. So a flat wall has to be drawn as a mesh of quads. This means that huge walls have to be a lot of polygons, so huge open areas just can’t work. One of the Duke Nukem secret levels had to be replaced for the same reason.
The exclusive secret levels were designed by the whole Quake team. They were actually built by the Quake Saturn level designer, Paul Knutzen, who I’m happy to again be working with on Snowblind’s new project.
“The next part is even more disappointing for the N64 port. Many of you may recall the three switches that light up as you descend a spiral ramp down to a pool of sludge. In the N64 version, the lighting is almost completely static in this section. Apparently adding coloured lighting to sections of the game is easy, but the addition of dramatic dynamic lighting is too hard to do. But wait… Lobotomy managed to pull it off on the Saturn. Crazy.”
I remember being really grumpy about implementing the dynamic-world lights like the three switches in this area. I’m glad someone appreciated it.
Matt: Do you generally like first person shooters? Or was the work on Saturn shooters a business decision, given the popularity of the genre?
Ezra: Yeah, I like first person shooters, Halo was my favourite game last year. But at that point, what I wanted to do didn’t really have anything to do with what Lobotomy decided to do. I was hired to work on Saturn Powerslave, so the decision to do that game was made way before I got there. And even after that I didn’t get much say it what we were going to work on. Not that we had much choice, people weren’t exactly lining up around the block to offer us work.
Matt: What others kinds of games do you play, in your spare time?
Ezra: I’ve already played a ton of games, so I like games that are not ordinary. In the past year, I liked Halo, Rez, Ico and Jet Set Radio Future.
Matt: Porting a game to a platform is said to be far less rewarding than creating a new game, tailored for a specific platform. If you could return to the days of Lobotomy, with the experience you have now, would you have done anything differently?
Ezra: As an independent game developer there’s always a big difference between what you want to do, and what a publisher is willing to fund you for. So usually you end up doing stuff that’s lamer than you’d like. Nothing you can do about it really.
Matt: Any plans for a Death Tank Drei hidden in any of your games?
Ezra: No. I would like to make a stand-alone DT game someday though.
Matt: Thanks for taking the time to share your answers with me. And, as I’ve said before, thanks for the work on Powerslave, Quake, and Duke Nukem 3D… I know I enjoyed playing all three of them.
Yesterday I was reading through my RSS feeds, catching up with the world’s news and this one about the iPhone 4G on Engadget caught my eye.
Engadget had some (slightly blurry) images of what was supposed to be the latest version of Apple’s best-selling iPhone, reportedly found left behind at a bar in a 3G case. The whole article was written in a sceptical tone and an update at the bottom confirmed that the phone was indeed a fake. The update linked to a Twitter page that seemed to be home to several independent sources claiming the phone was a cheap Chinese knock-off.
The tone of the update was pretty bullish because they had apparently been offered time with the phone for $10,000, but had decided not to proceed because they suspected it wasn’t a genuine item. They then took great pleasure in informing the rest of the internet that in their wisdom they had not been fooled by any of it – and that pity should be bestowed upon anyone who had.
Well, what a difference a day makes!
The same phone has now turned up on Gizmodo, and not only do they have lots of hi-res photographs of it but they’ve also examined it inside and out to confirm that yes, it is genuine.
I thought Engadget’s smug proclamation of wisdom and (in this case unfounded) self-belief would look pretty stupid now, so I headed back over there to see how they’d taken the news that they had “done a Decca Records” and passed up the real deal.
I arrived at the site to discover that Engadget had removed ALL references to this phone being a fake and they had rewritten the update at the bottom of the page to say that the phone looked like a Chinese knock-off, but the smug statements were gone.
Not only that, but on another post dated the day after, Engadget declared, “Well, we told you so. The fourth-generation iPhone prototype that leaked its way out into the world over the weekend has found its way to Gizmodo, and they’ve examined it exhaustively, erasing any doubt that it’s real.”
Cyclomatic complexity is a software metric used to measure the complexity of code. Specifically, it directly measures the number of linearly independent paths through a method. Although not a rule, generally speaking the quality of the code can be inversely proportional to the cyclomatic complexity value, so the lower the score, the higher quality the code.
One of the best programs that I’ve found for quantifying this metric is SourceMonitor. This handy little freeware tool will give you the cyclomatic complexity of your classes as well as the individual methods within those classes so you can see exactly what requires attention in the event of a high score. It also gives other feedback too, such as number of lines of code and the number of methods per class among others.
Why should you care what cyclomatic complexity value your code gets? Well, apart from the warm glow you get inside from knowing that your code is well-written and elegant, there is a practical reason for it as well and that is the reduction of potential bugs. The more complex the code, the more difficult it is to keep track of what’s going on and the higher the risk of bugs creeping into your classes.
The accepted values for cyclomatic complexity are as follows:
1 – 10: a simple program with a very low risk of bugs
11 – 20: a more complex program with a moderate risk of bugs
21-50: a very complex program with a high risk of bugs
> 50: untestable and obviously a number you want to stay well away from.