Code Monkey home page Code Monkey logo

ksp-advanced-flybywire's Introduction

Advanced Fly-By-Wire v1.7-beta

Kerbal Space Program input system overhaul mod

Latest version - 1.7-beta for KSP 1.1 and later

Download v1.7-beta (Windows, KSP x64)

Download v1.7-beta (Linux, KSP x86/x64) (Requires libsdl2)

Licensed under the MIT License

You can also find the mod on:

Installation

On Windows, simply extract the ZIP file into the root installation folder for your game. Often this is directly in %ProgramFiles%. If you are using Steam, it will be located in %ProgramFiles%\Steam\steamapps\common\Kerbal Space Program.

What is this?

This is a mod for Kerbal Space Program, a spaceship building/ space exploration game by Squad. It dramatically enhances the stock input system with a bunch of fixes and many new features.

How is it better than stock?

  • Edit your control setup at any time during flight, no need to go back to the main menu to change bindings.
  • Supports almost all controller types through the SDL wrapper.
  • Native support for the Xbox 360 controller (and PS3 controller using MotionJoy) through the XInput wrapper. A built-in example preset is available.
  • Unlimited number of controller buttons and axes
  • Full keyboard & mouse support
  • Lower latency and better analog precision than KSP's stock input
  • Smart dead-zone detection and analog calibration
  • Remaps analog inputs to achieve better precision
  • Acceleration-based discrete inputs for precise keyboard flight
  • Supports key combinations with an infinite number of keys
  • Multiple presets per controller
  • Extremely simple to configure and use
  • Works alongside the stock input system. The mod will not override or break your current setup.

How to use

screenshot

The mod adds a new button to the mod toolbar.

Click the game controller icon or press Shift + L during flight to bring up Fly-By-Wire's main configuration screen.

From there you will see a list of detected controllers. You can click on "Enable" to enable a controller from the list - two new buttons will appear - "Presets" and "Configure".

"Presets" will open up the preset editor which is very similar to KSP's stock bindings editor. Using the preset editor you can modify your controller layout at any time.

"Configure" will open up the controller configuration screen. It allows you to set some configuration values as well as calibrate the controller if necessary.

After setting up your controller you should save your game (by using quicksave or exiting to space center), which will automatically save your controller configuration as well.

Operating system compatibility

Fully tested and compatible with KSP x64 on Windows and Linux operating systems. XInput support unavailable on Linux.

Performance considerations

The mod is extremely lightweight both on performance and memory. It only does a bit of arithmetic and remapping of incoming inputs which should have no noticeable effect on CPU usage. Memory usage is in the order of a few megabytes.

Bug reports

Please report any bugs using GitHub's issue tracker.

Changelog

Click here for changelog

ksp-advanced-flybywire's People

Contributors

alexanderdzhoganov avatar alexandermladenov avatar badpandabear avatar basak avatar boris-barboris avatar conklech avatar ddaf avatar ddfreiling avatar deamonsix avatar mutability avatar nick-pape avatar taniwha avatar vitorboschi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ksp-advanced-flybywire's Issues

[linux] Axis range should be configurable in conroller configuration

The range of my throttle axis ist between 0 and 1.
For proper usage I need to invert this. But if I do this, the axis becomes unusable in the preset.

Joystick: Microsoft SideWinder Force Feedback 2 (USB)
Axis range: 0 - 1
Negative dead-zone: 1.000
Positive dead-zone: 0.000

The game want positive values (and invertion in the preset results in negative values), because of this the axis gets ignored when I invert this axis in the preset.

PS: We probably need to be able to limit the detected raw values, that could end up in a more complicated interface.

Craft switching causes engines on previous craft to still be controlled

I've encountered an issue where, after I undock 2 craft, increasing the throttle on one craft will cause the engine on the other one to also fire.
This seems to be limited to while the 2 craft are still within a certain range of each other. However, if I undock, move out of range, then move closer again, the second ship engine begins responding to throttle commands again.
I have some video footage of this occurring, if it's of any use.
I'm using KSP version 1.2.2 with the dll modified by Taniwha for that release.
I removed all other mods except this one and still had the issue. Removing this mod then fixed the issue, however this causes massive lag on my Saitek X56 joystick, so I have to continue using it.
The only way to get around this happening is to go to the Tracking Station and reselect the ship from there. If I 'quick' swap from ship to ship in the map view, the issue still happens.

All nearby spaceships are controlled

Hello,

I made a space station in-game and I noticed that when I was doing an action on my spaceship, the station was doing the same movements. For exemple I rolled my spaceship and the space staion was rolling too or I could control my ship while I was in EVA.

Sorry for my english,
Thanks,

ChouetteNocturne

Throttle only responds after half-way

Joystick: SideWinder Force Feedback Pro 2
Issue: When controlling the throttle, AFBW only updates the main throttle after the slider is moved past the halfway point. The range for the slider appears to be -1 to 1. Is there an option to have the throttle mapped to the full range, i.e. (slider() + 1.0) / 2)?

Different trim effects via state.*Trim and m_Trim

Our trim setting manifests in two different ways. First, it is copied to the relevant FlightCtrlState.*Trim property (in FlightManager.UpdateFlightProperties), which sets the resting angle when there is no controller input. Second, it is added to the input value (in FlightProperty.Update()) when there is controller input. These two modes should be mutually exclusive.

For some reason, the two modes don't have equivalent effects: the trim adjustment has a slightly greater effect via FlightCtrlState (no input) than it does in FlightProperty.Update() (with input). For example, if I set a pitch-up trim of 0.5 with my hand off the stick, and then make a small roll or yaw movement, the pitch control immediately jumps down to something like 0.4 or 0.45, and returns to 0.5 when the controller input returns to zero. This has an unfortunate negative effect on stability...

I've tested this effect on an otherwise-unmodded Windows x86 install. Any ideas why this happens and what we might be able to do about it?

[linux] Hat left is ignored completely

JoyStick: Microsoft SideWinder Force Feedback 2

Hat buttons which are detected:

  • center (no button, see #31 )
  • up
  • up+right
  • right
  • down+right
  • down

Hat buttons which are not detected:

  • up+left
  • left
  • left+down

No hardware-issue.
My second JoyStick (the same type) has this issue also.

CKAN Linux - shows max version supported as KSP 1.1

Can you please update the 'max ksp version' to allow installation on the latest version of KSP?

1.2.1?

This issue seems to be the case on windows too, see attached screen-shot.

Prevents installation using CKAN.

screenshot_2017-03-07_01-50-45

Trim issues

"The trim settings [...] seem to register alright, but just not "stick." With RPM and other mods, you can have a trim indicator separate from the regular pitch/roll/yaw indicators, so it is pretty clear that it is in fact changing the trim, but when I let off the stick, it the trim re-centers."

Brakes toggle with FAR

Reported as "The brakes seem to be desynchronized from the FAR airbrakes now, and are very consistently opposite of whatever the position the FAR airbrakes. So wheel brakes on means airbrakes off, and the opposite is true as well which makes it really hard to take off "

PrecisionMode-action visual bug

When setting a button to toggle Precision Mode, it does work, but the bars in the lower left showing flight data does not change color, like when you usually press Caps Lock to change it. Very minor issue.

[linux] Hat #0 Button 0 is "True" when untouched

JoyStick: Microsoft SideWinder Force Feedback 2

As long as the hat is untouched (to no direction pushed), the hat #0 button 0 is always true.
This is an issue because when you set an axis, the button gets into the "combination" and needs to be true so that axis works.

Workaround: give us an option in Controller Configuration to ignore/disable buttons.

Staging keybind is not working

The in-mod keybind for staging is not working on either my joystick or the throttle controller. KSP 1.1.2 Windows 10 64 bit. Additional mods:
MechJeb
Chatterer
Kerbal Engineer Redux
PlanetShine
Scatterer
Kerbal Alarm Clock
HyperEdit

I will try this with only AFBW active and report back tomorrow.

Not working for me

I downloaded it for 1.1 newest version and nothing at all is showing up when you push the Button on the tool bar. Its just a blank tab. I did delete all other mods and re-install this mod to make sure.

Non functional on OS X

This is probably in part due to OS X using '.dylib' as a file extension instead of '.so' or '.dll'.

Hopefully this is as simple as using "libSDL2.dylib" when compiling for OSX.

Throttle issues with analog stick

Bug reported as "My slider throttle, recognized as "axis 3," registers from 0.0 to 1.0, or 0.0 to -1.0 when inverted, and when set as the throttle will only change it from 50% thrust to 100%, and it won't consistently go below that. If I lower the throttle with the keyboard, my slider seems to have a close to full range, but doesn't consistently go down to the lowest point in the range."

Axis inversion should be set on a per-binding basis

Currently axis inversion is set globally, but results in unintended behavior when inversion is needed in one preset, but not in another (eg. flying vs. EVA).

Move axis inversion flag to a per-binding basis so that when an action is bound to an Axis, an inversion flag can be set by the user.

This can break backwards compatibility for old preset configs, may need to make a quick converter.

This issue is created in response this post on the official thread

please release for KSP v1.0

I'd really like to try out this plugin... in particular to set up my Logitech Extreme 3D so that I can use the 4th axis (a rudder) as the throttle.

No way to delete presets

Currently there is no way to delete controller presets (except manually editing the configuration xml). A delete preset button should be added to the controller preset configuration screen.

Fine Control Keybiding is not working.

This is related to the Staging Keybinding not working;
#46

Unlike my comment in the above issue, setting the key under KSP's main "Settings"->"inputs" menu does not work.

FAR dynamic control adjustment support

"The FAR dynamic control adjustment doesn't seem to apply to a controller using this mod, I set it as low as 10 (meaning matching the dynamic pressure of turn while moving at 10 m/s at sea level, I think) and it had no impact on control."

Permanent SAS effect on vehicles with no SAS

There seems to be an SAS effect permanently active when using this, but only on vehicles that cannot have SAS (Like crafts without a Pilot kerbal or Stayputniks). This happens using KSP 0.90, FBW 1.45, with only this mod + toolbar active, on Windows 7 x64. Happens even with no inputs activated for FWB.

Pressing another button breaks "hold" actions

I have a controller with switches (non-momentary buttons) and I would like to use them for SAS and Breaks. AFBW supports this via the "SAS (hold)" and "Break (hold)" actions. However, if I press another button while "holding" that SAS or Break button (which is actually a switch so "holding" it doesn't require me to be touching it), the "hold" is broken; causing SAS/Break to be disengaged. To reengage the state I have to turn the switch off and back on. This is a pretty serious problem when using a switch to control SAS and then another button to control staging: Staging will disengage SAS.

Looking at the code it appears that the hold actions are implemented by setting the appropriate state when the correct button state (including all buttons on the controller) begins via a button press and clearing that state when the button state ends for any reason. This makes the above behavior make sense. Since combined button states are used instead of the state of a single button, overlapping button presses produces a state that is different from either button and hence a state that will not hold SAS (or whatever).

It appears that AFBW uses button states instead of individual buttons so it can support button chording to perform specific actions. However, the interaction with "hold" actions does not seem to be correct.

Proposed Solution

In my thinking about this, I have come up with the following solution, which I think would be backwards compatible with presets based on the current design.

Provide "set on" and "set off" actions for game states (like SAS, Breaks, and map view) and provide a way to map press and release events separately. The mapping could be done with two new UI button beside "Add Button" and "Add Axis": "Add Press" and "Add Release". Mappings setup this way could only have a single button and would trigger exactly when the button is pressed and released, respectively, regardless of the state of any other buttons.

I could configure this with button press (switch turned on) mapped to SAS on and button released (switch turned off) mapped to SAS off. That way, staging with a different button would not cause SAS to disengage and I could map as many different state switches as I wanted. I could even create my own "states" by using two different custom action groups to turn the state I want on and off, respectively.

[W7 x64] Trim completely broken using axis/buttons

at first I couldn't even get trim commands to hold, but after I read about issue #28 I was able to toggle SAS on and off my aircraft to make it so that when I used the Alt+WASDQE keys to set trims, the control surfaces would stay deflected properly.

However if I set an axis on my joystick to a trim axis, it treats the axis like a throttle. In other words if I were to actually set it to my throttle axis, at 0 the trim would not move but if I upped my throttle a little bit the trim would start to travel - then stop if I throttled back. It only went in one direction I had to reverse the axis to travel the other way.

The button setting is broken as well - if I set the button to Pitch+ Trim activating it will pitch my trim up to max. If I use Pitch- Trim it will return to neutral, and then another tap will fully deflect it downwards.

Full throttle range not detected

Device: Thrustmaster 16000M

The device detects the full throttle range as -1 to +1 with 0 being at the centre position.

The impact is in KSP the throttle will only engage once the physical throttle position passes 50%. This makes the lower 50% of the physical throttle range ineffective.

No Stick Detection on Windows 8.1

I downloaded AFBW version 1.4.5 onto KSP 0.90 (32 bit) via CKAN and AFBW doesn't detect my Logitech Extreme 3D Pro Joystick. I'm running Windows 8.1.

I deleted the .xml file in the mod folder multiple times, each time restarting KSP. I even restarted my computer and that didn't let AFBW detect the joystick.

Here is the output log: http://pastebin.com/d4G7qXtV

Here is the generated .xml file: http://pastebin.com/PrBZfyVr

This is my GameData Folder:
GameData Folder

HOTAS Warthog noy recognized

THe Thrustmaster Hotas Warthog jostick and throttle are not recognized, natively or even if I use the TARGET software wich convert both of them into a virtual joystick. they are seen in the joystick control panel.

KSP seems to see the virtual jostick and can be assigned in the, problem is center are not correct (they are correct in any other game or in the calibration panel), something i think your mod can correct.

Installation documentation?

Can we get a readme or a howto in the github readme.md on how to install this? I'm assuming you unzip the KSP root directory, but it'd be nice to be sure.

SAS seems to correct the joysticks movements

Hi, upon installing this mod from the kerbal curseforge, while flying a plane, i found that when i tried to pitch my space planes nose up, the SAS would immediately try to compensate for my Xbox 360 controllers joystick movements therefore pitching up with SAS on would slowly cause the plane to stop pitching up and try to go the other way. This differs from the proper keyboard controls overriding the SAS completely, so SAS dosent fight your corrections, it only tries to correct the yaw and the roll why you are controlling the pitch. Also upon releasing the joystick, the SAS still tries to correct you for a moment, and therefore results it the whole vehicle pitching down. These problems also appear to happen when attempting to adjust yaw and roll. If this is not a bug, then i find it to be a really annoying feature.

ksp 0.90.0.705 (with a few other mods like NEAR, B9 and KAS)
AFBW 1.4.5(x86)

SAS *can't* correct joystick movements

This is the anti-issue of #28.

As of 1.5.1, we completely override SAS when there's joystick input. In the context of #28, this makes sense. But there are situations where it's unhelpful. For instance, FAR has some flight aids that are designed to be used in conjunction with (i.e. to limit or override) manual input, which are completely disabled by our SAS override. Worse, once controller input touches zero the SAS systems instantly come into full effect, which can be catastrophic in atmospheric flight.

Would it make sense to make the SAS override toggleable?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.