Hi All,
I've recently become very interested in writing a bot for Super Smash Bros Melee and figured Dolphin would be the perfect platform for accessing and manipulating the game. My current obstacle is figuring out a way for my program to talk to Dolphin and send inputs. After doing research on what others have done with the same regard, I noticed that Dolphin currently only supports communication from other processes through Unix pipes.
I was wondering whether it would be possible to expand this type of support to Windows? I know that there are several methods of IPC built in to Windows (other than pipes), but I don't know which is the best. If it is possible, how should I go about implementing it?
My system is Windows 10 x64 with an Intel i7 processor. I am currently using Dolphin 5.0-321.
Apologies if I missed something I should have included in the post, this is my first time posting to a forum. Thanks in advance.
yum
Cross platform scripting support is something that has been on the agenda for a long time, but probably won't come any time soon. Some devs have been working on this from various directions, but progress is pretty slow. The 5.0 Release blog post talks about it a little bit in the "Predictions for the next release?" section.
(05-30-2017, 04:34 AM)yum Wrote: [ -> ]I was wondering whether it would be possible to expand this type of support to Windows? I know that there are several methods of IPC built in to Windows (other than pipes), but I don't know which is the best. If it is possible, how should I go about implementing it?
Yes, it should be possible. I don't know much about Windows IPC myself, though.
(05-30-2017, 05:56 AM)Fallcrest Wrote: [ -> ]Cross platform scripting support is something that has been on the agenda for a long time, but probably won't come any time soon. Some devs have been working on this from various directions, but progress is pretty slow. The 5.0 Release blog post talks about it a little bit in the "Predictions for the next release?" section.
Scripting support isn't the same as sending controller input from another process (and MemoryWatcher). What the original post is asking for is something that probably can get done soon as long as there's someone who wants to work on it, unlike scripting.
(05-30-2017, 06:47 AM)JosJuice Wrote: [ -> ]Scripting support isn't the same as sending controller input from another process (and MemoryWatcher). What the original post is asking for is something that probably can get done soon as long as there's someone who wants to work on it, unlike scripting.
Apologies, then.
Apologies for the late reply, and thanks for the responses.
So by "it should be possible", do you mean that there is already a start to the implementation in the Dolphin project? If I could start from there, that would be a lot of help. Otherwise, do you know of anyone I could get in contact with that might be able to better direct me?
Right now, my only reasonable idea is imitating the Unix IPC support by setting up a similar system using Windows pipes. Not sure how easy/hard that will be, need to do more research.
(06-04-2017, 03:32 PM)yum Wrote: [ -> ]So by "it should be possible", do you mean that there is already a start to the implementation in the Dolphin project? If I could start from there, that would be a lot of help.
There's only the existing Unix implementation.
(06-04-2017, 03:32 PM)yum Wrote: [ -> ]Otherwise, do you know of anyone I could get in contact with that might be able to better direct me?
I don't know any specific person, but if you'd like to ask something to as many developers as possible, the best place to do it is probably the development IRC channel (#dolphin-dev on freenode).
At least for the "send input" part, you may want to look into the
SendInput Windows API. It lets you synthesize keystrokes.
(06-04-2017, 07:50 PM)JulianLoehr Wrote: [ -> ]At least for the "send input" part, you may want to look into the SendInput Windows API. It lets you synthesize keystrokes.
That's going to be awkward for analog sticks, though.
Oh, indeed. Didn't thought about that. It does let you send Hardware Input events, but there seems no way to provide the synthesized RAWINPUT buffer.
Alright, I'll try posting a question in the channel then.
I can't believe I overlooked the SendInput function. Although I agree it's not the ideal method when it comes to simulating analog input, it might get the job done for at least a start to the project.
Also, would it be possible to somehow read the input data from a Gamecube controller as HID raw input data, store it somewhere, then analyze and organize it later to match corresponding controller inputs? I didn't think of that until you mentioned RAWINPUT, so I haven't done much research on it, but that would be a fantastic resource (apologies for the slightly unrelated coding question).
Thanks again for all the responses.