Multiple joysticks (Windows)

News and discussion of the PC port of Oolite.

Moderators: another_commander, winston

Post Reply
SilverBullet
Poor
Poor
Posts: 4
Joined: Fri Jan 25, 2013 2:47 pm

Multiple joysticks (Windows)

Post by SilverBullet »

Hi everybody,
I've been playing Oolite for a couple of years now on various Linux systems without having any major problems.

Now, today I visited a friend of mine and somehow the direction of our conversation slowly drifted towards Oolite. I explained to him how great it is and how much time one can spend playing it.

Problem is (and that's a major one) he's a Windows7 user.
Anyway, I installed the software, fired it up and it was running fine...

...except for a minor roadblock which I couldn't overcome.
His joystick #1 is a Thrustmaster TH8RS 8-speed H-pattern gear shifter.
Joystick #2 is the 'real' one we were trying to configure - and couldn't.

The Configuration window showed Stick1 as the Thrustmaster shifter and there was no way to toggle to joystick #2.
That wouldn't be a problem at all on a Linux system, but here on Windows it was a show stopper.

Here's the question: How do I solve this problem?
I did reconfigure a couple of keys in the 'GNUstepDefaults' file, but that's just an ugly work-around. A soon as someone without inside knowledge tries to remap a button or axis in game, then the configuration is lost.

Any suggestion would be appreciated.

Thanks a lot.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6547
Joined: Wed Feb 28, 2007 7:54 am

Re: Multiple joysticks (Windows)

Post by another_commander »

SilverBullet wrote:
The Configuration window showed Stick1 as the Thrustmaster shifter and there was no way to toggle to joystick #2.
That wouldn't be a problem at all on a Linux system, but here on Windows it was a show stopper
Can you please expand on this a bit? Why would it not be a problem on Linux? Do you mean that it wouldn't matter if Stick #2 couldn't be configured or that there is an in-game way to configure it in Linux that doesn't work on Windows?

Also, maybe I am stating the obvious, but need to be sure: Did you try moving the second joystick when configuring, regardless of what was displayed as stick number on the screen?
SilverBullet
Poor
Poor
Posts: 4
Joined: Fri Jan 25, 2013 2:47 pm

Re: Multiple joysticks (Windows)

Post by SilverBullet »

another_commander wrote:
SilverBullet wrote:
The Configuration window showed Stick1 as the Thrustmaster shifter and there was no way to toggle to joystick #2.
That wouldn't be a problem at all on a Linux system, but here on Windows it was a show stopper
Can you please expand on this a bit? Why would it not be a problem on Linux? Do you mean that it wouldn't matter if Stick #2 couldn't be configured or that there is an in-game way to configure it in Linux that doesn't work on Windows?

Also, maybe I am stating the obvious, but need to be sure: Did you try moving the second joystick when configuring, regardless of what was displayed as stick number on the screen?
Certainly:
On Linux I just simply use:

Code: Select all

export SDL_JOYSTICK_DEVICE="/dev/input/js[0-9]"
to select the appropriate joystick even before the game is started.
Or:
I use udev rules to name them as needed.

To answer your second question I need to give a bit more information.
Attached to the Windows PC is a Force-Feedback wheel with pedals, a gear shifter and a joystick.
For reasons unknown to mankind the order of HID devices is:
1: Thrustmaster TH8RS
2: Joystick
3: Force-feedback wheel and pedals
To make things more complicated, Windows does not let you change the order.
If I remove any one of them, the assignments (joystick numbering) in the various racing simulations are all messed up, which means endless hours of work just to get it back working. Been there, done that, it's a bloody Windows mess.
So unplugging or removing them is not an option.

Now, back to Oolite:
in the Joystick configuration menu Stick 1 is shown as the Thrustmaster TH8RS.
I was able to remap buttons to the TH8RS, for instance
'fire laser' on '1st gear' , another function to '2nd gear' and so on.
I was not able to map either buttons or axis to the joystick.
Moving the joystick or pressing the buttons didn't provoke any reaction within the config menu.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6547
Joined: Wed Feb 28, 2007 7:54 am

Re: Multiple joysticks (Windows)

Post by another_commander »

Not sure why the game would not respond when moving the second joystick. I believe it should.

In the below screenie, I am using VJoy (I don't have a physical joystick to check, let alone two!) and have two virtual joysticks installed. It should function in the same way with a normal stick too.

As you can see, I have set main weapon to "Stick 2 button 1" and Yaw to "Stick 2 axis 1". So I would expect Oolite to be able to see and recognize input from any joystick connected to it. Note, that the label "Stick 1" at the top left is kind of misleading and could probably be removed to avoid confusion.

Image

All I can think of suggesting is: Make sure you have pressed enter and the game is awaiting joystik input, then move any stick #2 axis or button as required. What you see above is what it should be like. If not, I'm afraid we will need a setup like the actual hardware in order to be able to check.

Also, note that Oolite recognizes 2 joysticks maximum. It is not quite clear what happens if more than two are connected at the same time and I believe this to be the case for Linux as well.
SilverBullet
Poor
Poor
Posts: 4
Joined: Fri Jan 25, 2013 2:47 pm

Re: Multiple joysticks (Windows)

Post by SilverBullet »

another_commander wrote:
Not sure why the game would not respond when moving the second joystick. I believe it should.

In the below screenie, I am using VJoy (I don't have a physical joystick to check, let alone two!) and have two virtual joysticks installed. It should function in the same way with a normal stick too.

As you can see, I have set main weapon to "Stick 2 button 1" and Yaw to "Stick 2 axis 1". So I would expect Oolite to be able to see and recognize input from any joystick connected to it. Note, that the label "Stick 1" at the top left is kind of misleading and could probably be removed to avoid confusion.

All I can think of suggesting is: Make sure you have pressed enter and the game is awaiting joystik input, then move any stick #2 axis or button as required. What you see above is what it should be like. If not, I'm afraid we will need a setup like the actual hardware in order to be able to check.

Also, note that Oolite recognizes 2 joysticks maximum. It is not quite clear what happens if more than two are connected at the same time and I believe this to be the case for Linux as well.
Ahh, thanks for the info regarding the 2 joysticks maximum.

I guess, the next time I'll be at my friends Win7 system I'll have to do a partition image backup (dd) and then I'm free to mess with the joystick settings. Right now there're three of them which could explain the problem.

Might take two or three days, but I'll certainly let you know the results.

And now for something completely different:
I just upgraded Oolite on my Debian Jessie system and discovered something interesting.
The current stable 'oolite-1.82.linux-x86_64.tgz' version has a problem when running unmodified on said Debian Jessie system.

The 'libopenal.so.1' residing in the 'oolite-deps/lib' causes massive error logs and 100% CPU utilisation when toggling a couple of times between fullscreen and window mode.

Code: Select all

AL lib: (WW) alc_initconfig: Failed to initialize backend "pulse"
AL lib: (EE) ALSANoMMapProc: available update failed: Datenübergabe unterbrochen (broken pipe)
...repeated constantly at a very high rate
Renaming (or deleting) the library 'libopenal.so.1' fixes the problem completely and let the game run smoothly. No more error messages.

Might be worth a short notice in a README.
Commander_X
---- E L I T E ----
---- E L I T E ----
Posts: 664
Joined: Sat Aug 09, 2014 4:16 pm

Re: Multiple joysticks (Windows)

Post by Commander_X »

SilverBullet wrote:
On Linux I just simply use:

Code: Select all

export SDL_JOYSTICK_DEVICE="/dev/input/js[0-9]"
to select the appropriate joystick even before the game is started.
You can do the same in Windows 7:
Control Panel/Hardware and Sound/Devices and Printers/[Right click a joystick/game controller, select "Game controller settings"]/[Click "Advanced..." button, to open "Advanced Settings" dialog]/[Select the preferred device in "Preferred device:" drop down]/Close all the dialogs by pressing their "Ok" button
Whew, you had to type less for the Linux solution.
Hope this helps!
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6547
Joined: Wed Feb 28, 2007 7:54 am

Re: Multiple joysticks (Windows)

Post by another_commander »

Together with the tip from Commander_X (or even before trying that), you may want to give a try to this test build: https://drive.google.com/file/d/0BwG6R5 ... sp=sharing

It is a 64-bit 1.82.1 binary (basically 1.82 with plenty of the known bugs fixed), built with support for four joysticks, but not tested. You can place it inside oolite.app, substituting the original exe (backup yada yada etc) and seeing if the middle joystick plays any better.

Edit: And, while at it, here is the fast version of Commander_X's tip:
1. Press <WinKey>+R, it opens the Run dialog.
2. Type joy.cpl in the dialog, press enter.
3. In the new dialog that pops up select Advanced, select the stick you want to make the default and OK everything.
SilverBullet
Poor
Poor
Posts: 4
Joined: Fri Jan 25, 2013 2:47 pm

Re: Multiple joysticks (Windows)

Post by SilverBullet »

Alright, here's the report I promised.

Visited my friend today and test Oolite again.

1) Checked whether the aforementioned problematic behavior still exists. ☑☑☑
2) Saved the original oolite.exe.
3) Copied the 1.82.1-4 Version into the appropriate folder.
4) Started the thing.
5) Went into the configuration menu and it worked like a charm.
Configured the entire joystick without problems.
Wanted to insert a Screenshot here, but didn't find a proper way to do that.
6) Quit the game and switched back to the old version to check whether the problem reappears.
7) Couldn't, because oolite didn't want to start again. Probably because some config file has changed and is now incompatible with the original executable.
Checked everything a second time, the behavior was consistent.

Anyway, that's not a problem at all, because the 1.82.1-4 version works as intended.

Thanks for all the help, I really appreciate it.

Now, as a long time Xenix/SCO Unix/Solaris/Linux user I feel I have to comment on the suggestion regarding the Windows joystick configuration:

Point Click Click Click Point Select Click Click...
And if one wants to revert because another game needs to be started:
Point Click Click Click damn, Esc Esc Cancel Point Select Click Click...

What an ugly hack, what a bloody mess :shock:
Surely, for a Windows user to visit a SM-Studio is a waste of money.
They feel enough pain all day long. :lol:

Edit:
http://postimg.org/image/exz788z1f/
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16055
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: Multiple joysticks (Windows)

Post by Cody »

SilverBullet wrote:
Surely, for a Windows user to visit a SM-Studio is a waste of money. They feel enough pain all day long.
<grins> Penguinista propaganda!
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
Fritz
---- E L I T E ----
---- E L I T E ----
Posts: 591
Joined: Sun Jul 12, 2015 2:30 pm
Location: Bavaria, Germany
Contact:

Re: Multiple joysticks (Windows)

Post by Fritz »

We all are kind of spoiled today. That's how it was on the C-64:

Was it port 1 or port 2 for this game? Joystick is in port 1, so let's try this first.

No reaction. It must be the other port!

Unplug joystick from port 1 and plug it into port 2.

Doesn't work either. Perhaps I should have pressed space first?

Unplug joystick from port 2 and plug it into port 1.

Doesn't work. Perhaps I should have pressed enter first?

Unplug joystick from port 1 and plug it into port 2.

No reaction. CIA (I/O chip) destroyed.
"You wouldn't kill me just for a few credits, would you?" – "No, I'll do it just for the fun!"
Commander_X
---- E L I T E ----
---- E L I T E ----
Posts: 664
Joined: Sat Aug 09, 2014 4:16 pm

Re: Multiple joysticks (Windows)

Post by Commander_X »

SilverBullet wrote:
Now, as a long time Xenix/SCO Unix/Solaris/Linux user I feel I have to comment on the suggestion regarding the Windows joystick configuration:

Point Click Click Click Point Select Click Click...
And if one wants to revert because another game needs to be started:
Point Click Click Click damn, Esc Esc Cancel Point Select Click Click...

What an ugly hack, what a bloody mess :shock:
Following a_c's advice, you can actually make a shortcut to joy.cpl on your desktop and use it for a faster switch. No argument, though, profiling the SDL_JOYSTICK_DEVICE with a wrapper to start your application is way more convenient (i.e.,

Code: Select all

#!/bin/sh

SDL_JOYSTICK_DEVICE="/dev/input/js0 ./oolite
) Yup, that would be the better way.
Post Reply