How do I............

Post Reply
turbine
Member
Posts: 10
Joined: Tue Jul 16, 2019 13:35

How do I............

by turbine » Post

heres what i want to do:

I want to play local co-op with my son

heres what i have done:

i have opened 2 instances of the game, hosted a private server with one and connected to it with the other

heres my issue:

first, only 1 window can be focused at a time, so i can only control one of them at a time - is there a workaround for this anyone is aware of?
second, i am also looking for a way for the 2nd player to be played using a controller - is there a workaround for this too?

thanks for the help

User avatar
Linuxdirk
Member
Posts: 3218
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: How do I............

by Linuxdirk » Post

turbine wrote:only 1 window can be focused at a time
This is the fundamental concept of all window managers on all operating systems.

This is not changeable with reasonable effort. You can only have one layer of focus for input. I know some extremely nasty hacks that allow compiling and setting up X to have multiple focus levels. But no, you absolutely do not want to deal with this, trust me :)

Same with different input methods. You - in theory - could start a second X server and define to use the controller in this server and mouse/keyboard in another server. But same here: not with reasonable effort (and deep knowledge of the functionality of X and the xinput drivers).

This would only be valid for Linux and other systems that use X. Windows: I have absolutely no clue, but I totally doubt that this is possible in any way without hacks on the same level that the X hacks.

turbine
Member
Posts: 10
Joined: Tue Jul 16, 2019 13:35

Re: How do I............

by turbine » Post

the controller issue is not so bad, as worst case scenario i can just rebind the keys to keys that are unused by default, and then just use software to emulate mouse and keyboard on a controller using the redefined keys but i thought someone else might have a better way so thought id ask about that too

so really i just have the issue of keeping both windows in focus

twoelk
Member
Posts: 1482
Joined: Fri Apr 19, 2013 16:19
GitHub: twoelk
IRC: twoelk
In-game: twoelk
Location: northern Germany

Re: How do I............

by twoelk » Post

no "split-screen" playing seems to be planned
you always need two machines if 2 people want to play at the same time.

turbine
Member
Posts: 10
Joined: Tue Jul 16, 2019 13:35

Re: How do I............

by turbine » Post

thats not necessarily true mate, you can have 2 windows running side by side, like this https://ibb.co/R3n7SJ0

another way i could make this work, is if someone knows of a way i can send input to a background process? that way i do not have to try and keep both windows focused

twoelk
Member
Posts: 1482
Joined: Fri Apr 19, 2013 16:19
GitHub: twoelk
IRC: twoelk
In-game: twoelk
Location: northern Germany

Re: How do I............

by twoelk » Post

yup there is indeed a well hidden setting: in grafik/game/advanced

3D mode :
3d_mode (enum default none, values none,anaglyph,interlaced,topbottom,sidebyside,pageflip)
3D support.
Currently supported:
- none: no 3d output.
- anaglyph: cyan/magenta color 3d.
- interlaced: odd/even line based polarisation screen support.
- topbottom: split screen top/bottom.
- sidebyside: split screen side by side.
- pageflip: quadbuffer based 3d.

never seen that before

User avatar
Linuxdirk
Member
Posts: 3218
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: How do I............

by Linuxdirk » Post

turbine wrote:the controller issue is not so bad, as worst case scenario i can just rebind the keys to keys that are unused by default
You'll still only have one level of input focus.
turbine wrote:so really i just have the issue of keeping both windows in focus
As said: Without super heavy configuration tricks/hacks and maybe manual patching and recompiling of X this is not possible. This is not Minetest related at all but a fundamental thing of how window managers work since the first window manager was released nearly 50 years ago.
turbine wrote:thats not necessarily true mate, you can have 2 windows running side by side, like this https://ibb.co/R3n7SJ0
Of course you can. Still only one is focused.
turbine wrote:... if someone knows of a way i can send input to a background process? that way i do not have to try and keep both windows focused
Good luck.

https://superuser.com/questions/367882/ ... ut-devices
twoelk wrote:yup there is indeed a well hidden setting: in grafik/game/advanced

3D mode :
[- sidebyside: split screen side by side.]

never seen that before
Side-by-side 3D has absolutely and 100 percent nothing to do with splitscreen multiplayer.

twoelk
Member
Posts: 1482
Joined: Fri Apr 19, 2013 16:19
GitHub: twoelk
IRC: twoelk
In-game: twoelk
Location: northern Germany

Re: How do I............

by twoelk » Post

Linuxdirk wrote:...
twoelk wrote:yup there is indeed a well hidden setting: in grafik/game/advanced

3D mode :
[- sidebyside: split screen side by side.]

never seen that before
Side-by-side 3D has absolutely and 100 percent nothing to do with splitscreen multiplayer.
:(

so that's why I couldn't find anything about splitting controls

except if this still works ... maybe ..

turbine
Member
Posts: 10
Joined: Tue Jul 16, 2019 13:35

Re: How do I............

by turbine » Post

im on windows

User avatar
Linuxdirk
Member
Posts: 3218
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: How do I............

by Linuxdirk » Post

twoelk wrote:except if this still works ... maybe ..
Not sure about the xconfig commands (didn’t use it because … well … never had to set up such thing), but this is basically what the superuser.com answer describes, but semi-automated.

This still does not solve the issue of having multiple windows focused at the same time. Sorry, to say that, but having two windows focused at the same time is so absurdly far away from anything computers did the last 50 years that there simply is no solution for this.

The closest possible is remapping the input and accept that there is never more than one window in focus, or hacking into X and deal with all the consequences (ambiguity where to put what input), or setting up a multi-head system starting multiple X servers on different screens and bind the input devices to the individual servers.

The last solution requires two mice and two keyboards. Then you could run the two X servers nested in a third X server that only displays the two nested X servers. But this will cost a little performance.
turbine wrote:im on windows
You could bring up a working setup on Windows 10 using the WSL.

turbine
Member
Posts: 10
Joined: Tue Jul 16, 2019 13:35

Re: How do I............

by turbine » Post

i dont necessarily need both windows focused, i could have some way for the input to be sent to the "background" window - it can be done on minecraft so surely it can be done on this

User avatar
Linuxdirk
Member
Posts: 3218
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: How do I............

by Linuxdirk » Post

turbine wrote:it can be done on minecraft
So Minecraft magically takes the input that was sent to another window? Source please.

User avatar
FreeGamers
Member
Posts: 650
Joined: Sat May 25, 2019 00:15
GitHub: is proprietary I use NotABug
Location: United States
Contact:

Re: How do I............

by FreeGamers » Post

In my opinion, getting two instances of MT to work on the same operating system is not worth the headache.

A used system with at least an Intel HD4000 would be affordable and run MT quite well. A laptop like a used ThinkPad T430 or X230 could be connected to a TV via displayport to HDMI. Otherwise, an old desktop system with integrated graphics would work too. Minetest does not have high hardware requirements.

Otherwise, I would explore advanced virtualization options that relied on hardware passthrough to create a VM guest, had access to GPU and a USB host for the controller, and could output smooth game-play directly to a monitor or via a remote protocol optimized for quick transfer.

Run the game/server natively snap to half of the display, then have a VM Guset snapped to the other half with a USB host and peripherals passed through to it, and then you can seperate your controls. Getting the 3d performance and remote viewing protocols to be acceptably smooth might be a bit more work with this method though. Linux has very good VFIO support. Its no simple thing to setup though.

Your processor and motherboard hardware needs to support Vt-x and Vt-d for this. Then, since you're on Windows, you'll have to hope Microsoft decided to enable direct hardware passthrough for your version of Hyper-V and Windows, which I believe that feature is only accessible on Windows Server. Otherwise perhaps Virtualbox supports this. If you manage to get as far as passing through the USB device, then your biggest challenge will be getting video performance to be acceptable. As the remote protocols are usually not optimized for gaming or video streaming.

However, I've done solutions like this in the past using Redhat KVM/Qemu, VFIO, and a dedicated NVIDIA GPU and dedicated output device. Its not a trivial thing to figure out and there are complications at each step.
FreeGamers.org has moved to MeseCraft.net | FreeGamers on this forum is now MeseCraft

turbine
Member
Posts: 10
Joined: Tue Jul 16, 2019 13:35

Re: How do I............

by turbine » Post

Linuxdirk wrote:
turbine wrote:it can be done on minecraft
So Minecraft magically takes the input that was sent to another window? Source please.
there is a mod for minecraft that, when you can have 2 instances running, either one can use keyboard and mouse and the other can use a controller, its called joypad mod

turbine
Member
Posts: 10
Joined: Tue Jul 16, 2019 13:35

Re: How do I............

by turbine » Post

mate having 2 instances running side by side is not the issue at all, the issue is control input to the second instance @jeremyweston

User avatar
FreeGamers
Member
Posts: 650
Joined: Sat May 25, 2019 00:15
GitHub: is proprietary I use NotABug
Location: United States
Contact:

Re: How do I............

by FreeGamers » Post

turbine wrote:mate having 2 instances running side by side is not the issue at all, the issue is control input to the second instance @jeremyweston
Well, that sounds like an issue of running two instances side by side.
FreeGamers.org has moved to MeseCraft.net | FreeGamers on this forum is now MeseCraft

turbine
Member
Posts: 10
Joined: Tue Jul 16, 2019 13:35

Re: How do I............

by turbine » Post

jeremyweston wrote:
turbine wrote:mate having 2 instances running side by side is not the issue at all, the issue is control input to the second instance @jeremyweston
Well, that sounds like an issue of running two instances side by side.
it isnt, its an issue with the operating system, actually and running 2 instances side by side is incredibly easy

User avatar
Linuxdirk
Member
Posts: 3218
Joined: Wed Sep 17, 2014 11:21
In-game: Linuxdirk
Location: Germany
Contact:

Re: How do I............

by Linuxdirk » Post

turbine wrote:there is a mod for minecraft that, when you can have 2 instances running, either one can use keyboard and mouse and the other can use a controller, its called joypad mod
So basically just binding input to a process. Or even simpler: grabbing raw data from the input devices sent to the OS before processing it. This is actually quite possible.

Just have two different joypads and configure them differently in two different instances of the client and hope that the driver does not only send key presses to the currently active window and that the process accepts input while not in the currently active window.

This is completely different from your initial question though.

User avatar
FreeGamers
Member
Posts: 650
Joined: Sat May 25, 2019 00:15
GitHub: is proprietary I use NotABug
Location: United States
Contact:

Re: How do I............

by FreeGamers » Post

I know they can run side by side, I've simply suggested a workaround to bypass separating inputs to the focused window by using virtualization.

The only software I know that might do that sort of input to key binding is Xpadder. Its a paid proprietary solution that requires an activation license.
FreeGamers.org has moved to MeseCraft.net | FreeGamers on this forum is now MeseCraft

turbine
Member
Posts: 10
Joined: Tue Jul 16, 2019 13:35

Re: How do I............

by turbine » Post

Linuxdirk wrote:
turbine wrote:there is a mod for minecraft that, when you can have 2 instances running, either one can use keyboard and mouse and the other can use a controller, its called joypad mod
So basically just binding input to a process. Or even simpler: grabbing raw data from the input devices sent to the OS before processing it. This is actually quite possible.

Just have two different joypads and configure them differently in two different instances of the client and hope that the driver does not only send key presses to the currently active window and that the process accepts input while not in the currently active window.

This is completely different from your initial question though.
well i did say it previously, anyway, ive already tried just hoping for the best and unfortunately it will still only provide input to the focused window

turbine
Member
Posts: 10
Joined: Tue Jul 16, 2019 13:35

Re: How do I............

by turbine » Post

jeremyweston wrote:I know they can run side by side, I've simply suggested a workaround to bypass separating inputs to the focused window by using virtualization.

The only software I know that might do that sort of input to key binding is Xpadder. Its a paid proprietary solution that requires an activation license.
yeh i bought xpadder years back, you can do the same with steam simply by adding any non steam game to steam too but it doesnt solve the problem in this instance

Post Reply

Who is online

Users browsing this forum: No registered users and 36 guests