komefai / PS4Macro

Automation utility for PS4 Remote Play written in C#
http://blog.komefai.com
MIT License
375 stars 89 forks source link

[Feature Testing] Mouse input in Remapper #13

Open komefai opened 6 years ago

komefai commented 6 years ago

This issue is for anyone who want to try the "Mouse input" feature in Remapper. The feature not yet ready, and that is why I decided to delay the release of the next version and release this debug build here instead. You can help me improve this feature by testing it with different games and report the bugs in this issue.

Usage

Open Remapper and check "Enable Mouse", then click on PS4 Remote Play to focus the window. To stop, you can press Alt+Tab to focus other windows.

Mouse Input Settings

NOTE: Default settings are recommended (except for Sensitivity) but feel free to play around with it for different games.

Sensitivity - The amount used to multiply the speed of the mouse Decay Rate - The amount used to divide the speed of the mouse every frame after the mouse stopped moving Decay Threshold - Threshold of the speed (will decay until the speed drops below the threshold) Deadzone - The offset amount from analog stick center to start from (use 0 to start from the center) [Value ranges from 0-127] Makeup Speed - The amount used to multiply AFTER the mouse speed is scaled into analog values to compensate the lost from the decay

Example Deadzone=14.25 (green box represents the deadzone)

Analog stick movement will start at the green line instead of starting from the exact center. remapper_mouse_deadzone


View source: https://github.com/komefai/PS4Macro/blob/master/PS4Macro/Classes/Remapping/Remapper.cs

Screenshot

Screenshot

Download

LATEST (14/04/2018)

-> Multi-monitor support -> Middle click bindings

PS4Macro_cf7ce2c.zip -[commit cf7ce2c]

Previous Builds (oldest first)
  1. PS4Macro_1408820.zip - [commit 1408820]
  2. PS4Macro_2d3d6e2.zip - [commit 2d3d6e2]
  3. PS4Macro_2ec5033.zip - [commit 2ec5033] (Special thanks to Y-T-G)
  4. PS4Macro_c43dbd4.zip - [commit c43dbd4]
  5. PS4Macro_658584b.zip - [commit 658584b] (Special thanks to Y-T-G again!)
Y-T-G commented 6 years ago

@SebaPJ The joystick is being scaled to the mouse speed. Also I don't experience any such issues. Movement is smooth as butter. The issue you're experiencing has already been addressed long before (see initial posts in here) by implementing "Deadzone" option. To get smooth movements you need to set Deadzone to 14.65 . If this value doesn't make it smooth, keep increasing it slightly as different games may require different value. To clarify, this is not your Mouse's Deadzone but the stick's. It sets a starting position for the Emulated Joystick to compensate for the Joystick Deadzone implemented in-game. Secondly, keep your in-game sensitivity max (important) and begin with default Remapper Sensitivity (1.00) and Makeup Speed (500) and adjust it as per your requirement.

rafalwojna commented 6 years ago

Im having the same issue as SebaPJ here is a video showing what is going on https://www.youtube.com/watch?v=UzslYcROklQ

Y-T-G commented 6 years ago

@rafalwojna Thanks for the video. I recognize the actual problem now. @komefai Have you found a replacement for overflow? I guess just let the line be included in the code because the users above are reporting the same issue that I reported earlier. Besides, as I said earlier, there are no complications with the line included.

picobots commented 6 years ago

I realize that the main use for Remapper mouse input is for FPS aiming, but just a quick note that I've played around with all sorts of different mouse input settings and I can't execute the simple "rotate the left analog stick clockwise" command required by South Park: The Fractured But Whole:

https://imgur.com/9yYdBG6

Not sure if I'm just configuring the settings wrong or what, but I've tried a lot of different variations.

P.S. PS4Macro is amazing. Thanks for all of your hard work on this.

SD777x commented 6 years ago

Sigh, I had this running for one glorious minute. Then it stopped working as I described in a previous post. Running Remapper and the keyboard works well, although it does some funky things like not allowing the keys to work outside of ps4 remote at all. I can press the ALT key and get the key functions back though, weird.

But the main thing is that once I click enable mouse the keyboard stops working and the mouse doesn't work at all. It seems PS4 remote defaults back to the stock settings where the only keys that work are the directional keys for the Dpad. Only once did it work, on my first try. I'm not sure if it's my system or what. I am making sure I'm using ps4 macro and remapper on the SAME screen as ps4 remote. I'm starting them in the correct order. PS4 remote, then ps4 macro, wait for the controller input to change, then start game, then after game started open remapper. I can literally sit there and enable/disable mouse in remapper and it does the same thing on and off, so the issue can be replicated easily.

Anyhow hope it gets worked out. For the single time it worked I set sensitivity to 20 and deadzone to 14.65 and it worked pretty darn well. This is with Horizon Zero Dawn and my remote PC is a 2017 surface pro i5/8gb using it on an external 40" 4k monitor.

Y-T-G commented 6 years ago

@picobots Might be a limitation with the emulated controller. Can't confirm though. @spinedoc777 Did you try these steps ?

komefai commented 6 years ago

@Y-T-G I haven't found a replacement for mouse overflow yet, but I can bring back the code from that commit and see how it goes. Along with that fix, I will also add a checkbox to the UI to not hide the cursor which should make it much easier for debugging.

komefai commented 6 years ago

@rafalwojna Thanks for the video!

@picobots I'm not sure how the game detects the movement for the analog stick, but if the game is expecting a perfect clockwise movement then I think it will be a little difficult to achieve with a mouse. You can try setting the sensitivity very high and increase the deadzone to 20+ but I don't think that will work so well for normal controls.

@spinedoc777 When you're using Remapper mode, the keyboard (and mouse) are supposed to be captured and not allowed to work outside of PS4 Remote Play in order to simulate the mouse input you get in a PC game. As mentioned in the Usage, you have to Alt+Tab out to focus other window to stop remapping. I think the reason that it defaults back to DPad only is probably because PS4 Remote Play window loses the focus somehow. If you can easily replicate the issue then please record a video of it and send me a link to the video if possible.

Y-T-G commented 6 years ago

How do I map to Middle Mouse button? MButton doesn't seem to be working.

Y-T-G commented 6 years ago

Ok, so finally, I managed to do longer tests with the Mouse. I noticed that Aim Bouncing was not gone, but was less frequent than it used to be. I went back to the code and deleted the Recenter and CursorOverflow Reset code. Now, after 4 days of playing with my mouse, I can confirm that the issue is finally gone and the mouse is working flawlessly.

jdorman12 commented 6 years ago

Do you have a working compiled exe with that we can test?

komefai commented 6 years ago

@Y-T-G That's great news! That means we actually don't need the code to handle the overflow at all and assume that the working space (the user's screen resolution) is large enough to gain enough speed to move the analog stick. If the resolution is not large enough then I guess they can increase the mouse speed and sensitivity at the OS level to compensate that.

How do I map to Middle Mouse button? MButton doesn't seem to be working.

Hmm. that is not suppose to happen because I did got it working before. Can you try replacing the right mouse hook by changing GlobalMouseHook.MouseState.RightButtonDown and GlobalMouseHook.MouseState.RightButtonUp to GlobalMouseHook.MouseState.MiddleButtonDown and GlobalMouseHook.MouseState.MiddleButtonUp in Remapper.cs and see if it works?

PS. Can you also upload your working version of Remapper.cs that fixes the Recenter and CursorOverflow issue so I can merge it with my current code?

Y-T-G commented 6 years ago

Remapper.cs - (commit)

That means we actually don't need the code to handle the overflow at all and assume that the working space (the user's screen resolution) is large enough to gain enough speed to move the analog stick.

But overflow is still there doing its job, right? I just removed the Overflow Reset code.

Can you try replacing the right mouse hook by changing GlobalMouseHook.MouseState.RightButtonDown and GlobalMouseHook.MouseState.RightButtonUp to GlobalMouseHook.MouseState.MiddleButtonDown and GlobalMouseHook.MouseState.MiddleButtonUp in Remapper.cs and see if it works?

Will try and report, thanks.

@jdorman12 I do have the .exe obviously, but I think its better to wait for @komefai to upload his compiled version.

komefai commented 6 years ago

But overflow is still there doing its job, right? I just removed the Overflow Reset code.

After I've seen your code it should be pretty much the same. I still have to test and print out the values to make sure there are no weird side effects.

Y-T-G commented 6 years ago

@komefai Changing the hook as you suggested worked.

WraithWinterly commented 6 years ago

What would be the best mouse settings that would be smooth?

Sorry for these questions I am very new to this.

sarmadh17 commented 6 years ago

please update new 1-aim down sight mode 2- hip 3- mouse acceleration 4 - x/y radio 1.00 5 - x/y sensitivity x or y fix sorry bad english

komefai commented 6 years ago

@softwinner360 It depends on the game you're playing. Using the default mouse settings as a starting point, you could try setting the Decay Rate to 1.01 (minimum) and increase sensitivity/makeup speed for a "smoother" feel. I also recommend finding a sensitivity setting in your game and set it to maximum.

hajimesaitou commented 6 years ago

Ok, so I'm trying to play God of War right now and the Remapper seems to be working with the PS4 but the mouse is not working. It seems that, comparing notes with a friend, the "hover menu" shouldn't appear, but in mine remote play it does. Using the latest build and in a dual monitor setup.

TamaKaiNya commented 6 years ago

@hajimesaitou close out both programs and relaunch, it never hooks correctly the first time after boot. @komefai @Y-T-G Can you look into this issue please?

hajimesaitou commented 6 years ago

@TamaKaiNya hummm, tried it, not solved. The thing is: While the Remote Play is opened and NOT connected the mouse is "Snapped" to it, not letting me even hover it around the screen. But once the Remote Play is connected to the PS4 it "unsnaps", just like when the "Enable Mouse" check box is not checked.

hajimesaitou commented 6 years ago

Well, I'll be damned, messing with the software options I clicked at resized, changed NOTHING and pressed okay. It just worked.

Magictub commented 6 years ago

I'm not sure how to put it... but when playing a game like Call of Duty: Black Ops 3, I attempted to use the mouse, and... it works, but it feels like I cant move it in the way a mouse should work, and more like just pressing buttons individually to make the camera move. Any way to bypass this? I expect this might be a common problem for others when using this.

mayconramos21 commented 6 years ago

Hello guys, can anyone tell me if they have some video teaching the step by step how to use the keyboard and mouse? I managed to put the keyboard to work, but the mouse does not work.

KaruroHNS commented 6 years ago

@mayconramos21 Hi, i use this version from a @Y-T-G comment: https://github.com/komefai/PS4Macro/files/1734519/PS4Macro_c43db4.zip (i dont put the file Settings.xml) Just go to Remapper, click on enable mouse, save bindings,(i dont close the remapper window) Alt+Tab and click the PS4 Remote Play window

mayconramos21 commented 6 years ago

@KaruroHNS Hello, thank you very much for the tip, it worked well here, but I want to ask a question with you, I have many FPS games, and I do not understand anything, when I play and active the gun look of the character is impossible to do, releasing and I can not point, when I run the character walks and stops and remains in this infinite repetition, could you help me solve it? I'm a layman on this subject, I'm sorry for my English, I'm Brazilian.

sinncere commented 6 years ago

Hi @komefai , After testing your latest KBM i noticed that the plugged in PS4 controller for split seccond becomes active whilst moving the mouse, I tested this by holding down R2 on PS4 controller whilst waving the mouse around at the same time.

I don't know if this only happens to me? but ill try find more bugs to help improve your app.

KaruroHNS commented 6 years ago

@mayconramos21 Hi , the mouse calibration is not finished, that's why we can not play FPS. We'll have to wait for a new update from @Komefai .Are you playing watching the PS4 remote play window? Because if you do, you will see everything more laggy. I change to the HDMI output from the monitor where the PS4 is connected to see everything in real time. Boa sorte. Psdt: My english is worst :'v I'm from Peru

hamslicejumbomice commented 6 years ago

Is there a button I can use or something to disable the mouse? Whenever I have the mouse enabled and begin playing my game I have no way to disable it after that. I have to close Remote Play with task manager to get my mouse back

MCStocker20 commented 6 years ago

hey! after testing out the Makeup Speed on the remapper, i recommend you guys to change the values a little more higher to like 2000-3000 I would like to know how to change the settings for that options

D1ce-remnant commented 6 years ago

hey, i have NO idea what im doing, i started up everything and the keys work but when i use the mouse it just looks up and spins around. what settings in the remapper should i have for the mouse? Thanx

MrDadosz commented 6 years ago

Mouse is pretty much bugged. Make sure, that you are using latest version - https://github.com/komefai/PS4Macro/files/1909931/PS4Macro_cf7ce2c.zip. I'm working on this, if you want you can test this compiled version - https://www88.zippyshare.com/d/makT1DYU/41494/PS4Macro%20mouse%20test.rar, it's not working perfectly, but it's playable.

mayconramos21 commented 6 years ago

The application has improved a lot, but is not yet playable for FPS games ....

MrDadosz commented 6 years ago

You can test this version: https://www78.zippyshare.com/v/koww7XRE/file.html

I play The Last of Us with a friend and I don't have a problem with doing headshots, but it depends on system mouse settings, like DPI or mouse rate (friend has aiming problems with his 100Hz mouse, I don't have problems with 1000Hz mouse). Code is very messy and some things like deadzone aren't working, but that's better than unplayable games. If someone wants source code of this: https://www20.zippyshare.com/v/z1pa4xL4/file.html I'd have done better if I'd know how mouse is working in other similar programs.

mayconramos21 commented 6 years ago

@MrDadosz Thanks a lot for your help, would you have a tutorial helping to set it up? when active nothing works.

this was in the last update I play rainbow six, when I'm going to pull the crosshair, it does not come, it keeps coming and going. and when I go running it goes and stops

MrDadosz commented 6 years ago

@komefai you forgot to save and load Middle Click bind. It's resetting everytime.

There's a delay between PS4 Remote Play and PS4. This can't be fixed.

If you have a PS4 pad connected to your PC: delete settings.xml or set EmulateController to false inside settings.xml file;

Disable PS4 Remote Play if there's any in task manager. Run a PS4 Remote Play, connect to your PS4, You have to be in the game/PS4 menu and set fullscreen if you want to. Open PS4Macro.exe as administrator, open Tools > Remapper (you have to leave this window open, otherwise mouse won't work). Set your bindings and sensitivity, save bindings. Alt + Tab to Remote Play. https://youtu.be/uXggsUJkcUU

Mouse settings aren't working (only sensitivity is working) in my "test version". You can change some settings via source code by editing it and compiling it.

mayconramos21 commented 6 years ago

Well I can play now, very good it =D, So I still have a problem If I hit the key for the character to walk, my character is walking alone, if I throw the grenade once, he keeps repeating the movement without me triggering it. Has this ever happened to you?

MrDadosz commented 6 years ago

No, never. Check your CPU usage and your network connection. You can try to set process priority to high, that can solve this problem.

mayconramos21 commented 6 years ago

Ok I'll check here, another question, is it possible to use this program on the macbook? Do you have any versions for it?

MrDadosz commented 6 years ago

I don't think that it can be compiled to Mac. Maybe someone will know, but this is my first time editing something in Visual Studio. I don't have enough experience.

NomNomMonstr commented 6 years ago

@MrDadosz Hi, Im a bit late to this whole thing, but I looked at your recompiled version and I'm personally finding bugs during use. The Dead zones and movements for +X and -Y mouse are spot on, however, for -X and +Y they're huge. noticeable enough that i have to move my mouse about 4 inches for movement to kick in while on the others, theyre spot on. Any chance this could be fixed? Idk if you dropped it yet.

MrDadosz commented 5 years ago

@NomNomMonstr I'd write it again with customizable variables in remapper's window, but I don't have time right now. I don't know how it should work. Now it's emulating pad, it's centering thumb sticks every frame. I think that this way in my code is the best (but code is poor), but maybe there's better way.

WraithWinterly commented 5 years ago

@MrDadosz I can't recompile it. I even downloaded it again and couldn't even recompile it fresh. It gives me a number of errors... What's wrong?

MrDadosz commented 5 years ago

What errors?

WraithWinterly commented 5 years ago

The variables give me errors about not being linked or somewhat, I'm not totally sure as I am very new to C#... Also how's the mouse input feature you're working on going?

SD777x commented 5 years ago

Is there a link for the latest version? I'm still on 658584b but I see there is a newer version from April 2018. Is the April 2018 the latest version and is komefai still working on this? Thanks for all the hard work.

KTCYT commented 5 years ago

Who have a best comfort settings? Like sensivity, deadzone, decay rate

kevinfaveri commented 5 years ago

any update? does anyone has a build with this feature? is this software still in development?

KoRnBoy82 commented 5 years ago

any update? does anyone has a build with this feature? is this software still in development?

Sorry, I tried to be in touch with Komefai and I had no replies lately. Will try again. I see all your tickets coming in my mailbox but I'm not a good programmer.

MrDadosz commented 5 years ago

I did some changes in my code. Now you can change variables in UI. I don't know if recording is working, but I'm using it for gaming with keyboard + mouse. It's working pretty good assuming that this is emulating pad. It shouldn't have bug that @NomNomMonstr mentioned.

https://i.imgur.com/ea4KAr9.png

http://www.mediafire.com/file/82awtk64f64w5vh/PS4Macro_2.0.rar/file

Source code: https://github.com/MrDadosz/PS4Macro/commit/1b9a7fb1e291bf8b46cb220466d35e81ad9c5a08