Milliseconds / 1000 isn't seconds?

FOR THOSE WANTING TO LEARN FROM MY MISTAKES ––

1) If you have a draw event on an object (even if it's empty), GM2 is going to use that. An empty draw event means the object isn't going to be drawn. (Which is what led me down this rabbit hole in the first place, will explain below)

2) The big one: if you're debugging anything relying on delta_time, know that when you run line by line in debug mode, delta_time is still counting.

That means –– in my case –– when you're trying to step through line-by-line to debug a delta_time check, it is going to throw you WILDLY large numbers because as far as the game's concerned, it's been 20 secs to five mins since the last event.

Thank you to everybody who chimed in, I really appreciate it. This was a perfect storm of nonsense.


For those who want to know, here was my dilemma:

I have a pickup in my game that I wanted to destroy itself after a given number of seconds, so I was using delta_time/1000000 to keep track of its age in seconds.

My game involves some very large impacts that – when not properly tweaked – can send objects flying to the other side of the map.

In this case, I started debugging why I wasn't seeing it (thinking it was an issue of it flying around), noticed in the debugger it WAS instantiating but then vanishing, so I started debugging the "death" script.

In doing that – I managed to fix the issue (without realizing it) – but I'd put some debug code in the object's draw event, so I commented it out

– and the object still wasn't appearing.

So I go back into the code and am CONVINCED it's killing itself too early (which is why I'm not seeing it), and in debug mode I AM seeing wildly huge delta_time numbers which WOULD make the object destroy itself within a few steps, so everything seemed ot be pointing to a delta_time glitch.

But no. Truth was: I managed to fix the massive collisions (the original source of the problem), and the premature self-destruct (the second problem), and in doing so accidentally rendered my object invisible, making it seem like the delta_time was what was killing my object all along.

What I'm saying is: I debuggered myself.

Thank you all for your help. :)

/r/gamemaker Thread