mgr_inz_rafal Posted December 5, 2018 Hello, How to keep GZDoom running in windowed mode in a background (non-active) window? Currently, when I switch to other app then GZDoom freezes... I tried "-noidle" param but without luck. 0 Share this post Link to post
Kappes Buur Posted December 6, 2018 When you have GZDoom open in windowed mode and then open another app, GZDoom will loose focus. So, the only thing you can do is switch from one to the other and back. The only app which will keep GZDoom running is something like a recording app to record the game. 0 Share this post Link to post
mgr_inz_rafal Posted December 6, 2018 It's ok that the game loses focus, but I would like, for example, monsters to continue chasing the player, even if the window is in background. 0 Share this post Link to post
Dark Pulse Posted December 7, 2018 That... would kind of suck. Like, what if the window lost focus for some reason, and by the time you came back to the game, you were a corpse on the floor? Personally I can't stand it when I can't pause a game. People got lives, yo. And sometimes you just need to get up to get a drink or deal a deuce or something. 0 Share this post Link to post
mgr_inz_rafal Posted December 7, 2018 @Dark Pulse, judging by your answer it seems that I didn't make my intention clear :) That would definitely not suck in my case. For the tool I currently develop I simply need GZDoom to keep running while it stays in the background. It seems there is no easy solution for this I'll try to modify GZDoom myself. I'll post the solution here if I find one :) 0 Share this post Link to post
Dark Pulse Posted December 7, 2018 Well, if you don't mind my asking, what could you possibly need that would mandate it running, unpauseable, in the background? Short of an always-online game mode, or some sort of extreme challenge mod, I don't see what really would require it. 0 Share this post Link to post
mgr_inz_rafal Posted December 7, 2018 (edited) Sure I don't mind. Please see the video below. I am creating a tool that runs in separate process and controls the DoomGuy. The tool is intended to run on other PC and control the game via network, but for debug purposes I run it on the same PC as Doom game, but in separate window. I'd like the game to remain active and react to commands even if I have other windows focused. To achieve that I added the "-active_in_background" parameter to the GZDoom.exe and modified the following code: case WM_ACTIVATEAPP: if(!active_in_background) { AppActive = wParam == TRUE; if (wParam) { SetPriorityClass (GetCurrentProcess (), INGAME_PRIORITY_CLASS); } else if (!noidle && !netgame) { SetPriorityClass (GetCurrentProcess (), IDLE_PRIORITY_CLASS); } S_SetSoundPaused ((!!i_soundinbackground) || wParam); } break; And here's the video: 1 Share this post Link to post
boris Posted December 7, 2018 Apparently there's a cvar vid_activeinbackground for that. 0 Share this post Link to post
Dark Pulse Posted December 7, 2018 Huh. So you're trying for some sort of "Twitch plays Doom" type stuff, huh? Interesting. *Strokes beard* 0 Share this post Link to post
mgr_inz_rafal Posted December 9, 2018 @boris it's a little bit too late, but thanks anyway. It's good to know. On the other hand, if I use the mentioned "cvar" the game gets "PAUSED" when the focus leaves the window. So it's kinda active, but not really active :) 0 Share this post Link to post
boris Posted December 9, 2018 10 minutes ago, mgr_inz_rafal said: On the other hand, if I use the mentioned "cvar" the game gets "PAUSED" when the focus leaves the window. So it's kinda active, but not really active :) Indeed, not what you'd expect at all. I played around a bit, and apparently vid_activeinbackground is for updating the windows, and not for the game logic (what actually makes sense in regards to the cvar name). If you set i_soundinbackground to true, then the game logic will keep running. But if you have i_soundinbackground true and vid_activeinbackground false you won't see what's going on, because the screen doesn't get updated. So you'll have to set both i_soundinbackground and vid_activeinbackground to true. 0 Share this post Link to post