Game Development Community

Alt tab issues and Game System Requirement

by Michael S · in Torque Game Builder · 05/14/2008 (7:25 am) · 9 replies

Hi

Is there any way to fixed Alt tab crash vista issues?
My game is made by TGB 1.3

What is the minimum system requirement of the game made by TGB 1.3

I've found the information about the game mad by TGB 's system requirement . but i still
lack information about

- What is the system requirement of OS ?
I've only seen the minimum system requirement is windows 98 . Does it work on other OS like
Windows Nt / Me / 2000 / Vista ?
- Minimum sound card requirement
- Minimum DirectX version

Can you give me some information about this ?

Thanks in advance

#1
05/14/2008 (12:54 pm)
The question is:

does going fullscreen crash Vista, or does just that key combo crash Vista?

You may want to try out the latest 173 beta for TGB.
#2
05/14/2008 (7:56 pm)
Thanks For replying Kevin
I've got some trouble with my distributor if i can't fix this.

The trouble is when my game in fullscreen mode.
If i press alt + Tab or Ctrl Alt Del
When i try going back to the game
-- Crash Tgb stop working --

But these thing doesn't happen on windowed mode .

I wonder how to fixed it
#3
05/14/2008 (9:26 pm)
I cant remember clearly right now, but the game im makin, its being developed on WinXP SP2... sometimes i go to a friend's who happens to have Vista Ultimate in his rigg, just to try the game out, and he LOVES to go into fullscreen mode all the time (i love windowed)... and as far as i remember, the game never crashes... so, my recomendation right now? use TGB 1.7.2 (if you havent modified the engine code, that is).
#4
05/15/2008 (5:36 am)
Ok I'll tried it . Thank you very much
#5
05/15/2008 (11:24 pm)
I've Tried using 1.7.2 and created some simple program
that show some image on fullscreen mode .
I've built the exe .

and tried it on the vista. and it still have the same problem .

This bug can make game developer have difficulty to submit their game on the game portal
because the game must be run on vista . I think it should be fixed quickly

Is there any other solution?
#6
05/15/2008 (11:42 pm)
Found this garagegames.com/mg/forums/result.thread.php?qt=69089
But I still don't understand the detail about it .
Can anybody help ?
#7
05/16/2008 (9:12 am)
This topic has more information. It requires TGE and Pro access, though I could paste Alex's and Amanda Fitch's team's solutions here...it would still require Pro access to change the C++ source code.

http://www.garagegames.com/mg/forums/result.thread.php?qt=74471

From Amanda Fitch's team:
case WM_ACTIVATEAPP:

         if ((bool) wParam)

         {

            Video::reactivate();

            ShowCursor(false);

            if ( Video::isFullScreen() )

               hideTheTaskbar();

 

            // HACK:  Windows 98 (after switching from fullscreen to windowed mode)

            SetForegroundWindow( winState.appWindow );

 

            // If our keyboard state is dirty, clear it

            if( sgKeyboardStateDirty == true )

            {

               sgKeyboardStateDirty = false;

               InitInput();

            }

 

            // Your code may not need this... it was simply a way to inform the script that we were restarting audio!

            Con::executef( 2, "playBGM", 0 );

         }

         else

         {

            // Window lost focus so set a dirty flag on the keyboard state

            if ( lParam == 0 )

               sgKeyboardStateDirty = true;

 

            Video::deactivate();

            restoreTheTaskbar();

 

            alxStopAll();

 

         }

         break;

From Alex Stone:
Yeah, so I totally fixed this. The problem turned out to be a fundamental flaw in the way torque processes WM_ACTIVATEAPP messages. Torque destroys and recreates the window when processing this message, while still in the message loop, which could easily cause the Win32 API to freak out. The solution is to move the actual work of reactivating the game into the next trip through Platform::process, outside the messaging loop.

Part 1: Setting up some extra Video tracking state

In platformVideo.h, after


   static bool smCritical;



insert


   static bool smActive;
   static bool smActivating;
   static bool smReactivating;
   static bool smInactive;



after


   static void setVideo(const char * gapi, const char * vendor, const char * renderer, const char * platform, const char * os, const char * arch);



insert


   static bool isActive() { return smActive; }
   static bool isActivating() { return smActivating; }
   static bool isReactivating() { return smReactivating; }
   static bool isInactive() { return smInactive; }



In platformVideo.cc, after


bool					Video::smCritical = false;
bool					Video::smNeedResurrect = false;



insert


bool                    Video::smActive = false;
bool                    Video::smActivating = false;
bool                    Video::smReactivating = false;
bool                    Video::smInactive = false;



In Video::setDevice, after


      Con::printf( "Activating the %s display device...", renderName );
      smCurrentDevice = smDeviceList[deviceIndex];

      smCritical = true;



insert


	  smActivating = true;



and after


      bool result = smCurrentDevice->activate( width, height, bpp, fullScreen );



insert


	  smActivating = false;
	  smActive = true;
	  smInactive = false;



In Video::deactivate, after


      Platform::minimizeWindow();
      smCritical = false;
   }



insert


   smInactive = true;
   smActive = false;



in Video::reactivate, after


	   Resolution res = DisplayDevice::getResolution();

      smCritical = true;



insert


	  smReactivating = true;



and after


      smCurrentDevice->activate(res.w,res.h,res.bpp,DisplayDevice::isFullScreen());



insert


	  smReactivating = false;
	  smInactive = false;
	  smActive = true;



Ok, now for Part Deux, rearranging the reactivation code in winWindow.cc:

After:


static bool gWindowCreated = false;

static bool windowNotActive = false;



Insert:


static bool gDoReactivate = false;



In Platform::process, after:


void Platform::process()
{



Insert:


   if(gDoReactivate)
   {
            Video::reactivate();
            ShowCursor(false);
            if ( Video::isFullScreen() )
               hideTheTaskbar();

            // HACK:  Windows 98 (after switching from fullscreen to windowed mode)
            SetForegroundWindow( winState.appWindow );

            // If our keyboard state is dirty, clear it
            if( sgKeyboardStateDirty == true )
            {
               sgKeyboardStateDirty = false;
               InitInput();
            }

			gDoReactivate = false;
   }



In WindowProc, after


      case WM_ACTIVATEAPP:
         if ((bool) wParam)
         {



REPLACE THE CODE UP TO THE CLOSURE OF THE IF STATEMENT WITH:


			 if(Video::isInactive() && !Video::isReactivating())
			 {
				gDoReactivate = true;
			 }



So it should look like...


      case WM_ACTIVATEAPP:
         if ((bool) wParam)
         {
			 //>NEW CODE
			 if(Video::isInactive() && !Video::isReactivating())
			 {
				gDoReactivate = true;
			 }
			 //<NEW CODE
         }



NOTE: THIS IS A TENTATIVE FIX, it has not been tested on any other platforms except my own machine, but it no longer crashes when you alt-tab back into the game while it is in fullscreen. I'm actually a little suprised that GG didn't catch this in their QA process, as it seems to be a hardware independant bug in the windows platform code.
#8
05/17/2008 (5:20 pm)
Ok I'll try it , guess i must purchase the pro version first . Thanks
#9
05/17/2008 (5:23 pm)
Ok I'll try it , guess i must purchase the pro version first . Thanks