Flickering GUI despite no presence in rep_exec--graphics slowdown?

Started by JoelCBarker, Wed 23/01/2013 20:39:36

Previous topic - Next topic

JoelCBarker

I'm stumped again! I found some other posts that helped me narrow the field, but I can't figure this out...

The game is 320x240 32-bit, newest AGS, my computer is Vista

I'm trying to use a 320x240 GUI (the size of the room) with 9 buttons and no other features. The buttons are small sprites, the majority of the GUI is transparent. I'm doing this because I already have around twelve animating objects in this room and it seemed like a good idea to throw nine into one GUI (which I may want to use elsewhere anyway). My GUI flickers!

The only code remotely related to the GUI is a simple "gMyGUI.Visible=true;" in the Room_Load department. I had lots of code related to it earlier, but after reading posts related to what I was trying to do with no luck, I decided to remove all of the code that uses the GUI just to see if simply displaying it would work, and I can't get it to behave. I was very thorough in making sure no code related to my GUI still exists, I just want to display it properly at this point.

It displays for about four seconds and then shuts off, then about half a second later it displays again (over and over).

When player interface is disabled, GUI's should "be hidden"

is that what's happening? No code disables the GUI, so I'm wondering if slow-down from lots of alpha'd .png animations is disabling player interface? When I switch to "...should Display Normally" it doesn't flicker, but I'm not able to manipulate it with code, it still seems to hang every four seconds or so.

Thanks! 

*Not using any blocking scripts etc*

MurrayL

Are you doing anything at all in repeatedly_execute (either in the room script or the global script) or repeatedly_execute_always?

When GUIs are set to hide while interface is disabled, they disappear for a huge number of things, including Say and Wait commands. The cyclic nature of the 'flickering' sounds an awful lot like something is causing the GUI to hide itself, rather than a graphics error. The fact that changing it to 'display normally' fixes the disappearing issue only makes me more sure that its a problem with something blocking.

There must be something somewhere which is running continuously, and occasionally executing a blocking command.

JoelCBarker

I'm running a bunch of int checks and animation commands (eNoBlock) in the room's rep_exec for many objects in the room (but I can't see any reasons why blocking would happen), but now I'm wondering if it is a Z-order issue from an animating room object with a Z-order of 1?  Nothing in global rep_exec or rep_exec_always so far. Here's my room script:

Starshift is a function for moving a chain of StarObj objects across the top of the screen which relies on the room's rep_exec. All of the animations use alpha if that adds up? gSplash is my problem GUI.

Code: AGS


// room script file

int Obj1View=2;
int Obj2View=3;
int Obj3View=4;
int Obj4View=5;
int Obj5View=6;
int SpiritOn=0;
int TitleOn=0;
int ArcPicOn=0;

function StarShift(Object* StarObj){
  if(StarObj.GetProperty("StarNumber")==1){
    if(Obj1View>=6){
      Obj1View=(Obj1View+5)-9;
    }
    else{
      Obj1View+=5;
    }
    StarObj.SetView(Obj1View, 2);
    StarObj.Animate(2, 5, eRepeat, eNoBlock);
  }
  if(StarObj.GetProperty("StarNumber")==2){
    if(Obj2View>=6){
      Obj2View=(Obj2View+5)-9;
    }
    else{
      Obj2View+=5;
    }
    StarObj.SetView(Obj2View, 2);
    StarObj.Animate(2, 5, eRepeat, eNoBlock);
  }
  if(StarObj.GetProperty("StarNumber")==3){
    if(Obj3View>=6){
      Obj3View=(Obj3View+5)-9;
    }
    else{
      Obj3View+=5;
    }
    StarObj.SetView(Obj3View, 2);
    StarObj.Animate(2, 5, eRepeat, eNoBlock);
  }
  if(StarObj.GetProperty("StarNumber")==4){
    if(Obj4View>=6){
      Obj4View=(Obj4View+5)-9;
    }
    else{
      Obj4View+=5;
    }
    StarObj.SetView(Obj4View, 2);
    StarObj.Animate(2, 5, eRepeat, eNoBlock);
  }
  if(StarObj.GetProperty("StarNumber")==5){
    if(Obj5View>=6){
      Obj5View=(Obj5View+5)-9;
    }
    else{
      Obj5View+=5;
    }
    StarObj.SetView(Obj5View, 2);
    StarObj.Animate(2, 5, eRepeat, eNoBlock);
  }
  StarObj.X=-120;
  StarObj.Move(440, 83, 1, eNoBlock, eAnywhere);
}
    

function room_Load()
{
  gSplash.Visible=true;
  objSky.SetView(1, 1);
  objSky.Animate(1, 8, eRepeat, eNoBlock);
  objMts.SetView(1, 8);
  objMts.Animate(8, 3, eRepeat, eNoBlock);
  obj1.SetView(2, 2);
  obj1.Animate(2, 5, eRepeat, eNoBlock);
  obj2.SetView(3, 2);
  obj2.Animate(2, 5, eRepeat, eNoBlock);
  obj3.SetView(4, 2);
  obj3.Animate(2, 5, eRepeat, eNoBlock);
  obj4.SetView(5, 2);
  obj4.Animate(2, 5, eRepeat, eNoBlock);
  obj5.SetView(6, 2);
  obj5.Animate(2, 5, eRepeat, eNoBlock);
  obj1.Move(440, 83, 1, eNoBlock, eAnywhere);
  obj2.Move(440, 83, 1, eNoBlock, eAnywhere);
  obj3.Move(440, 83, 1, eNoBlock, eAnywhere);
  obj4.Move(440, 83, 1, eNoBlock, eAnywhere);
  obj5.Move(440, 83, 1, eNoBlock, eAnywhere);
  objMan.SetView(1, 2);
  objYeti.SetView(1, 4);
  objYeti.Animate(4, 3, eRepeat, eNoBlock);
  objTot.SetView(1, 6);
  objTot.Animate(6, 1, eRepeat, eNoBlock);
  SetTimer(1, 30);
  objSpirit.SetView(1, 0);
  objSpirit.Animate(0, 3, eOnce, eNoBlock);
  objTitle.SetView(1, 12);
  objTitle.Animate(12, 3, eOnce, eNoBlock);
}

function room_RepExec()
{
  if(TitleOn==0){
    if(IsTimerExpired(2)==1){
      TitleOn=1;
    }
  }
  if(TitleOn==1){
    if(objTitle.Animating==0){
      objTitle.Animate(11, 1, eOnce, eNoBlock);
      SetTimer(2, 160);
      TitleOn=0;
    }
  }
  if(SpiritOn==0){
    if(IsTimerExpired(1)==1){
      if(objTitle.Animating==0){
        objTitle.Animate(10, 3, eOnce, eNoBlock);
        TitleOn=1;
      }
      if(objSpirit.Animating==0){
        objSpirit.Animate(9, 3, eRepeat, eNoBlock);
        SpiritOn=1;
      }
    }
  }
  if(obj1.X==440){
    StarShift(obj1);
  }
  if(obj2.X==440){
    StarShift(obj2);
  }
  if(obj3.X==440){
    StarShift(obj3);
  }
  if(obj4.X==440){
    StarShift(obj4);
  }
  if(obj5.X==440){
    StarShift(obj5);
  }
  if(objMan.Animating==0){
    if(objMan.X==23){
      objMan.Animate(3, 5, eOnce, eNoBlock);
      objMan.Move(38, 135, -7, eNoBlock, eAnywhere);
    }
    if(objMan.X==38){
      objMan.Animate(2, 5, eOnce, eNoBlock);
      objMan.Move(23, 129, -7, eNoBlock, eAnywhere);
    }
  }
}



[edit] I changed my GUI to a smaller size and it works like a charm now (I can even add a bunch more animations with no problem) but for some reason, any time I set the GUI to dimensions of 320x240 it flickers! I'm just going to chalk this up to some weird thing dependent on my hardware or something? [/edit]

Khris

What happens if you set it to 320x239? Does the flickering only occur if it is 320x240?

JoelCBarker

Okay... I'm so sorry guys. I just backed up all of my things and reformatted. I'm pretty dense, but AGS uses DirectX correct? I was having a bunch of different visual issues with a 3D modelling program that also uses DirectX and I just decided to start fresh. Haven't set up AGS yet but I'll follow up if it happens again. I'm 90% sure it had more to do with a different demon in my computer

MurrayL

By default, I think it probably does. There's also a DirectDraw graphics driver that you can switch to in the game setup.

SMF spam blocked by CleanTalk