Alastair’s Place

Software development, Cocoa, Objective-C, life. Stuff like that.

Portable Computer Games

Groklaw recently ran a poem by Scott Lazar about leaving Windows (for one of the Open Source operating systems). One of the posts in response to that pointed-out that a major factor preventing people from leaving Windows for other operating systems, including Mac OS X, was the availability (or rather lack of availability) of computer games; currently, an awful lot of games are released only on the Windows platform.

That got me thinking… how hard is it really to write a portable game? Games developers commonly claim that they don’t have the time or inclination to port to the Mac, and that it would cost too much. That, however, seems like an odd position to take, given that there are 9 million users of Mac OS X, and another 10 or so million on Mac OS 9; assuming U.K.-like pricing, we’re talking about anything up to £700 million of potential sales (that’s about $1.2 billion at current exchange rates). Is it really that costly to do a port?

It’s even more galling, in a way, because most of the portability issues have already been addressed; indeed, both id software and Epic Games Corp, the makers of the Quake and Unreal families of games software, have solved the problem of writing portable computer games. And the Open Source community has gone a long way towards helping realise this kind of thing, releasing a large number of portable libraries that can be used for games development.

Anyway, I’ve written a short article detailing some common mistakes that people might make in this context, as well as providing lots of useful links. I doubt anyone will take any notice, but we can always hope.


Update 2011-10-14

Since I wrote this, the situation has changed markedly, and many more games developers are actively writing portable code and/or explicitly targeting the Mac platform. It no longer seems terribly necessary to have the original article around, since there are plenty of better resources on the Internet.

Joking at Airport Security

You know, I really thought that the UK was the only country stupid enough to do something as daft as arrest someone for making an obvious joke when asked about the contents of their luggage at an airport. I am, of course, referring to the unfortunate American who, as a citizen of Chicago, joked to airport check-in staff that he had a gun in his violin case. He even showed the woman in question the contents of his violin case (a violin, of course), but, despite this, she still called the police, who arrested him, held him for 24 hours (causing him to miss his flight), and had him banned from all future flights with that airline and a number of others.

The level of stupidity required to do this is, frankly, beyond belief. First and foremost, the incident, which was recorded as part of the BBC’s Airport series, was obviously a case of a harmless joke. For one thing, everybody knows that stereotypical Chicago gangsters from the days of Prohibition keep a tommy gun in their violin cases. For another, the man quickly explained that he was joking, and opened his case to prove it. If I were in charge of the check-in staff, I would probably have sacked the woman on the spot. If I were in charge of the police officers who thought it appropriate to arrest the individual in question, I would probably have severely reprimanded them for their behaviour.

But now, it seems that the United States is also afflicted with the same problem; according to this story from the BBC News site, a Briton, Ms. Samantha Marson, was arrested in Miami for joking that she had three bombs in her bag. I imagine that it was probably obvious that she was joking. For one thing, no suicide bomber or terrorist is going to tell airport staff when asked that they are carrying a bomb; if they were that stupid, then they wouldn’t have been able to get their hands on one in the first place. No, this is sheer bloody-minded idiocy, just like the similar incident with a U.S. citizen in the U.K.

Sergeant Joe Wyche, Detective Robert Williams and whoever else are responsible for this stupidity should be suspended. At once. Clearly if they feel that an appropriate response to a joke is to arrest someone and threaten to take away their freedom, not to mention waste an enormous amount of court time and other resources in doing so, then they are not fit to be in public office. The same goes for any law-maker that thinks that making it illegal to joke about the contents of one’s bag is a good thing and will do the slightest bit to combat terrorism. Terrorists won’t tell you they are carrying a bomb or a gun. The only people that might are members of the public making an innocent joke, and if someone can’t distinguish the two, then it seems to me that they shouldn’t be working in airport security on either side of the Atlantic.

The only purpose served by this sort of thing is to make the rest of the world laugh even harder at American and British stupidity. Come on people, let’s have some common sense.

Nearly There!

Today was a major milestone in my project… the basic GUI functionality is now done! I’ve already completed my command line app., so the vast majority of my first product is now pretty much done (I just need to do some polishing and testing).

I have thought of a couple of additional things that I’d like to have before the first version that I actually ship, but they’re fairly minor and should be pretty easy to do.

And there’s a manual to write :-)

Anyway, I’m getting quite excited, because I’m rapidly approaching the part I’ve never done before… that is, starting a company and actually marketing and selling something. I don’t yet know how well my product will sell (although I do have some facts and figures, so I have a few ideas), but then even if it doesn’t do all that well, I think there’s a good chance I’ll be happy enough. Still, we’ll see :-)

Spirit and Opportunity

It’s nice to see a mission to get something to Mars actually go to plan; we haven’t been doing too well in recent years, what with Beagle 2 (which still hasn’t been found, although Colin Pillinger and team still haven’t given-up hope) and the disastrous 1999 NASA missions, Mars Climate Orbiter (which is believed to have burned-up in the thin Martian atmosphere), and Mars Polar Lander, which was lost together with its sister mission, Deep Space 2.

Anyway, Spirit has landed on Mars and has already sent-back some awesome pictures, which NASA have placed on their Mars Exploration Rover Mission website.

I have to admit feeling sorry for the Beagle 2 team, especially Colin Pillinger, who turned the mission into a personal crusade to show that we (in the UK) really could do this. Along the way they have made some remarkable achievements, especially in terms of miniaturising the scientific instruments so that Beagle could come-in under the tight weight-limit imposed by constraints on the launch vehicle. All, of course, in stark constrast to the comparitively well-funded American effort, whose rovers cost somewhere in the region of half a billion dollars to develop.

It’s a shame that the British government hasn’t shown more of an interest in space; at more than one point in the past, we have had world-beating technology, only to be stymied at the last minute, usually by a complete lack of interest from the establishment… Black Knight and HOTOL are probably the most prominent examples, but there are others too (see the excellent article “What went wrong with Dan Dare?”, written by Dave Wright and Nicholas Hill for History Today magazine—for those that don’t know who Dan Dare was, take a look at www.dan-dare.net and www.dan-dare.org.)

Having said all that, it is interesting to note that, despite strong competition from the United States in the form of Boeing and Lockheed Martin, the French Arianespace company still manages to dominate the commercial launch services market, attracting over 50% of the global market for geostationary satellite launches. So at least Europe isn’t doing too badly as a whole, even though we only spend one quarter as much as the U.S., per capita, on space exploration and research.

Still, who knows… the growth of amateur rocketry in the U.K., coupled with the enthusiasm drummed-up by the likes of Colin Pillinger, may yet see Britain re-entering the space race, albeit in a rather unusual manner.

Automatic Fines for Late Payment of Road Tax?
Yet Another Stealth Tax?

I just read on the BBC News website about the change in the road tax rules in the UK that has come-in today. It seems that now, if we fail to renew our road tax within 14 days of the previous tax disc expiring (even if we do not use our vehicle on the road during that period), we will be automatically fined £80. Nice.

I don’t object to paying the tax—and I have always paid on time, although I imagine that at some point in my life I may very well forget or be otherwise occupied and as a result miss the new 14-day deadline. No, what I really object to is the guilty-until-proven-innocent attitude that is taking hold in the bureaucracy at the centre of the British government. What they are saying is that if we fail to renew within 14 days, they will presume we are guilty of attempting to evade road tax and they will fine us. I suppose if we complain we will probably be told that we should be thankful that they deign to remind us that we need to pay it… after all, they don’t bother for the M.O.T., arguably a far more important event in the annual life of a motor vehicle since it is the M.O.T. that is the government’s mandatory test of roadworthiness.

Of course, the cynic in me says that they have statistics on the number of people who renew within various time periods after the reminder and have decided that £80 times the number they will catch with this new rule is about the amount of money that they would like to bring in. Actually, the realist in me says that too. This isn’t anything to do with catching tax evaders; it’s a cynical attempt to impose an additional tax on the people they know full-well will occasionally forget or be delayed in renewing their road tax.

The thing is that, assuming that they can fine people automatically, they could just tax them automatically instead. But that would deprive them of their additional revenue. And it would be far too convenient for road users as well as entirely fair.

Personally, I don’t believe that there is ever a place for automatic fines; they will always catch-out a number of people who never intended to do anything wrong… indeed, I suspect that in many such systems, these people are in the majority. They breed unnecessary resentment and simply cause stress for all involved. The powers that be often institute “appeals” mechanisms to right such wrongs, but they know full-well that the majority of people would be discouraged from appealing, whether because of a desire to forget about the whole unpleasant business as quickly as possible, because they do not see a hope that they will prevail, or simply because they don’t have the time.

End of the PC BIOS?

Intel, it seems, have plans to finally dispose of the quagmire of unmitigated awfulness that is the PC BIOS. The BIOS, which is responsible for starting-up all PC-compatible machines, testing and initialising hardware and booting the actual operating system, has been around since the very earliest days of the PC, and, largely as a result of technological progress during that time, has accumulated a myriad of bodges, hacks and additional interfaces to provide access to newer hardware whilst retaining backwards-compatibility with software written for earlier systems.

What I find slightly odd, however, is that Intel has chosen to develop its own system, known as Extensible Firmware Interface (or EFI), rather than adopting the existing industry standard, IEEE 1275 Open Firmware, as used by Sun, Apple, IBM, Motorola and others. This seems a shame, particularly as Open Firmware is already established as a solution to the problem of processor/system-independent initialisation of PCI (and other) devices; indeed, it has been around since the days of S-BUS (see this article in Byte magazine and Matthew Johnson’s Open Firmware page).

By adopting Open Firmware on the PC platform, Intel would have flattened the market for PCI hardware to the extent that boards intended for RISC workstations would function properly in PCs and vice-versa, resulting in more competition and lower prices for owners of Macs, Suns, and other RISC-based machines… conversely, by insisting on yet another proprietary solution (which will, no doubt, become a de-facto standard, most probably through nothing more than the market dominance of EFI’s supporters), they maintain the artificial and unnecessary distinction between PCI cards developed for the RISC world and the Wintel oligopoly, forcing prices up for owners of non-Wintel systems as well as increasing costs for PCI card vendors (who now have three separate sets of drivers to write… x86 binary, Open Firmware FCode and EFI Byte Code).

It has been suggested that one of the major reasons that Intel and Microsoft are supportive of EFI is that it forms part of their plans for the Trusted Computing Platform (see the Trusted Computing Group site), where your computer is trusted by them to restrict your access to information.

The question that we (the computing community) should be asking ourselves here is why it is that we need yet another proprietary technology, and why existing tried-and-tested, standards-based solutions are not the appropriate solution in this case.

Are We Really Real?

I’m sure everyone that has watched the Matrix has experienced that moment of panic when they realise that they might not be in the real world. In fact, they might not even be real. I’d been thinking along these lines for quite some time when the Matrix arrived on the scene, so I was rather amused at the reactions some people seemed to have when they realised that they had no way to tell whether or not what they saw around them was the “real” world.

Anyway, you might say, that makes me pretty strange, but why am I telling you about this? Well, BBC2’s excellent Horizon programme this evening was about time machines. The universe, it seems, has something of a love/hate relationship with time machines; it may be possible to build them (whether you use rotating black holes, pairs of cosmic strings or just very large rotating cylinders is up to you ;->), but it appears that even in the solutions to the equations that allow such ridiculousness, you would be unable to travel to a time before such a machine was built. Which seems rather pointless.

OK, so what has this to do with whether or not I’m real? I mean, that was the title of this piece, right? Well, in rather an interesting twist, it appears that the easiest way to get back to the past may well be to simulate it. Yes, that’s right, simulate it. If you assume that Moore’s Law continues to hold, then it will eventually be the case that we will have a computer powerful enough to simulate (at the very least) sizeable areas of our universe. Furthermore, assuming Moore’s Law still holds at the point at which such simulation becomes practicable, then within a very short amount of time it will be possible to perform it routinely; indeed, within a few tens of years, there would be billions of such simulations. Given that our descendents have an interest in the past, it is reasonable to assume that some of these billions would be detailed replicas of our time. Including us, or at least, models of us that insisted ‘til they were blue in the face that they were conscious, and replicated our behaviour down to the finest detail.

The stunning conclusion of this intellectual exercise is that there will be more simulations and hence more models of us than the single original version, and that is before you start counting simulated simulations and so on. That is, the chance that we are real is actually vanishingly small. It is much, much, more likely that we are not!

I have to confess, I would not be the least bit surprised if the scientists and philosophers responsible for these intellectual acrobatics are correct. Indeed, I wonder whether we may already have stumbled across the evidence with which to back-up this bizarre claim; as we investigate the sub-atomic depths of the universe, it seems we keep running across strange phenomena, things like uncertainty, quantum tunnelling etc., many of which strike me as rather convenient properties if you wanted to simulate the universe… that is, they generally appear to be artefacts that would allow the universe itself to hold less information than it would otherwise have to, whilst providing a high level of overall accuracy.

So, perhaps, the real universe is the only one without unusual quantum effects. If so, then we are certainly not in it.

Perhaps this is also the reason that it is so hard to unify quantum physics with Einstein’s relativity… perhaps it is the case that the simulation simply isn’t consistent.

More DHCP and Mac OS X

John C. Welch has written an excellent article on the DHCP vulnerability, explaining why the issue isn’t specifically a Mac OS X security hole, and, indeed, that it exists already on the PC (which is what I implied in my post a few days ago). John, however, went into considerable detail on the DHCP side of things.

So, if, as a Mac owner, you are faced with someone crowing over this vulnerability, I suggest you point them at John’s article and let them digest it in full. You could also point them at mine at the same time, which explains why Mac OS X is indeed, as we Mac users have claimed all along, inherently more secure than Windows.

The Big Read

The BBC have, over the last year, been running a public vote on Britain’s favourite book (or books); needless to say, J.R.R. Tolkien’s The Lord of the Rings won by a comfortable margin (although sadly I suspect, more because of the popularity generated by the film than on its merits as a literary epic). I was also pleased to see Douglas Adams’ The Hitchhiker’s Guide to the Galaxy in the top five, not least because it is somewhat less serious than the majority of the other books in the 21-book shortlist (why 21, I don’t really know… evidently the BBC, like God, moves in mysterious ways).

I do think the competition was a bit pointless in many respects though. For one thing, there are an awful lot of truly excellent books out there. For another, I think that so-called “classics” got more than their fair share of the vote. I would be the first to acknowledge that many of the books regarded as classic works are very good, but I think there are a lot of good books out there by authors who perhaps have been overlooked, not having the advantage of being lauded as one of the greats, nor able to generate the vast publicity produced by the Harry Potter or Hollywood marketing machines. Some of my favourite authors, ranging from the science-fiction authors Isaac Asimov and Alastair Reynolds through to such able comedic writers as Tom Sharpe and P.G. Wodehouse were entirely absent from the top 200. Of course, the vote was about the most popular book, rather than the best book, but even so, it’s sad that so many wonderful authors failed to make an entry in the top 200.

Still, The Lord of the Rings was voted the favourite of the British public, so I can’t complain too much (it is one of my favourites, and was long before the film popularised it).

Computers! Bah, Don’t Talk to Me About Computers.

One thing I really hate is when people discover that I work with computers, they always seem to want to start conversations about them. I would much rather talk about something else (anything else), unless the other person has something genuinely interesting to say (doubtful unless they’re a techie themselves or it’s an observation about how people interact with machines).

Even more annoying is when people tell me that I only ever talk about computers, which simply isn’t true. Usually the people who say this to me are those who only ever speak to me if they want to talk about computers (that is, it’s them starting conversations about the wretched things ;->). Yes, I find technology fascinating, but I find lots of other things interesting too… and given that computer software is what I do for a living, I would far rather be talking about art, astronomy, literature, music, politics, religion or indeed just about any other branch of human endeavour.

So, please, World, don’t talk to me about computers, unless either:

  1. You have something interesting to say, or

  2. I start talking to you about them (which I won’t do unless I think you’ll be interested by what I’ve got to say).

By the way, for the record, the absolute most annoying conversation about computers that you can try to start with me is the one where you begin with some fatuous remark about how utterly amazing Microsoft software is.

Remember, I’m a software developer, and a fairly knowledgeable example of the species at that (well, so I’m told, anyway); I don’t find very much that computers can do amazing, because I know more about how they work than any sane person would ever want to. I find some things that people can do with computers amazing (3D animation, for example, or modelling the physics of a star; even the latest crazy user interface feature from the likes of Apple or Sun), but when you understand how they work from the transistor up, office software and operating systems are very mundane and not really terribly interesting, especially in the context of “Aren’t Microsoft products great?”.