Fine-tuning Urban Terror configuration on linux

This has actually been too long ago, but I’ll to reproduce accurately. 🙂

First of all, why would you need to configure your urban terror install on linux? Can’t you just extract & play like on windows? Yeah, you could. Except when:

  1. You’re using a recent libcurl (which is used for downloading new maps through HTTP).
  2. You’re using an azerty keyboard (or a keyboard map which contains keys that are unknown to ioq3).

Which is quite a lot of people, at least, in Europe. 😉

The first problem is very easy to solve. You could argue why the devs had to use the libcurl.so.3 hardcoded, instead of libcurl.so. Trust me, I did, and I rest my case. It actually doesn’t make much more sense or difference. The best way to solve this, is adding:

seta cl_cURLLib "libcurl.so.4"

to your autoexec.cfg in the q3ut4 dir.

The second problem is more complicated to understand the reasoning behind it because it has grown historically and mutated quite a bit. Originally, ioq3 used its own input handling methods. It contained a few hacks. Later on, ioq3 got ported to SDL. Which is fine by itself, but not if you need to translate to the legacy input system. Combined with a few hardcoded hacks for both console and non us layouts, it really became a mess. Which is the current state. 🙂 On top of that, IIRC, sdl receives different key strokes on windows when using the same non-us keyboard layout. So it “magically” works there. I guess this has something to do with windows being a game OS. 😉

Now, let me explain the symptoms.

The first thing you do after launching UrT, is reconfiguring your keys. Except, that doesn’t seem to work well. For example, ” does not get recognized, as such, my side arm is not available (unless you use the scroll button on your mouse of course). The console key is recognized as WORLD_18, but still, it doesn’t work. You can read a detailed progress report on how I solved this on Urban Terror forum, especially this particular post, revealing some interesting findings. 🙂

So all solved, right? No. Apparently, I didn’t think ahead enough. I managed to rebind all my movement and weapon keys, but what about radio commands? Those are not configurable! So again, I started digging in the UrT source. Unfortunately, loose end. But eventually, I realised configurable radio keys wouldn’t work since that would clash with the weapon buttons, unless some context could be given, which would require ioq3 modding.

So in the end, I reverted to the solution I liked less because it is more a workaround than a solution: just use a modified keymap when launching UrT. This can be easily automated like this (for a French azerty layout):

#!/bin/bash
xmodmap -pke > xmodmap_backup
xmodmap -e "keycode 49 = asciitilde" -e "keycode 10 = 1" -e "keycode 11 = 2" -e "keycode 12 = 3" -e "keycode 13 = 4" -e "keycode 14 = 5" -e "keycode 15 = 6" -e "keycode 16 = 7" -e "keycode 17 = 8" -e "keycode 18 = 9" -e "keycode 19 = 0"
./ioUrbanTerror.i386
xmodmap xmodmap_backup

For a detailed progress report and explanation of the solution, you can once more read up on a thread on the Urt forum. The obvious disadvantage of this solution, is that you can’t use the mapped keys properly when alt-tabbing (which works better than on windows, btw), neither when chatting. Also, when Urt would happen to crash (didn’t occur yet), the unmapping wouldn’t be executed (but you can still do that manually).

Note that this solution also applies to other ioq3 based games like Tremulous or World of padman.

Leave a Reply

Your email address will not be published. Required fields are marked *