What can I do about task switching with alt-tab?

Blitz3D Forums/Blitz3D Programming/What can I do about task switching with alt-tab?

Rottbott(Posted 2003) [#1]
Everytime somebody running my (multiplayer) game in fullscreen uses Alt-tab to minimise the game and do something else, they get booted from the game. I think this is because the app pauses when they switch task, which means no network updates get sent to the server, so it assumes their connection has been dropped and promptly forgets about them.

What can I do about this problem? Surely Blitz3D must have a way to keep executing when minimised...


Rob(Posted 2003) [#2]
With B+ this isn't a problem, but it is with Blitz3D. Hmmm...


Rottbott(Posted 2003) [#3]
Yes, I know. But as it's a 3D game, having Blitz+ doesn't help.


Rob(Posted 2003) [#4]
B+ helps if you do the networking on it and read the results into B3D when it's active. Since this is hugely impractical I suggest you make a feature request in General Discussion AFAIK it's impossible otherwise.


Rottbott(Posted 2003) [#5]
OK, feature request it is.


IPete2(Posted 2003) [#6]
Rott,

I have a suggestion.

Have a flag set which allows users to pause their game, before they switch using Alt-Tab. It could be attached to an unusual key so you don't normally use it by mistake.

This flag would be set in the programme and information would not be polled during their absence, because this is set. Your game would not send different information, or just keep sending the same information for the paused player continually, as though he is stuck in time.

Everybody would just see a frozen 'you left the game for a moment image - where you were last - before you rejoined as if time had stood still for you. The flag then becomes unset and voila the game catches up, then allows you to play as normal.

Hope it works.

IPete2.


soja(Posted 2003) [#7]
You don't have to have the user "pause" it -- you can detect it automatically. GetForegroundWindow (user32.dll) will tell you if your Blitz window is active or not.


Perturbatio(Posted 2003) [#8]
Does it happen if you run the game in windowed mode,change to another app, but not minimise?


ckob(Posted 2003) [#9]
I like this "flaw","bug" whatever you wanna call it because it really slows down on players hacking your game especially if it's mutliplayer


Rottbott(Posted 2003) [#10]
It never happens in Windowed mode.

Ckob, true in theory, but since I allow people to play in Windowed mode, they can easily use other apps anyway. It's just a nuisaince for people playing in fullscreen.

Obviously if this behaviour changed it would have to be optional, i.e. just add the AutoSuspend command to Blitz3D.

IPete2, soja,

Sounds like it might work! I'd have to fiddle with the internals of BlitzPlay a fair bit though - maybe I should talk to Surreal about it.


SabataRH(Posted 2003) [#11]
Actually, a disable alt-tab type of command would work better then Autosuspend..

Ever play Everquest or Anarchyonline? They were faced with these same problems and disabled Alt-Tab all together.

This won't happen in window mode because the app is still considered 'active' and recieves the needed cpu slices.


Rottbott(Posted 2003) [#12]
Yeah, Sab, that would do the trick as well. Although I'm not sure it's right to interfere with the user that way, it's miles better than getting booted when you alt-tab!


FlameDuck(Posted 2003) [#13]
Actually, a disable alt-tab type of command would work better then Autosuspend..
No. That would be a stupid idea.
Ever play Everquest or Anarchyonline? They were faced with these same problems and disabled Alt-Tab all together.
Nope, but I've played other games who where also written by programmers that where a little too clever for their own good. What happens when your masterfully designed game hangs? Oh goody, a hardware reset, that'll do wonders for the hard drive. I hope you wheren't saving your game or something.