• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Question - Code Draw code that worked in GMS:1 now causes sprites to flicker

M

Master_Esq

Guest
I'm working on an isometric game, and recently imported it to GMS:2. Now there is an issue where my isometric sprites cause each other to flicker when they are on the same y-axis. So, for example, a car moving past the face of a building causes each window sprite to blink as it passes it. Here is the Draw code of the isometric parent object that I use:

Code:
//Draw in Orthographic or Isometric view

if ( global.IsoView == false )
{
    draw_self();
}
else
{
    IsoX = GetIsoX(x,y);
    IsoY = GetIsoY(x,y);
    depth = -y;

    //Draw shadow
    if(HasShadow){
        draw_sprite_ext(ShadowSprite,0,IsoX,IsoY,IsoXscale,IsoYscale,0,-1,0.5);
    }   

    //then draw this sprite
    draw_sprite_ext(IsoSprite,image_index,IsoX,IsoY-Z,IsoXscale,IsoYscale,0,-1,1);
    
}
Can you see anything that may cause this? It only happens in GMS:2, it runs just fine in 1...
 

rIKmAN

Member
Are you still using the compatibility scripts that are created when you import a GMS1 project into GMS2?
I'm not sure how they handle depth but it sounds like that might be the issue.

As a test, try manually setting the depth of the objects so they aren't z-fighting and see if that stops the flickering.
 
M

Mishrathium

Guest
@cyberkirin - After hours and hours of thinking I had failed to import properly - you just saved my sanity. Thank you so much.

Dear YOYO - this is a massive ugh that should be noted somewhere when importing...
 

Juju

Member
You should never have set depth in the Draw event to begin with. I'm frankly surprised that worked at all in GMS1!
 
Top