Jump to content

[1.12.x] AFBW Revived (Joystick & controller mod)


linuxgurugamer
 Share

Recommended Posts

4 hours ago, linuxgurugamer said:

I will have to make an Arch Linux install to test this, is going to take a while

If it would be easier, perhaps a build with a bunch of debug output? What I can tell you at the moment is:
Steam/the overlay isn't a factor as the same thing happens when running ksp standalone.
Something is happening, it's stuck in a loop perhaps. One core stays at 100% while it's at the loading screen and I don't kill the process.
I've disconnected the steam controller and no change.

I'm willing to help however I can. Just tell me what you need. I'll even attempt looking at the code myself if anybody can point me to, up to date information, on setting up a ksp-modding dev environment on linux.

Link to comment
Share on other sites

2 hours ago, linuxgurugamer said:

Have you verified that the controller works and is visible ?  Stupid question, but I need to ask.

I'll see about a debug build, but it really sounds like it could be a driver issue

Well, yes but no.
Vanilla KSP does not see any joysticks on linux, unless I use steam to emulate an Xbox controller. Bugs reports exist in the tracker for issues like this.
A workaround many have claimed to be using is AFBW, because of the use of sdl.
All of my joysticks are detected if I run jstest-gtk.
They show up in the system as /dev/input/js0 and js1   (A hotas, and throttle+rudder pedals)
If I use steam, it creates js2, js3,etc for the emulated xbox controllers, including up to js4 if I also have the steam controller plugged in.

Other games see and use js0 and 1 just fine. Xplane-11 is the first that comes to mind. Come to think of it though, I am not aware of any Unity based game that does.
Screenshot%20from%202018-06-05%2021-22-0

 

EDIT: This may be related, or it may be two separate issues.
I've filed a bug report.
I suspect it has something to do with steam/bpm, steam controller, libCsteamworks.so, libsteam_api, and the virtual xbox controllers created by steam.

A vanilla install simply crashes when trying to set any input axis, while steam is running and the virtual devices exist.
Without steam, KSP doesn't see js0 or js1, so trying to set inputs at the vanilla configuration screen simply sits there waiting for input. If AFBW is added, everything is the same (no crash at config screen, and no detection) but the game fails to load any flight.
This may be two separate issues?

Edited by LordJason
New information.
Link to comment
Share on other sites

On 6/5/2018 at 8:41 AM, LordJason said:


Arch Linux.

I have sdl2.
 

usr/lib/libSDL2-2.0.so
usr/lib/libSDL2-2.0.so.0
usr/lib/libSDL2-2.0.so.0.8.0
usr/lib/libSDL2.so
usr/lib/libSDL2main.a

All files on my system related to sdl2 are listed on this page.

 

I have resolved my issue with the infinite loading on Arch Linux by setting the 'SDL_DYNAMIC_API' environment variable to the library provided by Arch's libsdl2 package:

 

I used the steam launch options like so:

SDL_DYNAMIC_API=/usr/lib64/libSDL2.so LC_ALL=C %command%_64

 

Evidently this an SDL compatibly feature for when is bundled with a game installed on a system which has a different version of libSDL2, detailed in this post:

 

Hopefully that works for you too!

Link to comment
Share on other sites

I just want to post to thank you for making this mod available and getting it working on Linux. This has made my joystick work on Linux way better than it did via KSP's native support, even before they broke joystick support on Linux completely. I can actually use my £160 joystick, completely, and know it'll still work next time I start KSP!

BTW it seems Ubuntu 18.04 based distros already have SDL 2 installed, I didn't have to do anything in that regard, which was nice.

Link to comment
Share on other sites

So is there a keyboard preset for this mod that mimics the default game presets? It seems to be overriding the default keymapping, and the mod keymap can only be set in flight mode, which is difficult to do when using KCT.

The default mouse settings work thought. 

Edited by fwdixon
Link to comment
Share on other sites

1 hour ago, fwdixon said:

So is there a keyboard preset for this mod that mimics the default game presets? It seems to be overriding the default keymapping, and the mod keymap can only be set in flight mode, which is difficult to do when using KCT.

The default mouse settings work thought. 

Which default keymapping?  If younhave a controller enabled, that controller will override the keyboard.  This gets me all the time, when I fly a plane using this, and then switch to a rocket without disabling the controller, I forget that the controller is active and overridding the throttle.  

Link to comment
Share on other sites

16 minutes ago, linuxgurugamer said:

Which default keymapping?  If younhave a controller enabled, that controller will override the keyboard.  This gets me all the time, when I fly a plane using this, and then switch to a rocket without disabling the controller, I forget that the controller is active and overridding the throttle.  

With the keyboard selector off, the keyboard commands don't work at all. I have to turn it on and map commands to it to use my keyboard.

Link to comment
Share on other sites

6 minutes ago, fwdixon said:

With the keyboard selector off, the keyboard commands don't work at all. I have to turn it on and map commands to it to use my keyboard.

Ill have to take a look.  Are all the keyboard commands disabled?

and can you post a log file, please

Link to comment
Share on other sites

58 minutes ago, linuxgurugamer said:

Ill have to take a look.  Are all the keyboard commands disabled?

and can you post a log file, please

Here's the log file:

Output_log.txt

Of note, it is only occurring in my career game. In my sandbox save if I toggle the radio button on and then off again, it works, and in my stock test install I cannot reproduce the problem. This leads me to believe there is a mod compatibility issue somewhere but I can't think of what would be doing it.

Link to comment
Share on other sites

On 6/23/2018 at 3:47 PM, linuxgurugamer said:

Ill have to take a look.  Are all the keyboard commands disabled?

and can you post a log file, please

Well, due to my contract parameters no longer registering as complete, I did a complete wipe and reinstall of all my mods and started a new career mode save, and don't have the issue. So, I will rule it a user error on my end.

Link to comment
Share on other sites

On 6/10/2018 at 11:50 PM, ReyTigerLinux said:

 

SDL_DYNAMIC_API=/usr/lib64/libSDL2.so LC_ALL=C %command%_64

I'm using stock debian, and the path is a bit different:

SDL_DYNAMIC_API=/usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0

After a long time of not using this mod because of the SDL problem, I'm so pleased to finally have it working.

 

Link to comment
Share on other sites

Just a quick question: Does this function properly on 1.3.1? If not, how difficult would a backport be? I'm running quite a few mods that aren't updated yet but can't use my joystick properly without this mod.

Link to comment
Share on other sites

  • 2 weeks later...

Hello there.

First I want to say thank you for maintaining this mod. Without it I won't be able to use joystick on linux version of ksp 1.4.

However I'm having an issue here. I use Throttle Controlled Avionics for its SAS and engine control, this seems to conflict with AFBW in atmosphere. Whenever I try to pitch or yaw with joystick, TCA will try to cancel it (roll is not affected). The craft's nozzles will point to the right direction, however TCA will try to cancel it with its throttle control. I guess TCA treat input from AFBW like something foreign instead of player input. Anything I can do to fix it?

Edited by jackey
Link to comment
Share on other sites

3 hours ago, jackey said:

Hello there.

First I want to say thank you for maintaining this mod. Without it I won't be able to use joystick on linux version of ksp 1.4.

However I'm having an issue here. I use Throttle Controlled Avionics for its SAS and engine control, this seems to conflict with AFBW in atmosphere. Whenever I try to pitch or yaw with joystick, TCA will try to cancel it (roll is not affected). The craft's nozzles will point to the right direction, however TCA will try to cancel it with its throttle control. I guess TCA treat input from AFBW like something foreign instead of player input. Anything I can do to fix it?

Would be best to contact the TCA thread, since it's overriding the inputs here

Link to comment
Share on other sites

Thanks for this mod - it works a lot better for my Thrustmaster HOTAS setup than using stock inputs + TM proprietary profiling software.

However, I do have one issue that I haven't been able to resolve yet. When mapping the throttle slider of the TWCS controller to the game's throttle, I've noticed that it treats the throttle like a forward/reverse throttle rather than forward only. However, since there is no "reverse throttle" in the game, it just sets the throttle to zero until my physical throttle is higher than 50%. I'm trying to figure out how to change the settings so that it treats the entire range of the throttle slider as 0% to 100%, rather than -50% to 50%.

I don't think I can do it with my profiler software (which is stupid) but is there a way to do this with the mod?

Thanks!

Link to comment
Share on other sites

57 minutes ago, Auriga_Nexus said:

However, I do have one issue that I haven't been able to resolve yet. When mapping the throttle slider of the TWCS controller to the game's throttle, I've noticed that it treats the throttle like a forward/reverse throttle rather than forward only. However, since there is no "reverse throttle" in the game, it just sets the throttle to zero until my physical throttle is higher than 50%. I'm trying to figure out how to change the settings so that it treats the entire range of the throttle slider as 0% to 100%, rather than -50% to 50%.

This happens sometimes with my Saitek X55. I recalibrate every time I start KSP with the joystick plugged in and if this happens I just recalibrate again and that fixes it. Make sure the throttle is closed, at full back, as well when you click the calibration button

Link to comment
Share on other sites

1 hour ago, Drew Kerman said:

This happens sometimes with my Saitek X55. I recalibrate every time I start KSP with the joystick plugged in and if this happens I just recalibrate again and that fixes it. Make sure the throttle is closed, at full back, as well when you click the calibration button

Thanks, I'll give it a try and see if it works. You'll hear from me either way :)

Link to comment
Share on other sites

Hi everybody,

I have a problem with using both stock and afbw on os/x due to the joysticks getting remapped randomly on restart.

On Osx i'm using controllermate to create different emulated joysticks for different tasks, but the contoller get renumbered pretty often on restart.

Now saving named settings would help if either one of these were an option

  • using a presets list on any joystick (global presets)
  • mapping the controllers by name instead of numbers (ideal)

In the current setup i have a joystick for flight, one for the camera, one for translation  and yet another for "EVA".  What i cannot do is say apply these presets on this joystick.

The mapping issue is not new, and is the same for the stock game setup, and is a bug in unity. (i have reported the bug here).

Do you think you could either create a "map by name" setting, or let any control acces the presets of the others, perhaps using special names like:

controller:presetlist

I could give it a try myself, but setting up a unity dev environment on osx took me the better part of a day without success ...

Thank you @linuxgurugamer for all your hard work!

Edited by pba
Link to comment
Share on other sites

3 hours ago, pba said:

Hi everybody,

I have a problem with using both stock and afbw on os/x due to the joysticks getting remapped randomly on restart.

On Osx i'm using controllermate to create different emulated joysticks for different tasks, but the contoller get renumbered pretty often on restart.

Now saving named settings would help if either one of these were an option

  • using a presets list on any joystick (global presets)
  • mapping the controllers by name instead of numbers (ideal)

In the current setup i have a joystick for flight, one for the camera, one for translation  and yet another for "EVA".  What i cannot do is say apply these presets on this joystick.

The mapping issue is not new, and is the same for the stock game setup, and is a bug in unity. (i have reported the bug here).

Do you think you could either create a "map by name" setting, or let any control acces the presets of the others, perhaps using special names like:

controller:presetlist

I could give it a try myself, but setting up a unity dev environment on osx took me the better part of a day without success ...

Thank you @linuxgurugamer for all your hard work!

Not easily.  As you said, it's a Unity bug, would be rather difficult to work around it

Sorry

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...