How do I find the cause of a game that freezes?

BlitzMax Forums/BlitzMax Programming/How do I find the cause of a game that freezes?

Sokurah(Posted 2011) [#1]
So, I'm working on a game - it's a 2D shoot'em'up affair, and sometimes when I run the game in fullscreen it'll freeze for a second and then continue. It happens often enough that it's annoying.

The problem doesn't seem to be there when it runs windowed, which is very odd, and I can't see any relation to what's going on on the screen.

I doubt it's my antivirus or my firewall as they are both disabled when I code.

Perhaps I need to try it on some more computers - perhaps it's this one that has a problem, but then on the other hand - I've not seen it in any other games.

Is the any recommended ways of finding out exactly what's going on and what might be causing a problem, at a specific time?


beanage(Posted 2011) [#2]
This can be caused by the multithreaded garbage collector (at least the same phenomen), when you have TLists with 5K+ Objects.. if you have collections of that scale, try to use arrays instead.

Last edited 2011


Czar Flavius(Posted 2011) [#3]
Source?


BlitzSupport(Posted 2011) [#4]
Does it happen just at the start, or during gameplay?

I'd at least open the Task Manager, set it to the Performance tab, and leave it open while running for a good while, so you can go back and see if there were any obvious CPU spikes that fit in with the freezing.

I'd definitely try it on another PC, if you can, as I'd be pretty surprised if it's NOT something running on your main PC causing it.

If it does happen on another PC, I think we'd need to see some code, or at least hear if it happens with other games, or other Blitz programs that you can show the code for.


Sokurah(Posted 2011) [#5]
Does it happen just at the start, or during gameplay?


Interrestingly enough it often happens at the...relative start of a level (5-10 seconds in - even if it's at the 10th level) but it also happens once in a while during gameplay, so I can't trace it to a certain type of event.

But since last time I've had a chance to try the game on 3 other computers as well, and it only happens on that one computer (which unfortunately is my primary development computer)...but it seems to be okay on other computers. Perhaps it IS a local thing. :-/

I'll try leaving the Task Manager open and see what happens.
...otherwise I'll just have to live with it - for now anyway. ;-)

Last edited 2011


Jesse(Posted 2011) [#6]
does it happen for long time or is it just a jitter/hiccup?


Sokurah(Posted 2011) [#7]
It lasts for about 1-2 seconds.


ima747(Posted 2011) [#8]
1-2seconds should be far longer than even a huge cycle of the garbage collector pass. And coupled with it only happening on one computer it's almost certainly something in the background.

Is it possible to try in safe made? Might help limit things down quickly. Have you updated your graphics drivers recently, or made any hardware changes (ready boost drive, changed components, etc.)


SLotman(Posted 2011) [#9]
Maybe too much on screen, or too much graphics for your VRAM? The slowdown could be the transfer of graphics from RAM->VRAM...

Try running the game on lower resolutions, or reduce image sizes to see if VRAM is the problem.

Last edited 2011