December 2003 Archives

Days like these...

| No Comments

On days like these, I realise why C++ is really not my preferred langauge any more...

Python is clearly the winner, and has been for some time. Python is so elegant, powerful and productive that when I hack in other languages I really miss it. These days, I think the ideal development model is to write mostly in Python, and then optimise the slow bits with a C module. Have a good separation between the 'engine' and the interface, so things are nicely reusable and embeddable. I would probably rather write in C than C++ anyway. Oh, and lots of Twisted stuff too. That is way cool... Oh, but -

But... I didn't mention why C++ is giving me the poos right now. I just spent (no, read wasted) a good hour on a bug that turned out to be an unsigned int being divided by a constant float and giving me -2.94e15 instead of just 25. Argh! More casts...

The good news however, is that this was the last bug standing between me and world domination. Ok, well not really, but my research code is now doing sensible things with resampling CT scans. W00t! I really should post some screenshots; I've even got some pretty 3D piccies now...

Or maybe I'll do that after I finish this paper. :/

America's Army - Fixing GL error on Linux

| No Comments

Here are some specifics of how I got AA to work on my machine... after the dreaded "GL_EXT_bgra not supported" error.


% ./armyops
GL_EXT_bgra not supported - bailing out.

History:

Exiting due to error


...

It turns out that a recent update overwrote the NVidia GL libraries (which were from the latest version).

First, check this:

% glxinfo | grep direct

If you get 'direct rendering: Yes' then you should be ok, but if it is No, then you need to reinstall your NVidia drivers.

Then as root, run this:

# nvidia-installer --sanity

This will perform a sanity check of the installed drivers and libraries. It was this that alerted me to the problem. If this doesn't check out all ok, do this:

# nvidia-installer -a -f --update

That will force an upgrade of the drivers, and make sure the right ones are installed.

(The above assumes you have set up XFree86Config-4 properly btw.)

Now restart X, and you should have the right drivers and libraries... Test with:

% glxinfo | grep direct
% glxinfo | grep GL_EXT_bgra

You should have both there now.

But there is still one more problem. For some reason, the installer puts libraries in /usr/lib/tls. So long as this is there, AA will not work. As per another suggestion in this forum, if you rename this directory to something else (eg. /usr/lib/tls_orig) then AA should work.

This last step bothers me, as I'm not sure why they put stuff in that dir in the first place. But it does seem to make it work...

Good luck!

America's Army - Getting started...

| No Comments

Having finished HalfLife (and desperately waiting for Hl2!) I felt like playing another FPS. So I jumped on a few Linux game websites, and discovered America's Army. It had some good reviews, and a native Linux version was available. So I took it for a spin... of sorts...

The first problem was the download. The whole thing is around 650Mb! Even on cable, that's a fair chunk of bandwidth. I went straight to a local mirror (PlanetMirror) and started the download in the background. For whatever reason, it was painfully slow (around 10-15kB/sec) so it ended up taking 15 hours to download! :/

Once I had it downloaded, I burned it to CD so it wouldn't take up valuable disk space. Then I installed it in a spare bit of space and went to run it. The wait was killing me... I was really looking forward to playing it. The install took ages, but finally it completed. So I fired it up, saw the splash screen, disk drive doing the rhumba, and then - it failed.

I got an error about an unsupported OpenGL extension, GL_EXT_bgra that was required. It bailed, and I was left with a big sad face. I went straight to Google, and found a few mentions of the same sort of problem but nothing specific to fix my problem. I checked the docs for the system requirements, and my video card was supposed to be supported. I checked 'glxinfo' and sure enough the extension wasn't listed. I checked for a newer version of video driver, but I had the latest already (an NVidia).

I headed over to the forums on AA, and there were several people complaining of the same problem but no concrete solutions. A few well-meaning people offered random suggestions, but nothing conclusive. I went back to scratch, checking docs, drivers and so on. Then eventually I thought I'd better check the driver again. One fishy thing of note - the glxinfo output mentions "Direct rendering: no"...

I uncovered a little-mentioned feature of the NVidia installer, a switch called (curiously enough) --sanity that would do a sanity-check of your system for the installed drivers and OpenGL libraries. I ran this and sure enough, it said the libraries were out of date with respect to what it was expecting to see (or had installed).

I realised that a recent Debian update had overwritten the NVidia libraries (with the glxmesa package), so I forced an update, reinstalled and - voila! I restart X, check 'glxinfo' and I now have direct rendering enabled, and most importantly the GL_EXT_bgra extension supported.

I then fire up the game, and this time it works! I complete basic training (only 7 misses on my first try) and then - alas! - it's time to go to uni...

So this really isn't a review of the game at all. More a document of my experiences, so that someone else with a similar problem can (hopefully!) fix it quickly.

(System details: Debian sid, NVidia GeForce 2 Ultra 64Mb, drivers 1.4 4496).

Now using GnomeBlog...

| No Comments

Now using GnomeBlog...

I have just installed GnomeBlog. Hopefully it will work well with Drupal.


It provides a basic interface for posting blog entries without a web browser. It uses the XML-RPC interface and the BloggerAPI (with a MoveableType backend as well).


We Will Rock You!

| No Comments

The stage show "We Will Rock You" Queen & Ben Elton is now playing at the Regent Theatre in the heart of Melbourne. Recently I went to see it, and I was blown away...

(No spoilers in this review.)

The first thing that struck me was the theatre. The Regent, in the heart of the city (Melbourne), was closed for many years. It was by all accounts a glorious theatre in its heyday, and it has had a very checkered past. In the 90's it was renovated and restored to its former glory. And glorious it is! There is an interesting history with many pictures available that show the old and new theatre, as well as some detail about the Wurlitzer organ installed there.

We had a drink in the foyer, then went in with th bell. We had amazing seats (middle of the stalls, 7 rows back) thanks to Mum who did the booking. The seats were very comfy and we had plenty of leg room. As the photos above show, the interior of the theatre is gorgeous. We settled in and very soon the show began.

The story was written by Ben Elton, in collaboration with Queen who adapted the music. Hit after hit from their phenomenal repetoire is weaved into the storyline. The story is set in the far-off future (although not so far off in many respects) where culture is homogenised, and music is a plasticised mass-produced product controlled by Megasoft Corporation. Instruments are outlawed, but there exists still an underground group known as the Bohemians, who still remember Rock. (Well, sort of.)

The writing is snappy, there are plenty of gags, black humor, cultural references, and lots of piss-taking of the industry. When Elton isn't being wry or cynical, he is painting a picture of a society we could well find ourselves living in the future. The signs are already here, with boy-bands, media control, corporatisation of entertainment, software monopolies... The dystopia is not as far off as people might like to think. Or maybe they don't, and that's the problem.

Anyway, the music is fantastic. Strong performances by virtually all the cast, and a live backing band who are obviously long-time Queen-heads. I was expecting to be disappointed, but the music really did (for the most part) do Queen's oeuvres justice...

The staging was just as impressive. The sets were cleverly designed, with impressive lights, lasers and huge digital screens with 3D animations and so on.

So I guess it is an all-round crowd pleaser. If you like Queen's music at all, you will love the show.