From a294d24f51cb78a46248c466e0166408f20fe996 Mon Sep 17 00:00:00 2001 From: Jibb Smart Date: Mon, 8 Mar 2021 12:01:41 +0800 Subject: [PATCH] Nicolas should be in the license on his own fork going forward ;) Also 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 --- CHANGELOG.md | 8 ++++++-- JoyShockMapper/src/main.cpp | 4 ++-- LICENSE.md | 6 +++--- README.md | 19 ++++++++----------- 4 files changed, 19 insertions(+), 18 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fd18c35..9f844a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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. @@ -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. diff --git a/JoyShockMapper/src/main.cpp b/JoyShockMapper/src/main.cpp index 753561a..08753aa 100644 --- a/JoyShockMapper/src/main.cpp +++ b/JoyShockMapper/src/main.cpp @@ -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); diff --git a/LICENSE.md b/LICENSE.md index 680464d..df4f8fd 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -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: @@ -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 --- diff --git a/README.md b/README.md index f11359a..74749f9 100644 --- a/README.md +++ b/README.md @@ -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). @@ -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: @@ -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! @@ -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) @@ -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: