Why do games screw up when you ALT-TAB???

lektrix

Golden Member
Aug 9, 2003
1,174
0
76
Whenever I ALT-TAB, my game either freezes, screen turns black, or I get artifacts. Why?
 

Jeff7

Lifer
Jan 4, 2001
41,596
19
81
Depends on the game. Giants: Citizen Kabuto always ran slowly if I Alt+Tabbed. Others crashed. Homeworld2 - seems just fine. It might be the way it was programmed, like "Alt-Tab Resistance" or something like that.
 

lektrix

Golden Member
Aug 9, 2003
1,174
0
76
It didnt happen to me as much before, but it seems like with newer games/newer computers these crashes occur more frequently..
 

imported_Phil

Diamond Member
Feb 10, 2001
9,837
0
0
Originally posted by: xtknight
The game loses its 3D device object when that happens.

Not true. I can Alt-Tab out of HL2, C&C Generals, BF1942, or a whole host of other games and it's absolutely fine.
 

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
14
81
www.markbetz.net
Originally posted by: Phil
Originally posted by: xtknight
The game loses its 3D device object when that happens.

Not true. I can Alt-Tab out of HL2, C&C Generals, BF1942, or a whole host of other games and it's absolutely fine.

That doesn't make what he said wrong. The game does indeed lose it's render device when alt-tabbed. The game has to be able to properly handle the sequence of events necessary to rebuild that device when it reacquires the application context. Some games do this correctly, others don't even try. Also, some developers (rightly) consider alt-tabbing to be a source of potential exploits in online games, so they don't bother doing to work to enable the app to be alt-tabbed into the background.
 

Topweasel

Diamond Member
Oct 19, 2000
5,437
1,659
136
The problem is partially lack of DC processor or one without any spare cycles. Basically everything needs to be regenerated in a hurry while still computing what is currently going on. Thats why I usually will see the last few seconds of a game in FF. I think A DC or dual CPU machine with enough Ram it would be perfect, if not that then an HT CPU with a little longer delay. My 4400+ takes two to 3 seconds tabing into CS:S and my 2500+ AXP takes minutes to alt-tab back into a game which usually means I miss a round and get booted for being AFK.
 

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
14
81
www.markbetz.net
I have a dual core, with 2 gigs, and if a program is properly written it does alt-tab very fast. But some games just don't support the necessary rebuild of the device context, regardless of how good a system you have.
 

pcman83

Senior member
Oct 20, 2003
397
0
0
If the game has an option to run it in windowed mode that will help your issue with alt-tabbing.
 

Noema

Platinum Member
Feb 15, 2005
2,974
0
0
World of Warcraft seems particularly efficient at this. I can alt-tab to the desktop and back almost without losing a beat.

Probably the programers realized that people would keep alt-tabbing back and forth during flights or while waiting outside instances.

This is not possible in most other games though.

 

imported_rod

Golden Member
Apr 13, 2005
1,788
0
0
Some games just can't do it. Others are fine, and of course, many are inbetween. It also depends on your hardware - nVidia cards seem to be ok at resuming an alt-tabbed games, while ATI cards often won't do it at all.

RoD
 

mikeford

Diamond Member
Jan 27, 2001
5,671
160
106
Alt tab generally just gets me killed, but game does just fine. In Diablo II if you hold down alt it shows all the loot that is on the ground, and tab turns on/off the mini map, so couple times I have been looking at the loot, and realize, hey I forgot to turn on the mini map, and poof away to the desktop I go.

Other games I alt tab frequently to hop to the desktop and look up some info on a website or use some external helper program.
 

lektrix

Golden Member
Aug 9, 2003
1,174
0
76
I try to alt tab with Oblivion to look up stuff and when I go back the game ends up being frozen 50% of the time..in CSS if I alt tab for too long my screen turns to graphic corruption.. same for EA sports games......this did NOT happen with my old 9800 pro!
 

JE78

Golden Member
Jun 6, 2004
1,418
0
71
I think it depends on the game as well. I can ALT-TAB out of a few game without any problems but I have 2 games that I can't or it will goto a black screen.
 

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
14
81
www.markbetz.net
Oblivion specifically states, I think in the readme, that alt-tabbing may not work and is not recommended.
 

w00t

Diamond Member
Nov 5, 2004
5,545
0
0
I can alt+tab a good amount of games most of them the only one I can think of that doesn't alt tab well is bf2 sometimes it works other times it doesn't.
 

KeithTalent

Elite Member | Administrator | No Lifer
Administrator
Nov 30, 2005
50,231
118
116
For some reason (well I guess for the reason noted above) when I Alt-Tab out of some games they screw up as well. However, I now usually just press the Windows key which takes me to the desktop and does not cause problems with the games. Not sure why this works for me, but it does.
 

Mark R

Diamond Member
Oct 9, 1999
8,513
16
81
It basically depends on the game and the programming.

When you alt-tab or ctrl-alt-del out of a game, Windows immediately deactivates Direct3D access to the game - specifically, it destroys the Direct3D object passed to the game. Any attempt to render by the game program will result in an error.

Some games will crash as soon as their access to D3D is denied.

However, with more programming effort it is possible for a program to spot when D3D is no longer available and attempt to reset the D3D driver. However, even this is difficult because it means reloading all the meshes and textures. Some game engines are successfully able to reload everything and carry on - others may struggle and may forget to load every single texture or mesh, leading to strange artifacts or a black screen.