Page 1 of 1

Prevent Client Suspension for False Splitscreen

Posted: Wed Jan 23, 2013 2:55 am
by drake raider
Hello, I am the Drake Raider from the Zdoom forums, and having just replaced skulltag with Zandronum, and having a question involving expirimentation with said port, I thought I might get more relevant answers on this board. So I joined you all! And will try to avoid being annoying.
Spoilered for length, I'll copy my post from the Zdoom forums at the bottom for those unwilling to read the whole thing.
[spoiler]This may or may not be a weird question, but I have done research, and found Doom Legacy to be the only split-screen supporting PC source port, and it doesn't have Hexen or Strife support. Not wanting to wait (Hexen is even better coop,) I figured if I could run two clients simultaneously, with different control systems, and connect them to a single local server, top the whole thing off with externally enabled window border removal, and I would have myself a simulated split-screen. Now all this I almost achieved, save one problem.
My machine is more than capable of running these three processes, and more, but Zandronum, and probably other Zdoom-based ports as well, is designed to automatically deactivate when you switch out of focus. In single player, this translates as a pause, in MP, it requires switching between the windows whenever you do something to see the status update in the other, currently idle, client.
Now this function I know the good people here to be aware of, but I don't know the extent to which it's been explored. Does anyone know of a means of preventing it from realizing that it has been switched out of, and thus continuing to run, and accept input, as normal? I'm using two gamepads, so there isn't a problem of my input being confused with that used for other programs.[/spoiler]
From the corresponding post on the same topic on the Zdoom forums, if someone found that previous to be tl;dr,
I have this:
"Now I know, this is Zandronum, not ZDoom, and this question is kind of silly, but I've been experimenting with it, and I was wondering if there was a means to keep the client from suspending when the window was out of focus. The goal is a simulation of splitscreen by connecting two simultaneous instances to a local server. If anyone knows a workaround, could you share? My machine can handle both at once, it's just irritating to have to click from window to window to update the multiplayer status for each player."
Thanks in advance for any help I get!

RE: Prevent Client Suspension for False Splitscreen

Posted: Wed Jan 23, 2013 3:20 am
by Llewellyn
Well it's open source, and it's probably a simple change of focus, but this has been asked before...

RE: Prevent Client Suspension for False Splitscreen

Posted: Wed Jan 23, 2013 3:33 am
by drake raider
I assume it has, I just wasn't able to find where in the halfhour I was willing to spend searching. I'm far to lazy to deserve an answer, however, if someone has one that they don't have to do too much to find, I would be grateful.

RE: Prevent Client Suspension for False Splitscreen

Posted: Wed Jan 23, 2013 3:56 am
by Llewellyn
drake raider wrote: I assume it has, I just wasn't able to find where in the halfhour I was willing to spend searching. I'm far to lazy to deserve an answer, however, if someone has one that they don't have to do too much to find, I would be grateful.
It looks like a simple change in /src/win32/i_input.cpp but I have no idea how to actually build Zandronum otherwise I would try to help :/

RE: Prevent Client Suspension for False Splitscreen

Posted: Wed Jan 23, 2013 3:58 am
by drake raider
Thanks for the advice, it'd be good for me to get some source practice, I'll see what I can find. I was more thinking of an external program, like the one I'm using to get the borderless windowing, but that works, too. Couldn't find any, anyway.

RE: Prevent Client Suspension for False Splitscreen

Posted: Sat Jan 26, 2013 4:16 pm
by BlackFish
+1 to this if it's possible. False splitscreen works in doomsday atm.

RE: Prevent Client Suspension for False Splitscreen

Posted: Mon Feb 11, 2013 11:04 pm
by drake raider
Does Doomsday have multiple joystick support, or do I need to use Xpadder?

RE: Prevent Client Suspension for False Splitscreen

Posted: Fri Mar 01, 2013 5:17 pm
by Sonicteam Power
+1 for this :biggrin: , Should be an Option in the "Options" screen (like, "Never Lose Focus"), See how the VBALink (Game Boy Advance Emulator with the Link Cable Emulator) does this, you can open 4 Screens and control! With this is possible to do a "False" Splitscreen...

RE: Prevent Client Suspension for False Splitscreen

Posted: Fri Mar 01, 2013 5:54 pm
by one_Two
Has anyone tried this with one in a virtual machine?

RE: Prevent Client Suspension for False Splitscreen

Posted: Sat Mar 02, 2013 3:07 am
by Strych6
welcome, I like zdoom folks they're often quite technical/witty.

I've actually been wondering if this could be fixed. Demos get a bit odd on my end, if I alternate tabs. Something tells me its more trouble than its worth

RE: Prevent Client Suspension for False Splitscreen

Posted: Tue Mar 05, 2013 5:26 am
by drake raider
I'm afraid that mayhaps I might not be as technical or witty as most, but this is from a lack of experience modding. I didn't expect so much progress on this thread since I last posted, but since it is here, I will provide my reason for requesting. You see, thanks to various political motivations which I shall avoid discussing, our economy sucks to the point where there are apartments to live in my access range. So I spend alot of time living with my parents, though this isn't constant. And even when I do have an external base, I do visit them occasionally. I also happen to have nine siblings who I enjoy socializing with very much. Now due to said economy, not all of them are able to get computers. So my desire is to host three of them or so on mine, whilst perhaps playing online simultaneously. I mean, what better way to socialize then Demon Extermination? Or my personal favorite, Serpent Rider hunting. So is it more trouble than it's worth? Depending on how many people have similar circumstances, and how we want to bring up a new generation of Doomers, I guess that's what you'd have to figure out.

RE: Prevent Client Suspension for False Splitscreen

Posted: Tue Mar 05, 2013 11:34 am
by one_Two
Someone should try what I suggested, my thinking was that a virtual machine running it would maintain its focus.

RE: Prevent Client Suspension for False Splitscreen

Posted: Sat Mar 09, 2013 12:14 pm
by Sonicteam Power
one_Two wrote: Someone should try what I suggested, my thinking was that a virtual machine running it would maintain its focus.
Ok?, What Virtual Machine allow to "not lose focus", I'm trying this in a Windows 98 Virtual Machine (Yes, zDoom RUN in Windows 98...) with Virtual PC 2007...

EDIT:
Virtual PC DOES lose focus... :cry: , Didn't try VMWare/VirtualBox... (Well, Virtual PC has the best virtualization for Windows 9x...)

RE: Prevent Client Suspension for False Splitscreen

Posted: Fri Mar 15, 2013 12:07 pm
by drake raider
I could try that, I have VirtualBox. I'm thinking of asking the people over at the Visual Boy Advanced how they pulled it off, but that would involve more code. I tried using a useraccount trick, no cigar. Gonna try with Sandboxie, see if that helps.

EDIT No cigar with sandboxie.

RE: Prevent Client Suspension for False Splitscreen

Posted: Tue Mar 26, 2013 3:36 pm
by drake raider
Sorry about the double post, but it's due to bumping. I got the source, and am gonna be tinkering with it, I'll probably post the changes I make here if they work so that they can be incorporated in the future. I primarily intend to get it to stay active, and hopefully make that a menu option at some point. Now, I don't have any coding experience, outside decorate and ACS which are not the same thing, so if someone who has the code handy could point me where to start looking that'd be helpful.

Also, I have an idea for implementing fake splitscreen in menu. No idea how to code it, but I have the objectives.
Given that (spoilered for length, correct me if I'm wrong,)
[spoiler]1. Zandronum, being a ZDoom derivative, stores it's console variables in an ini file.
2. The ini filename defaults to the name of the user account in which it is created, and henceforth used, but you can force it to load other inis.
3. Zandronum already has the ability to customize filenames at player whim via the save system.[/spoiler]
Therefore, my objective is thus: [spoiler]1. Give the player the ability to create and choose inis with custom names straight from ingame, a profile system so to speak, as the functionality for that is clearly there, it just lacks the UI to do it. Seriously... I'm surprised it doesn't have this already. Then again, most people probably don't have a need for it, and the ones that do just use the console. However, if we could rig it so it divides save files by profile, so that with multiple people using a workstation you don't save over a bro's game, because it doesn't show up in the menu on your profile, that would be helpful. Not necessary, but that addition would give the profile system reason to exist. Well, besides the implementation of false splitscreen, heh.
2. Make the border only visible when Zandronum is both active and has the mouse in window. This would be complex to pull off, I think, but it'd be cool.
3. (Obviously, as this is the core of false splitscreen,) allow Zandronum to receive input and update the GL driver when inactive. In it's current state an inactive Zandronum window does not receive input, and when that instance is running the GL renderer, the GL renderer won't update until it becomes active again. The GL bit I don't have a clue how to pull off, but again, it'd be a nice fix. But just using the software renderer is fine for now.
4. Add a menu interface that creates new clients of Zandronum that can each load their own profile on startup. Unnecessary, but helpful.[/spoiler]

Now that's alot of typing, I'm gonna go mess with something else.