Support for 3 joysticks (stick, throttle and paddles)

An area for discussing new ideas and additions to Oolite.

Moderators: winston, another_commander

Post Reply
charlesbc
Poor
Poor
Posts: 7
Joined: Thu Dec 14, 2017 12:56 pm

Support for 3 joysticks (stick, throttle and paddles)

Post by charlesbc »

I own a Thrustmaster HOTAS Warthog stick, throttle and MFG Crosswind rudder paddles. These are registered as three separate joysticks using 3 separate USB ports.

Oolite registers only 2 sticks at the same time in the joystick configuration options, so I have to make a choice between only using the stick and throttle, or the stick and rudder paddles.

Is it possible to have Oolite detect and make use of all 3 sticks instead of only 2 sticks?
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6681
Joined: Wed Feb 28, 2007 7:54 am

Re: Support for 3 joysticks (stick, throttle and paddles)

Post by another_commander »

What OS are you on? If on Windows, I could prepare a test executable with 4 sticks set as maximum rather than the current 2 for you to test.
charlesbc
Poor
Poor
Posts: 7
Joined: Thu Dec 14, 2017 12:56 pm

Re: Support for 3 joysticks (stick, throttle and paddles)

Post by charlesbc »

I'm using Manjaro Linux. Unfortunately I have no Windows, but maybe I can test using Wine?
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6681
Joined: Wed Feb 28, 2007 7:54 am

Re: Support for 3 joysticks (stick, throttle and paddles)

Post by another_commander »

I'd prefer not testing trhough Wine because I am not sure what kind of compatibiility layers it throws at us; any problem that might be encountered could be due to a code problem or a Wine problem.

If on Linux, you can build from source. Just go to this line in the code and change the 2 to a 4. Expect to encounter issues in the joystick setup screen. It's mostly those issues that will require further discussion.
charlesbc
Poor
Poor
Posts: 7
Joined: Thu Dec 14, 2017 12:56 pm

Re: Support for 3 joysticks (stick, throttle and paddles)

Post by charlesbc »

I'm not used to compiling, but here's my attempt. I didn't change any lines yet, just git clone, update and make. The normal "make" command didn't work, I got the message "GNUmakefile:438: /objc.make: No such file or directory". Using "make -f Makefile" and "make -f Makefile OBJCFLAGS=-fobjc-exceptions" each time from the clean source had the same result.

I've read the README.md, checked all required libraries and used these commands:

git clone https://github.com/OoliteProject/oolite
(in oolite directory) git submodule update --init
make -f Makefile OBJCFLAGS=-fobjc-exceptions

It started compiling, but then it stopped after these last couple of lines:

c++ -o js -fno-rtti -fno-exceptions -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wcast-align -Wno-invalid-offsetof -Wno-variadic-macros -Werror=return-type -pedantic -Wno-long-long -fno-strict-aliasing -pthread -pipe -DDEBUG -D_DEBUG -DTRACING -g js.o jsworkers.o -lpthread -Wl,-rpath-link,/bin -Wl,-rpath-link,/usr/local/lib -L../dist/bin -L../dist/lib -L/usr/lib -lplds4 -lplc4 -lnspr4 -lpthread -ldl ../editline/libeditline.a ../libjs_static.a -ldl
/home/charlesbc/git/oolite/deps/mozilla/js/src/build-debug/config/nsinstall -R -m 755 js ../dist/bin
/home/charlesbc/git/oolite/deps/mozilla/js/src/build-debug/config/nsinstall -R -m 755 js ..
make[4]: Leaving directory '/home/charlesbc/git/oolite/deps/mozilla/js/src/build-debug/shell'
make[3]: Leaving directory '/home/charlesbc/git/oolite/deps/mozilla/js/src/build-debug'
make tools
make[3]: Entering directory '/home/charlesbc/git/oolite/deps/mozilla/js/src/build-debug'
make[4]: Entering directory '/home/charlesbc/git/oolite/deps/mozilla/js/src/build-debug/config'
make[4]: Nothing to be done for 'tools'.
make[4]: Leaving directory '/home/charlesbc/git/oolite/deps/mozilla/js/src/build-debug/config'
make[4]: Entering directory '/home/charlesbc/git/oolite/deps/mozilla/js/src/build-debug/editline'
make[4]: Nothing to be done for 'tools'.
make[4]: Leaving directory '/home/charlesbc/git/oolite/deps/mozilla/js/src/build-debug/editline'
make[4]: Entering directory '/home/charlesbc/git/oolite/deps/mozilla/js/src/build-debug/shell'
make[4]: Nothing to be done for 'tools'.
make[4]: Leaving directory '/home/charlesbc/git/oolite/deps/mozilla/js/src/build-debug/shell'
make[3]: Leaving directory '/home/charlesbc/git/oolite/deps/mozilla/js/src/build-debug'
if test -d ./dist/bin ; then touch ./dist/bin/.purgecaches ; fi
make[2]: Leaving directory '/home/charlesbc/git/oolite/deps/mozilla/js/src/build-debug'
touch deps/mozilla/js/src/build-debug/build_stamp
make[1]: Leaving directory '/home/charlesbc/git/oolite'
make -f GNUmakefile debug=yes strip=no
make[1]: Entering directory '/home/charlesbc/git/oolite'
GNUmakefile:438: /objc.make: No such file or directory
make[1]: *** No rule to make target '/objc.make'. Stop.
make[1]: Leaving directory '/home/charlesbc/git/oolite'
make: *** [Makefile:63: debug] Error 2

Checks at the beginning:
https://pastebin.com/CS24yju4

I hope this is enough information. Can you tell me if I missed something?
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6681
Joined: Wed Feb 28, 2007 7:54 am

Re: Support for 3 joysticks (stick, throttle and paddles)

Post by another_commander »

Regarding the objc.make problem, please check github issue #281, which describes a similar situation and its solution. This is as far as I can help, since I do not maintain the Linux port, but I am sure someone more experienced with Linux will jump in if the problem persists and assist further.
User avatar
Getafix
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 979
Joined: Tue Apr 01, 2008 12:55 pm
Location: A small ice asteroid, orbiting Oresrati in Galaxy 8 (a.k.a. northwest Armorica).
Contact:

Re: Support for 3 joysticks (stick, throttle and paddles)

Post by Getafix »

@charlesbc
The good news is that I will have a binary made for you (64bit, right?) with the change proposed by another_commander.
The catch is that I cannot deliver it to you earlier than sometime tomorrow.

In the meantime keep having a blast trying to build it from source on your own. :P
"Any sufficiently advanced information is indistinguishable from noise." [Newman, Lachmann, Moore]
Commander_X
---- E L I T E ----
---- E L I T E ----
Posts: 675
Joined: Sat Aug 09, 2014 4:16 pm

Re: Support for 3 joysticks (stick, throttle and paddles)

Post by Commander_X »

another_commander wrote: Fri Dec 15, 2017 11:34 am
Regarding the objc.make problem, please check github issue #281, which describes a similar situation and its solution.
Another quick work around the issue could be to run (source to the shell) the GNUstep.sh shell script that brings in environment variables required by the framework. E.g. for a locally compiled GNUstep you'd have (don't forget the dot blank in front of the fully qualified name of the script):

Code: Select all

. /usr/local/share/GNUstep/Makefiles/GNUstep.sh
charlesbc
Poor
Poor
Posts: 7
Joined: Thu Dec 14, 2017 12:56 pm

Re: Support for 3 joysticks (stick, throttle and paddles)

Post by charlesbc »

Commander_X wrote:
Another quick work around the issue could be to run (source to the shell) the GNUstep.sh shell script that brings in environment variables required by the framework. E.g. for a locally compiled GNUstep you'd have (don't forget the dot blank in front of the fully qualified name of the script):

Code: Select all

. /usr/local/share/GNUstep/Makefiles/GNUstep.sh
Thank you! That did the trick. Along with switching to 64-bit Lubuntu 17.10, because I couldn't figure out the Manjaro package names. I compiled without changes first to see if it would. It worked with version 1.87.
another_commander wrote:
If on Linux, you can build from source. Just go to this line in the code and change the 2 to a 4. Expect to encounter issues in the joystick setup screen. It's mostly those issues that will require further discussion.
I did a clean git clone, made this change and compiled again. The joystick configuration menu only shows 2 detected sticks, but I'm actually able to assign roll, pitch and jaw to all three sticks. A hidden feature, but it works! Awesome! Thank you so much everyone! Will this feature be available in the next version?

I'm really happy with this feature. There's one more thing I'd like to mention. My MFG Crosswind has independent left and right brake axis. So if I want to assign roll to the brakes, I can only assign it to one pedal. Is it possible to have the option to assign an axis to "roll left" and "roll right" as an second alternative to a single "roll" axis?
charlesbc
Poor
Poor
Posts: 7
Joined: Thu Dec 14, 2017 12:56 pm

Re: Support for 3 joysticks (stick, throttle and paddles)

Post by charlesbc »

another_commander wrote: Thu Dec 14, 2017 6:16 pm
I'd prefer not testing trhough Wine because I am not sure what kind of compatibiility layers it throws at us; any problem that might be encountered could be due to a code problem or a Wine problem.

If on Linux, you can build from source. Just go to this line in the code and change the 2 to a 4. Expect to encounter issues in the joystick setup screen. It's mostly those issues that will require further discussion.
I've been playing oolite for a while now with this recommended code change from another_commander for support for a 3 joystick HOTAS setup.

I can report this code change works well. It is a stealth feature and the menu will only report one of the joystick names while supporting them all during assignment. I see no menu glitches and encountered no game glitches so far.

I prefer not to always build from source to play the game this way. Can someone pretty please submit this tiny code change to the repository for me, so it can become part of the next release?
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6681
Joined: Wed Feb 28, 2007 7:54 am

Re: Support for 3 joysticks (stick, throttle and paddles)

Post by another_commander »

The number of maximum supported joysticks has been increased to 4 (commit 4206592). All available joysticks should now be properly listed in the Stick Mapper screen. Please test if you can and let us know in case of problems.
charlesbc
Poor
Poor
Posts: 7
Joined: Thu Dec 14, 2017 12:56 pm

Re: Support for 3 joysticks (stick, throttle and paddles)

Post by charlesbc »

Thank you!

Sorry for the late reply. I've been testing the joysticks with the nightly build releases from here:
https://github.com/OoliteProject/nightlies/releases

All joysticks work great with nightly build Oolite Nightly Build (2018-06-30): oolite-trunk-1.87.0.c81d75a-dev.linux-x86_64.tgz

It still works with a recent nightly build Oolite Nightly Build (2018-07-21): oolite-trunk-1.87.0.63edd46-dev.linux-x86_64.tgz

So yes, it works very well. I have no problems playing the game with the hotas setup.

When I run the game, and to go "Start New Commander" -> "Normal Start" -> F2 -> "Game Options" -> "Joystick Configuration", the screen here only lists Stick 1 and Stick 2 out of my 3 USB sticks. Other than that, it does recognize all sticks and I can assign all axis and buttons. I don't mind that. If you need me to test again, please let me know.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6681
Joined: Wed Feb 28, 2007 7:54 am

Re: Support for 3 joysticks (stick, throttle and paddles)

Post by another_commander »

charlesbc wrote: Sat Jul 21, 2018 2:12 pm
When I run the game, and to go "Start New Commander" -> "Normal Start" -> F2 -> "Game Options" -> "Joystick Configuration", the screen here only lists Stick 1 and Stick 2 out of my 3 USB sticks. Other than that, it does recognize all sticks and I can assign all axis and buttons. I don't mind that. If you need me to test again, please let me know.
It should really list all three of them, in the space of the two lines provided for joystick identification. That was supposed to be the hardest part of the change that increased joysticks from 2 to 4 and in my (limited, because I have no sticks to check so I had to emulate their presence) tests, I could see three and four names displayed where they should be.

If you look at Latest.log, how many sticks does it say it has seen? Can you please post it?
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6681
Joined: Wed Feb 28, 2007 7:54 am

Re: Support for 3 joysticks (stick, throttle and paddles)

Post by another_commander »

As a quick check, I downloaded and installed vJoy on my system and enabled 3 and 4 sticks just to see what happens. On Windows, this is what I see in the stick configuration screen:

3 sticks
Image

4 sticks
Image
charlesbc
Poor
Poor
Posts: 7
Joined: Thu Dec 14, 2017 12:56 pm

Re: Support for 3 joysticks (stick, throttle and paddles)

Post by charlesbc »

I re-installed the latest Oolite Nightly Build (2018-07-21) on both Windows 10 and Ubuntu 16.04 LTS. I think I misread, in both versions they are listing all three sticks.

Windows - oolite-trunk-1.87.0.63edd46-dev.x64.exe
Image

Linux - oolite-trunk-1.87.0.63edd46-dev.linux-x86_64.tgz
Image

No problems there, my mistake. You can see the assignments of all three sticks working as well in both versions. Only thing I notice is that I can't assign Stick 2 Axis 3 in windows, which I can do in linux. Though that might be a windows driver problem and nothing to do with Oolite.
Post Reply