GMS 2 Draw End Event disappearing

Discussion in 'Programming' started by Anixias, Apr 16, 2019.

  1. Anixias

    Anixias Member

    Joined:
    Jun 27, 2016
    Posts:
    181
    Hi, I'm making a tower defense game. At some point after a seemingly random amount of time, the Draw End event of every object becomes invisible. It still executes, as I can see show_debug_message stuff just fine if they are in a Draw End event, but it becomes 100% invisible. Nothing seems to be wrong with my code, and I have tried cleaning the project and restarting GMS2. At one point, the issue vanished but it has recently reappeared. The issue is present in YYC, VM, run from GMS2, run from a package/exe, and happens on both mine and my cousin's computers.

    What could cause this sort of behavior in GML code? All of the objects are set to visible and I don't use an exit anywhere in any of the Draw End events.

    Every other Draw event (Draw, Draw GUI, Draw Begin, Draw GUI Begin, and Draw GUI End) renders correctly.
     
  2. obscene

    obscene Member

    Joined:
    Jun 21, 2016
    Posts:
    2,343
    My guess: you have a draw_set_alpha() call not being reset to 1 in some object in your draw event. If it works for a while and then stops, you probably have some object or effect being introduced at that same time?
     
  3. Taddio

    Taddio Member

    Joined:
    Nov 16, 2018
    Posts:
    421
    Also, maybe your surfaces go David Copperfield on you for no apparent reasons, make sure you have code that will recreate it if it doesn't exists anymore (if this is applicable in your case).
    This is probably a problem in the code itself since it happens pretty much anywhere you try it and on different compilers.
     
  4. Anixias

    Anixias Member

    Joined:
    Jun 27, 2016
    Posts:
    181
    I am not using surfaces in this project, and I make sure to set alpha to 1 before the first draw call in all Draw End events.
     
  5. Taddio

    Taddio Member

    Joined:
    Nov 16, 2018
    Posts:
    421
    Few things you could check:
    - GPU stats in the graphic tab of the debugger when it is disappeared
    - Make sure no instance_deactivate() call is being made.
    -Check your layers if you're messing with them in your code
    -Check for weird variables after the glitch in the all instances tab while in debug mode (since I understand it doesn't crash, right?)
     
  6. samspade

    samspade Member

    Joined:
    Feb 26, 2017
    Posts:
    1,692
    In addition to all of these: https://forum.yoyogames.com/index.php?threads/checklist-for-missing-text-bugs.28463/

    I'd start going through and removing objects one by one until the problem stops occurring.

    Also this exact bug I think is fixed now, and on top of that shouldn't be happening to you since you're not using surfaces, but it sounds a bit like an issue I had last year: https://forum.yoyogames.com/index.p...though-no-code-has-changed.55627/#post-337815

    It might be something else for you, but you could do the same matrix checks and see if something is strange there.
     
  7. Anixias

    Anixias Member

    Joined:
    Jun 27, 2016
    Posts:
    181
    Stepping through line-by-line after the issue appears displayed some very unusual behavior. At the start of all Draw End events, it just instantly exits the script (I am not advancing with Step Over or Step Out). It acts as if line 1 of the Draw End events is exit;. Render States under the Graphics tab doesn't seem to be weird. It still prints show_debug_message calls that are in Draw End events without ever actually going over them. Debugger says color is FFFFFF and alpha is 1.
     
  8. Taddio

    Taddio Member

    Joined:
    Nov 16, 2018
    Posts:
    421
    Wow, looks frustatingly weird!
    Was it happening before the last update?
    At this point, I would
    1) back up my stuff
    2) try to roll back versions
    3) file a bug if changing version fixes it.
    4) do a fresh install if it doesn't.

    We'll then be able to rule the GM bug out, or put the glitch on him with more certainty
     
  9. Anixias

    Anixias Member

    Joined:
    Jun 27, 2016
    Posts:
    181
    I have no idea if it happened before the last update because I made this project after the update. It never happened with previous projects. I'll see about using different versions or a fresh install and update this reply.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice