Wednesday, December 31, 2008

Wikipedia and the Deletionist

The Wikipedia Fundraiser 2008 has a nice little quote:

"Imagine a world in which every single person on the planet is given free access to the sum of all human knowledge. That's our commitment."

Sounds nice, doesn't it? Except that somebody should probably tell that to the deletionist that frequently delete all kinds of interesting topic because they are not noteworthy enough.

Tuesday, December 30, 2008

ThrustMaster Firestorm Dual Power 3 - Rumble

To get rumble to work on the ThrustMaster Firestorm Dual Power 3 gamepad (044f:b304) one has to send it a control message of the form (libusb syntax):

usb_control_msg(handle, 0x21, 0x09, 0x02, 0x00, { left_motor, right_motor, 0x00, 0x00 }, 4, 0);

Just figured that one out with USBlyzer, which seems a lot more robust then the Free Software alternatives like USB Snoopy, which used to bluescreen my box anytime I did something like unplugging a gamepad while it was running.

Edit: I just noticed that there are different versions of the Dual Power 3 gamepad ( 044f:b312). For this different version the rumble message is a little different (i.e. low/high bytes are flipped for value):

usb_control_msg(handle, 0x21, 0x09, 0x0200, 0x00, { left_motor, right_motor, 0x00, 0x00 }, 4, 0);

Monday, December 29, 2008

XFS is a piece of garbage

Even after disabling write cache on all my drives XFS continues to destroy files on a regular basis. After almost every single crash some files went missing and had to be recovered from backup (in case there was one). I fail to see the point of having a journaling file system and then having to run a restore from backup after every crash. Oh well, going to replace it now with good old ext3 and ext4 in the near future.

Sunday, December 28, 2008

3Dconnexion SpaceNavigator workaround for HAL

If you are using the latest Ubuntu you might have your SpaceNavigator work as mouse and be unable to be used properly by other applications due to the new hotplug handling, that is still rather broken for anything that isn't a mouse or keyboard, to fix this you can add the following lines to /etc/hal/fdi/policy/preferences.fdi:

<match key="input.product" string="3Dconnexion SpaceNavigator">
<remove key="input.x11_driver" />

After that Xorg will no longer touch the SpaceNavigator when it gets plugged in.

Friday, December 26, 2008

Prince of Persia "Triology"

Time for another round of game reviews, after finishing up with Tomb Raider (except Underworld, haven't played that yet) I moved on to the Prince of Persia "Trilogy", quotes are there since its really not much of a trilogy, but more like one great conclusive game with some garbage patched on. Anyway, lets begin, first in the row is:

Prince of Persia: Sands of Time (2003, PC)

A great classic that works nicely under Linux in Wine, not quite as perfectly as Tomb Raider, since it lacks widescreen support and loses a bit of performance in Wine, there also seems to be an issue with the bloom that seems off by a few pixels, but its still perfectly playable. Support for gamepads is also a little lacking, while the game itself works fine with one, the menus don't, they require a mouse. Those issues aside however its as good as it gets. Its one of the few games where story and gameplay go pretty much completly hand in hand, the level design is great, the graphics nice and the animation pretty. On top of that the game features a time rewind mechanic that has been repeated in numerous games since then. There really isn't much to complain about, games just don't get much better then this, so go play it if you haven't already.

Little sidenote: The game features as a bonus level the first level of the original Prince of Persia remade in 3D, it has no goal and is present in all versions. The PS2 version in addition features the whole classic 2D Prince of Persia game (in its original form, not as 3D remake), the PC version however does not. The wall you have to destroy to unlock it is indestructible.

Prince of Persia: Warrior Within (2004, PC)

On the technical side, Warrior Within has the same small problems as Sands on Time, but adds some more on top of it. It requires a no-cd crack to function in Wine and when you up the graphic detail level the picture ends up being upside down. Playing a bit around with the detail level and Wine configuration makes things playable, but still leaves a little upside-down artefact when one slows down the time. But since you don't run around in slow-mo all the time its completly playable from start to finish, you however lose quite a bit of graphical detail compared to Windows.

In terms of story Warriror Within pretty much is a 180 turn compared to Sands of Time. Where Sands of Time had depths, athmosphere, Warrior Within is just flat, dark and bloody. The dialog and story that made the first game interesting, is nearly completly missing here, the princes dialog is mostly down to a bunch of *grrrr* and *arrg* sound effects, the skill to say complete sentences seems to be gone missing in this part of the series. Neatless to say, this part doesn't really connect much at all to the first one, so if you are looking for a decent sequel, you won't find it here. On the positive side, the story features some classic time travel twist, nothing you haven't seen before, but a little fun in what otherwise is just a completle failure.

Ignoring all that and focusing on the game itself, it also has plenty of problems of its own. Unlike Sands of Time this game features a much more non-linear level design. While your progress is still linear, the levels allow almost complete backtracking, this more then once ends up being heavily confusing, since a wrong turn can easily have you running around in circles for half an hour. That the game features two time zones and actually requires backtracking on a regular basis only makes matters worse, since it gets much harder to figure out if you are actually on the right path or not. The game does feature a map, but its as useless as maps can be, since it gives no precise indication where you are, where you have to go or how you reach it. Its just a undetailed picture with your character and an X and those don't even get updated after every change room, so its near impossible to figure out anything from the map

I also found the fighting system to be pretty terrible. It is often taughted as one of the good point of the game, but I found the fights to be overly long and just plain annoying. Not sure if I just didn't get the combo system or what else might have gone wrong, but it just wasn't any fun meshing on the same enemies over and over again.

On the positive side of things some of the jumping and running is still fun. I however found it to be a little confusing this time around, distances seem harder to judge and the animation often doesn't seem to properly fit in, i.e. you have jumps that look like the prince shouldn't have made them, but you still end up sticking to the ledge. The locations are much less memorable then those in Sand of Time, but given how bad most of the rest is thats one of the smaller problems. In terms of graphics there was one nice level near the end that features some pretty smoke effects, with smoke getting blown away when you swing your sword, neat stuff.

Warrior Within also features some unlockable artwork, but unlike Tomb Raider, its very badly hidden. You have to find a bunch of tressure cheats that unlock it, but they are completly randomly places, so you have really no motivation to actually search for them, you just stumble upon them by accident every now and then.

Overall the game just wasn't much enjoyable and its probally best to just skip it and ignore it.

Prince of Persia: The Two Thrones (2005, PC)

Two Thrones is the last one in the series, and again it inherits all the technical problems of the predecessor and can be fixed by the same workarounds. Widescreen support is still lacking.

After Warrior Within Two Thrones however was a pleasant supprise. It is still nowhere near as good as Sands of Time, but it actually is a good game on its own. The level design is back to being linear and the map screen is gone. The game actually feels a little to linear at times, since often your path is predetermined by a number of 'jump-spots', leaving little room for exploration, but thats still better then the other end of the spectrum. Unlike Warrior Within it actually features a proper story and has plenty of in-game dialog again. Most of the overall story and even the ending is heavily inspired by Sands of Time, but thats ok, since that was really good and you have enough new things to keep it interesting. One thing where Two Thrones fails is the athmosphere, Sands of Time had a specific One Thousand and One Nights style athmosphere to it, while Two Thrones just feels like a relatively generic video game with swords.

The fighting is also back to normal and on top of that a little stealth-twist got added that allows quick kills of enemies when they haven't yet seen you, which works well enough most of the time. The vehicle sections that got added to this game on the other side feel pretty ridiculous and out of place, they don't ruin it, but neither do they add anything.

Overall, not a worthy successor of Sands of Time, since Sands of Time really didn't need one in the first place, but what Two Thrones does, it does quite well. The story keeps you entertained, the platforming is fun and there really isn't much to complain about.

Tuesday, December 23, 2008

XFS is eating my files...

Seems my XFS file system is a little hungry. Now three times after Linux crashed I found a few of my files with a filesize of 0 after the reboot, namely gconf database and Wine registry, both of which where likely opened at the time of the crash. The crashes themselves should be unrelated, since they look like standard OpenGL + instable driver issues and are more or less reproducible. Haven't looked that deep into the issue, but it looks like I have to replace XFS with something that doesn't destroy files that easily, since this is getting annoying.

Update1: As far as I understand the issue now:

- it is expected behavior
- it is caused by "write cache" being enabled and
- it is caused by "write barriers" not being supported by the device mapper

Solution? Disable "write cache" with hdparm it seems.

Update2: Even so I have disabled the "write cache" on my HDD, it seems I am still losing files on crashes. Gimp's recent files and Gnomes File-Dialog bookmarks have gone missing (~/.recently-used.xbel, ~/.gtk-bookmarks).

I really don't like this.

Tuesday, December 09, 2008

Tomb Raider: Legend (PC)

Just as Tomb Raider: Anniversary, Legend works near perfect in Linux in Wine. One additional issue issue is that the "next generation graphics" option doesn't work and causes plenty of graphical glitches which makes it unusable, so one has to play with the low graphic settings, which by the way is the same graphic quality that Anniversary had, which didn't have a "next gen" option. The water reflexions have to be disabled too. The game also only support "widescreen", not specific aspect ratio, so things end up looking a little stretched when you play 16:9 on a 16:10 monitor, but you get used to that quickly.

Unlike Anniversary, Legend follows a much more linear and story driven level design. Every now and then you end up in a larger room that requires you to solve a puzzle or two, but the game doesn't really feature any real branching of the level structure. This makes the whole gameplay more accessible, but also makes the puzzles quite a bit easier. The puzzles in Legend however make much more use of physics and much less use of item collections which is a welcome change.

One of the really interesting aspects of Legend is that it features radio communications throughout the whole game, so you always get background information and commentary about the locations that you are currently visiting. Legend also features a wide variety of locations, everything from Japanese skyscrapers to classic ruins is present. The Croft Manner is present as well and while not as complex is in Anniversary still fun to solve. In addition to the classic platforming Legend also features a few motorcycle levels, these aren't really great, but neither are they bad enough to really annoy.

Treasure hunting and the time trial mode are available as well. The time trial is a lot simpler then in Anniversary, since you don't have to spend much time searching for an optimal route through the level. The treasure hunting on the other side is a little tricker, since the treasures are spread out much more randomly throughout the levels and there are also much more treasures to hunt. Bonuses are again present in the form of cheats, costumes and artwork. Costumes are present in much higher numbers then in Anniversary, many of them are however just color variation of other costumes.

The main critique about Legend is certainly its length, the first play through is doable in just 7 hours. However with all the puzzle hunting and time trial one can easily boost that to 20 hours, so there is still tons of game in there if one just bothers to search for it.

Overall however Legend is highly enjoyable and due to its linearity quite a bit easier and accessible then Anniversay. It also features a much higher varity of locations. So while both games are a little different, both are in the end equally fun.

PS: Tomb Raider: Underworld, the sequel to Legend, doesn't seem to work in Linux, while the demo installs fine and runs, the graphics are all messed up, so that you can hardly see anything.

Tomb Raider: Anniversary (PC)

Some days ago I picked up Tomb Raider: Anniversary for the PC (yes, thats the old one, not the new Underworld). Its a standard Windows game, of course, but it actually works near perfectly under Linux in. No hacks or cracks requires, it works out of the box. The only issue I could find is that one has to disable reflections in the display setting of the game, since they cause some graphical glitches. Those aside the game runs wonderfully, it loads in seconds, runs fluently and supports all kinds of resolutions and aspect ratios, gamepad support is fine too and it doesn't even require a DVD in the drive.

Now to the game itself. Anniversary is a remake of the very first Tomb Raider game and as far as I can tell it stays pretty close to the original, while upgrading the core gameplay with what was provided by Tomb Raider: Legend. The core gameplay aside Anniversary however is quite different then Legend, mainly due to its level design. Anniversary doesn't follow a linear structure with lots of cutscenes like Legend, but instead follows the style of the original game which has has a less linear structure. The levels in Anniversary structure follow a structure like this, you approach a main room, from which multiple challenge rooms branch off. In these challenge rooms one collects items, keys or other stuff that is then used in the main room to advance or unlock other challenge rooms. While this feels a little old school as first, it actually works quite well and makes things more interesting when replaying levels the levels later. Another thing that makes Anniversary different from Legend is that Anniversary is limited to four scenarios, namely Peru, Greece, Egypt and Lost Island, with each of those having three or four levels. In addition there is the Croft Manor again, Tomb Raiders tutorial level, which is this time a little larger then in Legend and features more adventure style gameplay with item collection and use, which while using the same mechanics like the rest of the game is quite a chance in basic gameplay.

One thing missing in Anniversary is a form of light, Legend had a flashlight and flares, while Anniversary has nothing. Its not a big issue, since Anniversary is never really dark, but its a thing that could have given the game a little bit more interactiveness. Gone are also the binoculars and the quick access to the health pack, the later can kind of be fixed by remapping buttons a bit, but the way Legend used the Dpad felt more natural. The grapple on the other side is still present.

Another issue I have with Anniversary is the swimming, just like Mario Sunshine, it got changed from having full 3D control to having a swim-up and a swim-down button. I assume this change was made to simplify the gameplay, but I don't like it since it takes the fun out of swimming. Also the underwater graphics are a little lacking. The original Tomb Raider was very impressive due to the light effects it had under water, those are lacking here, which makes the underwater world look a little to much like the over water world. The water level itself is also a little hard to see, making it hard to judge the depth one is in. No big deal, but one of the few things that could have been done better.

On the first play through Anniversary takes around 10-15 hours, which makes it a good bit longer then Legend. While some of that length results from harder traps, some of which are quite meanly placed, most of it is simply the result of more complex levels, which require more exploring and don't follow the linear nature of Legend. The harder traps, while they can annoy a bit at first, are however never really a big issue, since one learns their pattern and has plenty of fairly placed checkpoints.

Just like Legend Anniversary features treasure hunting and a time trial mode. The treasures are additional optional objects places in the levels, sometimes quite will hidden. They are this time much rarer and much more intelligently placed as in Legend, which makes hunting them more fun and their rough positions easier to guess, i.e. when you have four treasures in a level with four sub-rooms its clear that one treasure is in each room. The time trial mode simply requires you to play through the levels with a given time limited, which due to the non-linear nature of the levels becomes quite interesting, since you have to hunt for the optimal route before you can start a time trial. Finishing a time trial or collecting enough treasures unlocks new costumes, artwork and cheat codes, which then in turn can be used to ease other time trial or treasure hunts. This constant stream of rewards makes the replaying of levels quite enjoyable, since one actually ends up using them while playing the game, which in turn chances the game a little bit to keep it interesting. Anniversary also features audio commentary for the levels that gets unlocked after the first play through and can be listened to when tressure hunting.

Another little thing that is worth mentioning is that Anniversary features, just like Legend, a few "useless" actions, namely a series of acrobatic flips that one can achieve by pressing the jump and roll buttons repeatable. While these actions are useless for practical gameplay, they make the game interesting in that they give the player something to play with when the game isn't actively challenging him. This is very similar to the double and triple jumps in Mario64, which also where in large part just there to give the player a chain of events to complete while nothing else was there to do. It is an interesting mechanic that one doesn't see all that often in other games.

The story of Anniversary is more simplistic then Legend and the game only features a handful of cutscenes and misses the all the radio communication that Legend had in the levels, which is a little bit of disappointment. But that little bit of story that is there is actually interesting and its focus on the morality of your action is something that isn't much seen in other games.

Overall Tomb Raider: Anniversary is a highly enjoyabel game, especially since it runs so well in Linux and thus doesn't require all the dual booting. While some elements of Legend are missing here, it has strength in different areas that were lacking in Legend.

Sunday, December 07, 2008

Friday, December 05, 2008

Making IPv6 work on Ubuntu, the quick and dirty way

One hears lots general things about IPv6 all the time, but not how to actually use it. So here a quick&dirty way to get it to work on a normal Ubuntu system. This works even when your provider does not support IPv6, since it sets up a tunnel via 6to4.

First some general explanations:

IPv6 addresses look like any of these:


The first four characters are important, 2001 indicates a global addresses reachable from everywhere on the internet, fe80 on the other side indicates a link local address reachable only from the local network. You can think of fe80 as an analog to style addresses (Edit: Actually the fe80 addresses are more like a IPv6 reachable MAC address then the addresses, unique local addresses seem to reassemble them much more closely). The /64 at the end indicates the netmask and isn't part of the address so you need to leave it away when trying to run ping6, ping6 being the IPv6 version of the classic ping command. The last few bytes of an autoconfigured IPv6 address are the same bytes as your MAC address of your network card, with some slight changes.

When you try to ping an IPv6 address on your local network you will realize that it doesn't work:

$ ping6 fe80::4e00:10ff:fe53:e8d7
connect: Invalid argument

The reason for this is that fe80 is a link local address and only valid for a single network, which means you have to tell ping6 which interface (i.e. eth0) it should use to contact the address, this can be done by:

$ ping6 -I eth0 fe80::4e00:10ff:fe53:e8d7
PING fe80::4e00:10ff:fe53:e8d7(fe80::4e00:10ff:fe53:e8d7) from fe80::219:dbff:fe5b:fa17 eth0: 56 data bytes
64 bytes from fe80::4e00:10ff:fe53:e8d7: icmp_seq=1 ttl=64 time=1.19 ms

Know with those basics cleared up its time to setup the 6to4 tunnel, first download the 6to4 script:
Then simply run the script:

$ ./6to4 up YourIPv4Addr eth0

If all goes right that is already all of it, you should know be able to connect IPv6 hosts such as

If you happen to run maradns you have to run contact instead, since maradns has a bug that doesn't allow it to resolve DNS aliases properly.

You can find out the raw IPv6 address via querying the AAAA record (which is the IPv6 version of the A record):

$ host -t AAAA is an alias for
$ host -t AAAA has IPv6 address 2001:4860:0:1001::68

If you are running this on your router and want your clients behind the router to have access to IPv6 you have to:

$ apt-get install radvd

on the router and configure it as described in the comment in the 6to4 script. Your clients behind the router should then be able to automatically discover the router and be able to access IPv6 addresses.

Note that this opens up the clients behind the router to the internet, so you likely want to setup some firewall rules with ip6tables, something like this might work:

$ ip6tables -I INPUT -i tun64 -p tcp --syn -j DROP
$ ip6tables -I FORWARD -i tun64 -p tcp --syn -j DROP
$ ip6tables -I INPUT -i tun64 -p udp ! --dport 32768:60999 -j DROP
$ ip6tables -I FORWARD -i tun64 -p udp ! --dport 32768:60999 -j DROP

For more indepth information you might want to have a look at the Linux IPv6 HOWTO.

PS: This little descriptions likely contains errors and is inaccurate, its just meant as a quick&dirty way to show that getting IPv6 up and running isn't that hard.