How to splitscreen/couch coop?

Discuss anything ZDoom-related that doesn't fall into one of the other categories.

Re: How to splitscreen/couch coop?

Postby drfrag » Thu Jun 27, 2019 7:07 pm

I've tested this and it doesn't work.
DabbingSquidward wrote:Last time I recall only the window in focus would receive inputs, be it gamepad or otherwise.

That's precisely the problem, otherwise it would work well on a dual core pc. It doesn't work on windows, can this input problem be easily solved? That would be great.

Edit: allowing gamepads to work in the background would solve this.
DISCL_BACKGROUND: The application requires background access. If background access is granted, the device can be acquired at any time, even when the associated window is not the active window.

https://bell0bytes.eu/directinput/

Edit2: done. :mrgreen: https://github.com/drfrag666/gzdoom/com ... d52b9a3c14
User avatar
drfrag
I.R developer, I.R smart
Vintage GZDoom Developer
 
Joined: 23 Apr 2004
Location: Spain

Re: How to splitscreen/couch coop?

Postby drfrag » Fri Jun 28, 2019 4:34 am

If there are no objections this coud be merged into GZDoom as well.
@realdevs: someone could go ahead and do the same for SDL, that 'SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS' thing.

Edit: what about adding 'SDL_SetHint("SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS", "1");' before 'if(SDL_InitSubSystem(SDL_INIT_JOYSTICK) >= 0)'?
Or should be 'SDL_setenv("SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS", "1", 0);' instead?
My linux machine is collecting dust right now.
User avatar
drfrag
I.R developer, I.R smart
Vintage GZDoom Developer
 
Joined: 23 Apr 2004
Location: Spain

Re: How to splitscreen/couch coop?

Postby drfrag » Tue Jul 02, 2019 7:47 am

I've done the same for linux, Blzut3 has approved the changes. :) https://github.com/drfrag666/gzdoom/com ... f2bc79577e
If there's interest i could do a PR.
User avatar
drfrag
I.R developer, I.R smart
Vintage GZDoom Developer
 
Joined: 23 Apr 2004
Location: Spain

Re: How to splitscreen/couch coop?

Postby Rachael » Tue Jul 02, 2019 8:38 am

Go ahead with the PR. Will have to get a few other Linux folks to test it, though.
User avatar
Rachael
Webmaster
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Graphics Processor: nVidia with Vulkan support

Re: How to splitscreen/couch coop?

Postby drfrag » Tue Jul 02, 2019 8:47 am

Will do. I wonder if it would be fine do do all the PRs from the same branch, AFAIK in theory it should work. :)
User avatar
drfrag
I.R developer, I.R smart
Vintage GZDoom Developer
 
Joined: 23 Apr 2004
Location: Spain

Re: How to splitscreen/couch coop?

Postby Rachael » Tue Jul 02, 2019 8:48 am

No, Github does not work like that.

You have to create a new branch for every PR.
User avatar
Rachael
Webmaster
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Graphics Processor: nVidia with Vulkan support

Re: How to splitscreen/couch coop?

Postby Graf Zahl » Wed Jul 03, 2019 1:35 am

Correction: It's not Github not working like that but Git not working like that.
A PR is nothing more than a work branch being asked to be merged back to the mainline, either by doing a real merge or a rebase. So any PR from some long running work branch will pull in all the changes that were made since branching off the mainline, i.e., it's not the commit being asked to be merged but the branch!
User avatar
Graf Zahl
Lead GZDoom Developer
Lead GZDoom Developer
 
Joined: 19 Jul 2003
Location: Germany

Re: How to splitscreen/couch coop?

Postby Rachael » Wed Jul 03, 2019 5:09 am

Graf Zahl wrote:Correction: It's not Github not working like that but Git not working like that.
A PR is nothing more than a work branch being asked to be merged back to the mainline, either by doing a real merge or a rebase. So any PR from some long running work branch will pull in all the changes that were made since branching off the mainline, i.e., it's not the commit being asked to be merged but the branch!

Yes - this is exactly right.

I think it's important to remember a distinction of what a commit really is for Git: each commit actually is its entire own unnamed branch (albeit in a frozen state), with complete history. That's why there's such a major difference between "git cherry-pick" and "git merge" - they might seem like they do the same thing, but they don't. "git merge" attempts to combine two histories together, where "git cherry-pick" intentionally tries to strip away a commit's history (and that's why a cherry-picked commit always has its own hash that's different from the commit that it came from).

This is important for multi-participant workflow because that allows multiple simultaneous projects to happen at the same time, for them all to eventually be merged in. It's what keeps Git from having a panic attack when you merge together 5 different 2000-commit branches, even when they touch the same files. (Yes, merge conflicts happen, but in an ideal world they'd be more rare than the ones we get in GZDoom - still though, people do deal with them)
User avatar
Rachael
Webmaster
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Graphics Processor: nVidia with Vulkan support

Re: How to splitscreen/couch coop?

Postby drfrag » Wed Jul 03, 2019 7:53 am

It works well, in D3D it's faster but this is a ultra-lowend laptop, i tested a bit with BDv21 using the gamepad for player 2.
Probably you'll get the best results in software and limiting the number of threads to half the cores but i'm not sure.
Done the PR. https://github.com/coelckers/gzdoom/pull/883

Of course a know what a merge is and that a cherry-pick is a rebase. I was thinking of resetting that branch and merging with master but that would screw older PRs and wouldn't be clean.
User avatar
drfrag
I.R developer, I.R smart
Vintage GZDoom Developer
 
Joined: 23 Apr 2004
Location: Spain

Re: How to splitscreen/couch coop?

Postby small moist » Mon Aug 12, 2019 5:05 pm

DrFrag / Rachael -
In the SSZdoom comments a couple of years ago Rachael said "it should be possible to combine this and my earlier attempt into the modern codebase and produce a working split-screen GZDoom on the modern codebase with all the features."

With the multiple instances seeming to work, do you guys still think this project could benefit from this?
I can't find any of Racheal's earlier attempts at modding the engine, but i'd absolutely get to work on it.
small moist
 
Joined: 17 Dec 2017
Discord: Small Moist#0407
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: nVidia with Vulkan support

Re: How to splitscreen/couch coop?

Postby Rachael » Mon Aug 12, 2019 11:58 pm

https://github.com/madame-rachelle/qzdo ... litscreen3

Keep in mind this is a) not complete, and b) it will not merge properly into the existing codebase, whatsoever. It might merge into LZDoom with a little trouble, though, but even if it does, you still need some sort of input discrimination for the two players, and you also need to put in some way to store the second player's configuration settings (skin/name/freelook/sensitivity/etc) permanently.

To put this into modern versions of GZDoom, much of this will have to be rewritten - but luckily this can certainly be used as a starting point for that. (If nothing else, to be used as a guidebook to how it can be done)

I'm putting this here as a learning tool/reference, nothing more. If you think you can salvage something from this, be my guest.
User avatar
Rachael
Webmaster
 
Joined: 13 Jan 2004
Discord: Rachael#3767
Twitch ID: madamerachelle
Github ID: madame-rachelle
Graphics Processor: nVidia with Vulkan support

Re: How to splitscreen/couch coop?

Postby drfrag » Tue Aug 13, 2019 5:09 am

The available info is there, as Rachael said her attempt was very hacky and invasive (isn't it the same for all splitscreen implementations?) and very incomplete.
I don't think this could be merged into LZDoom (it's based on 3.3 and that code is pre 2.4). You'd need to port the code and then there would be a lot of work to do. Besides, are you an expert programmer? Or better said are you a God? (like in the Ghostbusters movie) :)
Rachael wrote:It will be impossible to maintain this past the 2.4 release when the fundamental systems do start getting reworked, and inevitably the affected parts will have to be done from scratch.

viewtopic.php?f=45&t=55169&p=978828&hilit=splitscreen#p978068

AFAIK fake splitscreen works well enough and i don't know about performance but should be better with real splitscreen. But Rachael's implementation only works on GL with render buffers enabled (more modern hardware). Fake splitscreen is faster on software D3D and for better performance i've ported the feature to ZDoom32.
In SSZDoom it works only for D3D, player two is just a clone of player one and there are even two menus. And only XInput.
User avatar
drfrag
I.R developer, I.R smart
Vintage GZDoom Developer
 
Joined: 23 Apr 2004
Location: Spain

Re: How to splitscreen/couch coop?

Postby drfrag » Sat Aug 17, 2019 2:43 pm

Hey what happened? If you feel like doing it and you think you're capable go ahead, just don't break multiplayer. Many years ago i wanted to create my own port with splitscreen based on WDMP but i never did. :)
User avatar
drfrag
I.R developer, I.R smart
Vintage GZDoom Developer
 
Joined: 23 Apr 2004
Location: Spain

Re: How to splitscreen/couch coop?

Postby small moist » Wed Sep 11, 2019 1:41 pm

Hey! I don't see a point in doing the split screen feature with one instance now.

The performance of LZDoom in 4 player split screen (1080P) on my I7 7700 was outstanding, and with great mod support. SSZDoom performed way below that (not unplayable), but the lack of features that a standalone engine fork would have outweigh the split screen feature / poor performance so honestly we already have Eternity banana split for that.

I did do some work though to make the experience more enjoyable:
-Modified the DeathCoin gzdoom mod to provide a lives based coop survival mode (set lives at the command line with +lives). I made this compatible with SSZdoom / GZdoom / LZdoom, working on mod compatibility. Also fixed some quality of life issues and simplified it more.

-Made a collection of config / batch files that open 4 players with 4 controllers (got that working last night). 4 xinput controllers with 4 buttons each all emulating one controller, and ill add some app settings files for that.

I believe this is a better workaround that can keep up with GZDoom and doom more in the long run.
I'll keep making / refining some Coop things that should help populate the COOP scene.

Thanks for the encouragement haha, and the resources.
small moist
 
Joined: 17 Dec 2017
Discord: Small Moist#0407
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: nVidia with Vulkan support

Re: How to splitscreen/couch coop?

Postby drfrag » Wed Sep 11, 2019 4:59 pm

Glad it works well, that's a very fast machine. I tried 2 players with my nephew and we had fun, runs well on my ultra-lowend laptop. Recently i've added support for 4 DInput joysticks at the same time with 32 buttons each, i've tested it with 2 cheap gamepads. :)
User avatar
drfrag
I.R developer, I.R smart
Vintage GZDoom Developer
 
Joined: 23 Apr 2004
Location: Spain

PreviousNext

Return to General

Who is online

Users browsing this forum: Ahrefs [Bot], Semrush [Bot] and 6 guests