Skip to content

Commit

Permalink
Nicolas should be in the license on his own fork going forward ;) Als…
Browse files Browse the repository at this point in the history
…o added some wording about the handover to the credits section of the readme, fixed a bug with flick rotation smoothing I'd introduced when changing to SDL2
  • Loading branch information
JibbSmart committed Mar 8, 2021
1 parent 411a2d5 commit a294d24
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 18 deletions.
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,15 @@ Added help strings for button mapping
Handle drag n drop files into the console better
Improve command error handling

Jibb added JSL-specific features to SDL2 so that JSM could use SDL2 instead. This means support for many non-gyro controllers, including Xbox, Stadia, and almost every common generic PC controller. Also made it so that low report-rate controllers (eg Switch controllers) are sampled multiple times for smooth gyro on high refresh rate monitors.

### Features
* New Bindings: TOUCH, T1-T25 touch buttons, Touch stick bindings
* New settings for touch joystick such as mode, inner deadzone, and stick radius
* Assigning a negative value to trigger threshold enables hair trigger
* New setting HIDE_MINIMIZED will hide JSM when set to ON. OFF is default
* New setting HIDE\_MINIMIZED will hide JSM when set to ON. OFF is default
* Support for many non-gyro controllers: Xbox, Stadia, GameCube, PS3 (without motion), and many generic PC controllers.
* Added TICK\_TIME to set how many milliseconds between reading controllers (default of 3 means about 333Hz).

## 2.2.0
Nicolas added more keybinds. Robin fixed issues with building on Linux and improved PlayStation controller support.
Expand Down Expand Up @@ -219,4 +223,4 @@ In 1.1, Jibb added more ways to enable or disable the gyro, changed the default
* Statically linked runtime so that users don't have to have any particular MSVC runtimes installed.

## 1.0
JoyShockMapper 1.0 was the first public release of JoyShockMapper, created by Jibb Smart. Its features are too many to list in the changelog, but explore the README to see what it offers!
JoyShockMapper 1.0 was the first public release of JoyShockMapper, created by Jibb Smart. It includes the original implementation of flick stick and the first example of gyro controls meeting the standards detailed on GyroWiki (including advanced options like two-sensitivity acceleration and soft-tiered smoothing). Other features include tap and hold button bindings, rich traditional stick aiming options, and a "real world calibration" setting that made it possible to use the same stick and gyro settings across different games.
4 changes: 2 additions & 2 deletions JoyShockMapper/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2065,13 +2065,13 @@ static float handleFlickStick(float calX, float calY, float lastCalX, float last
jc->flick_rotation_counter += angleChange; // track all rotation for this flick
float flickSpeedConstant = jc->getSetting(SettingID::REAL_WORLD_CALIBRATION) * mouseCalibrationFactor / jc->getSetting(SettingID::IN_GAME_SENS);
float flickSpeed = -(angleChange * flickSpeedConstant);
int maxSmoothingSamples = min(jc->NumSamples, (int)(64.0f * tick_time.get())); // target a max smoothing window size of 64ms
int maxSmoothingSamples = min(jc->NumSamples, (int)ceil(64.0f / tick_time.get())); // target a max smoothing window size of 64ms
float stepSize = 0.01f; // and we only want full on smoothing when the stick change each time we poll it is approximately the minimum stick resolution
// the fact that we're using radians makes this really easy
auto rotate_smooth_override = jc->getSetting(SettingID::ROTATE_SMOOTH_OVERRIDE);
if (rotate_smooth_override < 0.0f)
{
camSpeedX = jc->GetSmoothedStickRotation(flickSpeed, flickSpeedConstant * stepSize * 8.0f, flickSpeedConstant * stepSize * 16.0f, maxSmoothingSamples);
camSpeedX = jc->GetSmoothedStickRotation(flickSpeed, flickSpeedConstant * stepSize * 2.0f, flickSpeedConstant * stepSize * 4.0f, maxSmoothingSamples);
}
else {
camSpeedX = jc->GetSmoothedStickRotation(flickSpeed, flickSpeedConstant * rotate_smooth_override, flickSpeedConstant * rotate_smooth_override * 2.0f, maxSmoothingSamples);
Expand Down
6 changes: 3 additions & 3 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## MIT License

Copyright 2018-2021 Julian "Jibb" Smart and contributors.
Copyright 2018-2021 Julian "Jibb" Smart; Copyright 2021- Nicolas Lessard.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Expand All @@ -13,14 +13,14 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
This software also uses the following libraries, which are also covered by the MIT license, with the same permissions and disclaimers:
* Neargye's magic_enum (Magic Enum C++), Copyright (c) 2019 - 2020 Daniil Goncharov: https://github.com/Neargye/magic_enum
* iPenguin's version_git: https://github.com/iPenguin/version_git
* Nefarius's ViGEm Client: https://github.com/ViGEm/ViGEmClient

---

This software links to (and includes compiled binaries of) my JoyShockLibrary (Copyright 2018-2021, Julian Smart), which is also covered by the same MIT license, with the same permissions and disclaimers. JoyShockLibrary incorporates some work from the following projects and their copyright holders, all also covered by the same MIT license, with the same permissions and disclaimers:
Some versions of this software link to (and include compiled binaries of) Jibb's JoyShockLibrary (Copyright 2018-2021, Julian Smart), which is also covered by the same MIT license, with the same permissions and disclaimers. JoyShockLibrary incorporates some work from the following projects and their copyright holders, all also covered by the same MIT license, with the same permissions and disclaimers:
* mfosse's JoyCon-Driver (JoyCon driver), Copyright 2018 Matthew Fosse: https://github.com/mfosse/JoyCon-Driver
* chrippa's ds4drv (DualShock 4 driver), Copyright 2013-2014 Christopher Rosell: https://github.com/chrippa/ds4drv
* Ryochan7 and Jay2Kings' DS4Windows (DualShock 4 input mapper), Copyright 2019 Travis Nickles: https://github.com/Ryochan7/DS4Windows
* Nefarius's ViGEm Client: https://github.com/ViGEm/ViGEmClient

---

Expand Down
19 changes: 8 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ My goal with JoyShockMapper is to enable you to play PC games with DS, DS4, JoyC

**Download JoyShockMapper to use right away [here](https://github.com/Electronicks/JoyShockMapper/releases)**!

For developers, version 2.2 and older serve as a reference implementation for using [JoyShockLibrary](https://github.com/jibbsmart/JoyShockLibrary) to read inputs from DualShock 4, DualSense, JoyCons, and Pro Controller in your games. It now uses [SDL2](https://github.com/libsdl-org/SDL) for controller support, and JoyShockLibrary's developer has made code contributions to SDL2 to make sure it covers the same features.
For developers, version 2.2 and older serve as a reference implementation for using [JoyShockLibrary](https://github.com/jibbsmart/JoyShockLibrary) to read inputs from DualShock 4, DualSense, JoyCons, and Pro Controller in your games. It now uses [SDL2](https://github.com/libsdl-org/SDL) for controller support, and I've made code contributions to SDL2 to make sure it covers the same features.

JoyShockMapper is also a reference implementation for many of the best practices described on [GyroWiki](http://gyrowiki.jibbsmart.com).

Expand Down Expand Up @@ -52,7 +52,7 @@ JoyShockMapper is primarily developed on Windows. JoyShockMapper should now be a
* **[License](#license)**

## Installation for Devs
JoyShockMapper was written in C++ and is built using CMake.
JoyShockMapper is written in C++ and is built using CMake.

The project is structured into a set of platform-agnostic headers, while platform-specific source files can be found in their respective subdirectories.
The following files are platform-agnostic:
Expand Down Expand Up @@ -111,11 +111,11 @@ The latest version of JoyShockMapper can always be found [here](https://github.c
Included is a folder called GyroConfigs. This includes templates for creating new configurations for 2D and 3D games, and configuration files that include the settings used for simple [Real World Calibration](#5-real-world-calibration).

## Quick Start
1. Connect your controller either with a usb cable or via bluetooth. Most modern controllers will be suported, including all Xbox, Playstation and Switch controllers.
1. Connect your controller either with a usb cable or via bluetooth. Most modern controllers will be suported, including all Xbox, Playstation and Switch controllers, although Xbox and many others don't have the gyro sensor required for gyro controls.

2. Run the JoyShockMapper executable, and you should see a console window welcoming you to JoyShockMapper.
* In the console you can start entering bindings : [button name] = [key name]. See [Digital Inputs section](#1-digital-inputs) for details on how buttons and keys are named.
* [Sticks](#3-stick-configuration), the [gyro](#4-gyro-mouse-inputs) and [Sony's analog triggers](#2-analog-triggers) require some more configuration: typically some MODE you want to set, a sensitivity value and some other settings. Each is explained in the corresponding section. They follow the same format : [setting name] = [value]
* [Sticks](#3-stick-configuration), the [gyro](#4-gyro-mouse-inputs) and [analog triggers](#2-analog-triggers) require some more configuration: typically some MODE you want to set, a sensitivity value and some other settings. Each is explained in the corresponding section. They follow the same format : [setting name] = [value]
* Buttons and settings will display their current values if you only enter their name in the console.
* Settings can display a short description of what they do if you enter [setting name] HELP
* There are quite a few commands that do not work as assignments like above but just runs a function. For example RECONNECT\_CONTROLLERS will update the controller listing, and RESET\_MAPPINGS will set all settings and bindings to default. README will lead you to this document!
Expand Down Expand Up @@ -866,14 +866,11 @@ But first, here are some common problems that are worth checking first.

## Known and Perceived Issues

### Polling rate
New mouse and keyboard events are only sent when JoyShockMapper gets a new message from the controller. This means if your game's and display's refresh rates are higher than the controller's poll rate, sometimes the game and display will update without moving the mouse, even if you'd normally expect the mouse to move. The DualSense and DualShock 4 send 250 messages a second, which is plenty for even extremely high refresh rate displays. But JoyCons and Pro Controllers send 66.67 messages a second, which means you might encounter stuttering movements when playing (and displaying) above 66.67 frames per second. A future version of JoyShockMapper may work around this problem by repeating messages up to a desired refresh rate.

### Bluetooth connectivity
JoyCons and Pro Controllers normally only communicate by Bluetooth. Some Bluetooth adapters can't keep up with these devices, resulting in **laggy input**. This is especially common when more than one device is connected (such as when using a pair of JoyCons). There is nothing JoyShockMapper or JoyShockLibrary can do about this. JoyShockMapper experimentally supports connecting Switch controllers by USB.

## Credits
I'm Julian "Jibb" Smart, and I made JoyShockMapper. As of version 1.3, JoyShockMapper has benefited from substantial community contributions. Huge thanks to the following contributors:
JoyShockMapper was originally created by **Julian "Jibb" Smart**. As of version 1.3, JoyShockMapper has benefited from substantial community contributions. Huge thanks to the following contributors:
* Nicolas (code)
* Bryan Rumsey (icon art)
* Contributer (icon art)
Expand All @@ -882,11 +879,11 @@ I'm Julian "Jibb" Smart, and I made JoyShockMapper. As of version 1.3, JoyShockM
* Garrett (code)
* Robin (linux and controller support)

Have a look at the CHANGELOG for a better idea of who contributed what. Nicolas, in particular, regularly contributes a lot of work. He is responsible for a lot of the cool quality-of-life and advanced mapping features.
As of version 3, JoyShockMapper development is lead by **Nicolas Lessard**, who was already a long-time contributor and responsible for many of JoyShockMapper's powerful mapping features, autoload, tray menus, and much more. Have a look at the CHANGELOG for a better idea of who contributed what. While Jibb continues on as a contributor, JoyShockMapper is Nicolas' project now. This means updates won't be bottlenecked by Jibb's availability to approve and build them, and Nicolas has final say on what features are included in new versions. As such, make sure you're on [Nicolas' fork](https://github.com/Electronicks/JoyShockMapper) for the latest developments.

JoyShockMapper versions 2.2 and earlier relied a lot on [JoyShockLibrary](https://github.com/jibbsmart/JoyShockLibrary), which it used to read controller inputs. Check out that project to see what prior work made JoyShockLibrary possible. Newer versions use [SDL2](https://github.com/libsdl-org/SDL) to read from controllers, as the latest versions are able to read gyro and accelerometer input on the same controllers that could already be used with JoyShockLibrary, but also supports many non-gyro controllers as well.
JoyShockMapper versions 2.2 and earlier relied a lot on Jibb's [JoyShockLibrary](https://github.com/jibbsmart/JoyShockLibrary), which it used to read controller inputs. Newer versions use [SDL2](https://github.com/libsdl-org/SDL) to read from controllers, as the latest versions of SDL2 are able to read gyro and accelerometer input on the same controllers that could already be used with JoyShockLibrary, but also support many non-gyro controllers as well.

Since moving to SDL2, JoyShockMapper also uses [GamepadMotionHelpers](https://github.com/JibbSmart/GamepadMotionHelpers), a small project that provides the sensor fusion and calibration options of JoyShockLibrary without all the device-specific stuff.
Since moving to SDL2, JoyShockMapper uses Jibb's [GamepadMotionHelpers](https://github.com/JibbSmart/GamepadMotionHelpers), a small project that provides the sensor fusion and calibration options of JoyShockLibrary without all the device-specific stuff.

## Helpful Resources
* [GyroWiki](http://gyrowiki.jibbsmart.com) - All about good gyro controls for games:
Expand Down

0 comments on commit a294d24

Please sign in to comment.