Ohjurot / DualSense-Windows

Windows API for the PS5 DualSense controller
Other
348 stars 39 forks source link

Unreal Engine 4 Port #9

Open KITATUS opened 3 years ago

KITATUS commented 3 years ago

Hey all, I've created a rudimentary port of the code to Unreal Engine 4 as a plugin. Did you want to include this in the repo somehow or would you rather I fork and place it elsewhere?

It's still a work in progress but it is functional.

Ohjurot commented 3 years ago

Hey KITATUS, that is amazing!

I think the most clean solution would be that you create a dedicated repository maybe called DualSenseWindows_UE4 or DS5W_UE4. So you can manage and structure the repo as you desire. As soon as you get a release for a specific lib version ready you can either send me the release files and I will add them to the lib's release or you send the link to your release and I will reference to your release in my release notes (So that your Insights are right). We will of course link to each other in the repos readme so that all users can find the right version they are looking for.

Of course it would be no problem for me to integrate the plug-in completely into my repo. Tell me what you think about that.

Looking forward to see the plug-in in action!

KITATUS commented 3 years ago

Sure, I want to do some clean-up first to get things running a little more efficiently on the Unreal side and then I'll slap up a dedicated repository, that sounds easier to deal with hotfixes .etc should they be needed.

I almost got the raw C++ files working out of the box with Unreal but off the top of my head, there were two key changes I had to make to ensure it played nicely with Unreal.

First I had to change the references to "Windows/MinWindows.h" and I had to add an Extern C wrapper to the include. They are the only changes I can remember right now that had to happen in the base library - would it be possible to look at filtering those changes back into the main repo as long as they don't alter any functionality / break any builds?

cooperate commented 3 years ago

This is hype. Looking forward to the UE4 demo lol.

Ohjurot commented 3 years ago

@KITATUS The changes shouldn't be a big deal. I will try to remember to add them to my next changes on main. Currently I'm still busy on another project.

bbagwang commented 3 years ago

@KITATUS Hello, I'm about to make it by myself on UE4 Port but I just saw this Issue. Did you finish the porting? If so I just wait for your code! also @Ohjurot thanks for the great work!

KITATUS commented 3 years ago

It's not quite ready due to some issues I've been having with inconsistent vibration. I've been working on refactoring to better follow the XINPUT representation within the engine source. Not sure if it is the best approach or if another refactor is in order. I have no problem uploading the code as-is (even with the buggy vibration) but I'm also happy for you to make your own port then we compare our ports and make a "best" version from the two codebases. Your choice I guess.

bbagwang commented 3 years ago

Hi, @KITATUS thanks for the fast reply :) I'm kinda new to making ue4 plugins so I'd love to see your approach. We can improve your codebase with the community I suppose. If you're okay with the release, how about give it a shot first?

Ohjurot commented 3 years ago

@bbagwang no problem I hope it will be useful in your projects! @KITATUS I got some more information about audio now! Checkout this issue where I give a little insight into the future of the project #13

bbagwang commented 3 years ago

Hey guys. how's it going. I'm trying to make UE4 Port in https://github.com/bbagwang/UE4DualSense

I just implemented very basic buttons and analog inputs for the testing. but there are some problems. T.T Critical frame drops sometimes happen when I give more than 3~5 inputs. (maybe game thread sync issue?)

@KITATUS Can you check my code and how should I approach it more adequately?

KITATUS commented 3 years ago

Hey guys. how's it going. I'm trying to make UE4 Port in https://github.com/bbagwang/UE4DualSense

I just implemented very basic buttons and analog inputs for the testing. but there are some problems. T.T Critical frame drops sometimes happen when I give more than 3~5 inputs. (maybe game thread sync issue?)

@KITATUS Can you check my code and how should I approach it more adequately?

I've got an implementation that follows XInput (i.e what the engine expects) - I'll throw it up as an early preview on Github later and you can compare your code to mine. I also have an earlier implementation that doesn't follow XInput but has more features.

KITATUS commented 3 years ago

Here is the REPO, I've set it to public: https://github.com/KITATUS/DualSenseWindows_UE4

NOTE: The repo isn't ready for public consumption and is still a work in progress but my code is there for you to take a look at whilst I work on it. Some links on the read me .etc aren't final. The files uploaded are just the .uplugin files but it will help get you started.

KITATUS commented 3 years ago

Here's the old Non-XInput more features version: DSWind_WORKING.zip

bbagwang commented 3 years ago

@KITATUS Thank you so much! I also have thought about the Issue with Sony.. hmm should I go for it or stop? I think Sony and Epic have their PS5 SDK Builds with Dual Sense Supports... I should talk to them before I do more :)

KITATUS commented 3 years ago

@KITATUS Thank you so much! I also have thought about the Issue with Sony.. hmm should I go for it or stop? I think Sony and Epic have their PS5 SDK Builds with Dual Sense Supports... I should talk to them before I do more :)

If you're going to launch on PC, you need to have an agreement with Sony and use their SDK they provide. You have to be a PlayStation Partner to do that: https://partners.playstation.net/ - You should be able to develop general ideas and things with the plugin just fine.