RBJoy for Doom 3 – Tutorial
By:
GTX_SlotCar (Gary DeRoy) August 14, 2004
This tutorial will help you program Doom 3 for a CH Products F-16 Combat Stick and Logitech Marble Mouse Trackball (or any trackball) using RBJoy 7.3 (by Ralf Biedermann) for keyboard emulation. My Combat Stick is an older model with 5 fire buttons plus a trigger, one 4-way switch and a 4-way POV switch. Once you’ve learned how to program RBJoy for one game, it should be easy to program others. It takes about 5 minutes to do if you skip the step that labels the buttons. That takes another 10 minutes. You may want to make a default configuration to use as a base for other games. With a configuration file loaded, RBJoy7 uses 8,428Kb of memory on my computer and I don’t notice any difference in game frame rates whether the program is running or not.
Let’s get started. There’s no sense in having duplicate buttons for functions, like left mouse click and joystick trigger for shooting, so I changed some of the default keys in the game menu. Let’s change these now. You can either copy them on a piece of paper, or start Doom3 in a 640x480 window so you can switch between Doom3 and this tutorial on your screen.

You don’t need to empty an unused command, but hitting [Esc] will do it. The page up (PGUP) and page down (PGDN) are from the trackball buttons.

The next step is to calibrate your joystick. This simply entails pushing the stick to each corner of movement. You MUST also CALIBRATE the THROTTLE axis, and then leave it in the CENTER position. If you don’t do this, RBJoy will not setup well when setting "auto" to BAP.
Now, extract your downloaded RBJoy files to a familiar directory, like C:\RBJoy. Open the “Runtimes” folder and run Ksetup.exe. Create a desktop shortcut for rbjoy7.exe and click on it. A joystick icon will appear in your system tray. Double click on the icon and your first screen will appear.

Starting at the top, this screen shows that I have one joystick (or device) attached. The first radio button, “common”, is unchecked. We’ll use it later to bring us to a screen that let’s us tell RBJoy which game we want to run with this configuration file. The next radio button is checked. This shows that we are working on joystick “1” in normal mode. The third radio button, “S1”, is unchecked. It holds all the key assignments when you use the shift-button option in RBJoy.
The next section shows information about your joystick. This shows that I have a CH Combat Stick with 10 buttons, 3 axes and one POV.
Below that is the section for setting global, common options. These global settings can be changed individually later, if you desire. The section to the right is where you assign keys to the functions of your joystick. The radio button “common” is checked and that’s why we see the common options on the left side. The check box marked “auto” is what will make setting up a configuration file so easy. This section is broken down into 3 areas; buttons, axes and POV. My box shows 10 buttons, which is what my joystick has. Under that, it shows my 3 axes X,Y and Z. There are vertical radio buttons labeled A, X, I and S. We won’t be using the “S” radio button, but the A, X and I are for programming up to 3 sensitivity ranges for each axis. The last section is for POV. It shows 8 position buttons even though I have only 4. The P, O and V allow you to program up to 3 POV switches.
Now that you see how RBJoy is laid out, it’s time to start assigning keystrokes to your joystick. There will be plenty of pictures to help guide you through it. Go back to the top of your screen (in the “devices” section) and click the “common” radio button. The following screen will appear.

Click the “program” box, navigate to Doom3.exe and click on it. Doom3.exe should now show in the box. Next, click the “autostart” box. This tells RBJoy to launch your game. The name and number boxes are for future use, in the event that RBJoy ever requires registration. You can enter your name or the name of your configuration here if you wish. The “comment” box is for you to make notations. Later on, this may help you to remember things you’ve done. Here’s what my screen looks like at this point.

Notice under the “shift device” box it says “1”, indicating device 1 and shift button 4. The actual button I’ve chosen is 5 (the second trigger finger button), but this section of RBJoy starts the button count at 0, so it’ll always show one less. I chose this button so I could hold it with my index finger and use my thumb to push the other buttons. If you’re going to use the shift option, click on “shift device” now and choose device "1" and button "5" in the dialog box that pops up.

This will be a good time to save your configuration file. Click on the “save” button and navigate to your RBJoy directory. Make up a filename that makes sense, like Doom3 RBJoy.cfg. You MUST type in the .cfg extension. RBJoy does not add it automatically. Since RBJoy doesn’t display this name anywhere else, it might sense to type it in the name box instead of your name.
If you only have one joystick (or device) connected, click on the radio button labeled “1” and we’ll start configuring the inputs. If you have more than one device connected, choose the one that indicates the joystick you want to configure.

First we’re going to set up our joystick sensitivity. We’re given 3 ranges and can choose the amount of joystick movement required to start each range. I chose 7% as the starting range to give me a comfortable dead-zone around the stick. You can choose whatever settings you want, but 7%, 30% and 80% might be a good place to start. Do this now.
On the other side of the screen, you’ll see a box marked “auto”. Click on “auto” now until BAP appears next to it. This will make it so RBJoy detects your Button, Axes and POV functions. In our configuration, the only function that won’t be recognized is button "5", which we are using for our shift button. At this point, your screen should look like the picture above. Now, pull the trigger on your joystick, release it and type k on your keyboard.

Your screen should look like this. Notice that box labeled “text” has a check mark in it and the letter “k” beside it. Also, the “1” radio button now has a dot in it. RBJoy has recognized that you pushed joystick button 1. That’s how easy it is to program. Let’s do the rest of the buttons and POV now.
|
Push Button |
Push Key |
Button position on joystick |
Action |
|
BUTTONS (1) |
|||
|
1 |
k |
Trigger |
Fire (attack or Kill) |
|
2 |
[spacebar] |
Thumb rest |
Jump |
|
3 |
z |
Below 4-way switches |
Zoom |
|
4 |
c |
Pinky finger |
Crouch |
|
5 |
not used |
Index finger side button |
Used for shift function |
|
6 |
r |
Above 4-way switches |
Reload |
|
7 |
1 |
4-way switch |
Flashlight - weapon 1 |
|
8 |
2 |
4-way switch |
Pistol - weapon 2 |
|
9 |
3 |
4-way switch |
Shotgun - weapon 3 |
|
10 |
4 |
4-way switch |
Machinegun - weapon 4 |
|
POV |
|||
|
Up |
5 |
POV |
Chain gun - weapon 5 |
|
Right |
6 |
POV |
Grenades - weapon 6 |
|
Down |
7 |
POV |
Plasma gun - weapon 7 |
|
Left |
8 |
POV |
Rockets - weapon 8 |
As you can see, it only takes a few seconds to push the joystick buttons and hit a keyboard keys. It’s probably a good idea to SAVE the configuration again. Now we want to do the same thing for the shift buttons. If we don’t, game actions like walking will stop when we push the shift button. You’ll want to copy all the inputs above with the exception of the 4-way switch. Program that like this.
|
SHIFT BUTTONS (S1) |
|||
|
7 |
9 |
4-way switch |
BFG - weapon 9 |
|
8 |
0 |
4-way switch |
Chainsaw - weapon 0 |
|
9 |
q |
4-way switch |
Soul Cube |
|
10 |
f |
4-way switch |
Fists |
So, if you want to use the Chainsaw, you push the "5" button with your index finger and push the 4-way switch to the right (then release the 5 button).
Now we’ll do the axes. Each axis has 3 rates of movement. For simplicity, we’ll start with the normal walking speed.

Click the “X” radio button. Push the joystick forward. The “–Y” radio button should check itself as shown above. If the “Z” button is checked instead, you haven’t centered your throttle axis. Now type w on your keyboard. To program the other directions, pull the joystick back and type s, push it left and type a and push it right and type d. Click on the “S1” radio button and copy these movements to the shift functions.
Next we’ll program the movements for sprinting.

This is going to entail programming 2 keyboard items, the direction keys (w, s, a, and d) and the [shift] key. Click the “I” radio button now. This will program the last third of the joystick movement. Push the joystick forward, type w on the keyboard and then click the “SHIFT” box. Your screen should look like the one above. Now move the joystick backward, type s on the keyboard and click the “SHIFT” box again. Do the same thing for the Left (a) and Right (d) movements. If you make a mistake when entering keystrokes, just click the “clear” box and the text will be cleared. Click on the “S1” radio button and copy these movements to the shift functions. You might want to Save the configuration again.
OK, we’re on the final stretch now. The last thing to program is the slow-walk movements. This isn’t actually supported in Doom 3, but you can do it with RBJoy. Slow walk is something that you don’t use very often, but every once in a while it’s nice to be able to creep around corners.

We’ll start with the forward movement. Click the “A” radio button, push the joystick forward, type w on the keyboard and put a check mark in the “auto-repeat” box. These steps are mandatory, but the next ones are a bit of personal preference. You have to set a delay in the “delay” box. This will control how fast the slow movement is. You don’t want to set it too high because it will cause a noticeable delay when you push the joystick hard to get out of the way in an emergency. Anywhere from 3 to 20 ms seems to work well. You can re-adjust these settings later, but set it to 20ms for now. I also prefer to use ‘sprint ‘ instead of ‘walk’. It seems to give smoother movement and has less footstep sounds. Put a checkmark in the SHIFT box for now and you can change it later if you decide to experiment. The last setting is the ‘auto-release’ box. It’s intended purpose is to release a keystroke even though the key remains pressed, but I’m using it as a speed control. This is another feature that you can experiment with later, but for now, put a checkmark in its box. When you’re done, your screen should look like the picture above. Now program the other directions (backward, left and right) in the same manner, and also do the “S1” functions. Save your configuration again.
You now have a working configuration for Doom 3. You don’t need to label your button commands, but it’s a good idea to do it.

When you click on the “name” box, a dialog box opens as shown in the above picture. Since I wanted the command names in both the “1” and “S1” configurations, I entered a name, highlighted and clicked ‘copy’, then clicked “OK”. DON’T hit [Enter], use the OK box. Then I clicked the “S1” radio button, “name” and pasted the entry there. It went a little faster using the copy/paste for each function.
RBJoy will not work when it’s Open. You have to “close” it to have the keyboard emulation work. When you close it, it stays in the system tray. If you Quit RBJoy, it exits the program entirely.
When you want to launch a game, click your RBJoy shortcut. The RBJoy icon will appear in your system tray.

Right click the icon, bring you mouse to “Load config” and choose the game you want to run.
Congratulations, you’ve just programmed RBJoy. With a little bit of practice, you’ll be able to make a configuration file for most games in about 5 minutes, or 15 minutes if you label all the functions.
Optional items:
RBJoy has one command line option, and that’s “-QUIT”. Here’s how I used it.
You may want to have RBJoy launch with your computer and leave it in the system tray. After you’ve finished playing Doom 3, you may want to play Call of Duty, in which case you’ll want to release your joystick’s keyboard emulation (CoD supports a joystick within the game with the seta in_joystick “1” command). To release the emulation, you can create a new, blank configuration file. Have it load RBJoy and add the command line –QUIT in the box. It should look like this.
![]()
Don’t forget to check the “autostart” box. This works by running another instance of RBJoy, clears the keystroke emulations and then quits the instance so you’re left with a blank config running in RBJoy.
You can also use RBJoy to launch all your games, even those with built-in joystick support. Create a blank config file, point it to run the game you want, click the “autostart” box and save it in your RBJoy directory.
This tutorial is for a joystick and trackball, but Panther XL owners can use RBJoy also. If the game doesn’t recognize the PXL’s trackball, you can use the mouse emulation feature of RBJoy.

This is beyond the scope of this tutorial, but with some experimentation you should be able to figure it out.
My completed configuration file can be downloaded in .zip format HERE.
Tweaks & Reviews
Gary DeRoy, August 16, 2004