Gamemaker game freezing computer - freeze

My friend is currently making a game in gamemaker, but whenever I test it out for him my computer seems to just completely lock up. My PC that I am testing on is no way underpowered, it has a 2500k, Radeon 6950 and 8GB RAM. My RAM, GPU and CPU usage is barely touched during the freeze. If I am playing music at the time of the freeze the speakers just buzz. Whenever is occurs a full system reboot is always required, nothing at all responds. The image of the game stays on the screen, mouse, keyboard and restart button don't respond. This question may be better suited for the Gamemaker forums, but it could be an issue with my computer. I am unsure. I can play MW2 and Crysis for hours without it crashing, so it is either a software problem or something weird. All of my temps are normal. Others have suggested checking while loops, but wouldn't an infinite loop cause the CPU usage to rise?

In any of your loops that have a potential of running infinitely, put io_handle(); (I think thats the command) This command somehow keeps windows from thinking a program has frozen. If that isn't the case... then try to play the music through an extension like fMod or another one. Furthermore, try it on another computer is it just your computer? Your computer doesn't sound underpowered at all... but what about your operating system? If you're using xp it may not support the Directx that GM requires. I believe that its very easy to make gm games very directx intensive, so check that out. Good luck! I love Game Maker!

It's most likely an infinite loop in your code. Try stripping away your code, compile, and test if your computer freezes again. Then build back up to where you started from.

This kind of issue is probably due to something internally in game maker, OR it could be an issue with a listener or script you may have bound to a sprite or object. Begin removing things, one by one, until you find the culprit.

Try to strip out pieces of code part by part and isolate the function / code that is causing the freeze. Then come back here and tell us the status.

I've kind of seen this before on another Gamemaker game. Do you have any infinite loops or shaders in your game? The last game that had this problem was caused by a bad shader.

Related

Kinect Freezing After a Minute and a Half

I've been messing around with programming the old Kinect for a while, and something I've noticed is that whenever I start a program that uses the Kinect sensor, the Kinect will stop sending inputs after 1:30 minutes, no matter what program it is. For example, my game that I made will still have enemies moving around, but the player's rendered skeleton from the Kinect just freezes. I can't find anything about this anywhere online, so is it just mine? Is there a way to fix this?
This is a bug somewhere between the Microsoft SDK and using a Kinect for XBOX on Windows (didn't try the Kinect for Windows).
The Kinect stream freezes after 1 minute 28 seconds. In the Unity editor, you'll also notice once you reach this freeze, you need to quit and restart Unity to be able to play again. If not, you'll get messages like "Device not genuine", etc.
The only way to solve it that I found is to re-initialize whatever Kinect Manager you are using. For instance, Destroy()ing the gameObject holding the manager and re-Instantiate()ting it.
This will effectively halt your Kinect stream (and any gesture/joint reading) for about 4 seconds and then it will work again, so this is something the user will definitely notice.
Now, this may not work for most games, but if you're working on a casual game and you can keep it under 1:28 or you're able to show the user some sort of screen while you restart the Kinect manager every 1:20, you'll be safe.
If you never exceed the 1:28, you'll be able to stop and play in the Unity editor as many times as you want, and keep it running as many times as you want.
Now, this may not be an actual "answer", but may work for someone.
Let me know if you need any help to make this work. I hope this helps someone.
You can test the Kinect with built in programs in this link.programs to check and see if it works smoothly. If not may be something wrong with your program.
I have the same issue. At first I thought it was something related to Unity3d. But I tested with other programas and it's still happening.
Talking to the guy who developed the plugin he said: " two users complained that Kinect tracking stops after a while"
https://www.assetstore.unity3d.com/en/#!/content/7747
Also, I sent him an email and he told me that more and more people are getting this issue.

Debugging methods for finding the location and error that's causing a game to freeze

I recently I came across an error that I cannot understand. The game I'm developing using Cocos2D just freezes at a certain random point -- it gets a SIGSTOP -- and I cannot find the reason. What tool can I use (and how do I use it) to find out where the error occurs and what's causing it?
Jeremy's suggestion to stop in the debugger is a good one.
There's a really quick way to investigate a freeze (or any performance issue), especially when it's not easy to reproduce. You have to have a terminal handy (so you'll need to be running in the iOS simulator or on Mac OS X, not on an iOS device).
When the hang occurs pop over to a terminal and run:
sample YourProgramName
(If there are spaces in your program name wrap that in quotes like sample "My Awesome Game".) The output of sample is a log showing where your program is spending time, and if your program is actually hung, it will be pretty obvious which functions are stuck.
I disagree with Aaron Golden's answer above as running on a device is extremely useful in order to have a real-case scenario of where the app freezes. The simulator has more memory and does not reproduce the hardware of the device in an accurate way (for example, the frame rate is in certain cases lower).
"Obviously", you need to connect your device (with a developer profile) on Xcode and look at the console terminal to look for traces that user #AaronGolden suggested.
If those are not enough you might want to enable a general exception breakpoint in Xcode to capture more of the stacktrace messages.
When I started learning Cocos2D my app often frooze. This is a list of common causes:
I wasn't using sprite sheets and hence the frame rate was dropping drammatically
I was using too much memory (too many high-definition sprites. Have a look at TexturePacker and use pvr.ccz or pvr.gz format; it cuts memory allocation in half)
Use instruments to profile your app for memory warnings (for example, look at allocation instruments and look for memory warnings).

Is there any feature of programming that automatically detects computational repetition?

I'm new to programming, taking MIT's 6.00. While watching the Dynamic Programming lecture a simple question occurred to me: Is there any kind of built-in feature (for computers in general) to detect repetitive tasks and compensate?
I realize that's quite vague. I was working on my grandfather's computer because he had been complaining that it was slow. Indeed, it would lag for up to 15 seconds at a time, waiting for programs to open, etc. When I upgraded the RAM, the problem was gone. So if the computer was constantly having to write page ins and page outs to disk, why couldn't it have just popped up a little message suggesting a RAM upgrade? That would save quite a bit of time.
Computers are good at performing tasks quickly but slow code can be, well, slow. Can that be automated? Is this even a legitimate question?
In the example you describe the code isn't slow because it's reading/writing to disk. It's slow because it isn't actually doing anything but instead is waiting for the OS to page in and out to disk.
Also, a RAM upgrade isn't always the solution to frequent paging (say buggy program leaking memory or something).
It's not really possible in the general sense for the OS to detect what all the possible issues are and suggest a solution. That is in fact a variation of the Halting Problem.
It's impossible in general for a computer to know whether a slowness was because it's running an operation that fundamentally takes a long time to finish, or whether it's taking more time than it should really be.
Also, even if you've identified that an operation is slow, it's even more difficult to diagnose the precise reason why it is slow. Sometimes it's because you need more RAM, other times because slow network, or slow disk, or slow CPU. This is even more harder if the checker is running inside the same machine that it is running on since it's also experiencing the slowness itself.
However there are several things that can be done under certain limited situations. Many popular OSes (e.g. Windows, Linux, Android) can detect slow response to user input, and will offer to either give more time or force close applications (Android) or draw the not responding window in grayscale (Linux), or in bluish tint (Windows), if the application fails to respond to user input within certain period of time.

mach_msg_trap, - (void) mouseDragged and timer performance

Leopard 10.5.8, XCode 3.1.1; using runModalForWindow to implement (what is intended to be) a high performance mouse tracking mechanism where I have to do real-time complex bitmap modifications.
The modal loop runs, the timer fires, the mouse tracks... but the performance is abysmal, and it gets worse and worse the longer the runloop goes on. Instead of catching mouse messages every pixel or so, I get them every 5... 10.... 20 seconds.
Instruments shows that the majority of the time during this growing response bottleneck is being spent in mach_msg_trap (and yes, I have the perspective set to the running app), so the impression I am under is that it "thinks" it doesn't have any work to do, despite the fact that I'm dragging the mouse around with the button held down like a crazy person. There are no memory leaks showing up, and in my 8-core 2.8 GHZ machine, there's almost no CPU activity going on.
Again, the app is not spending much time in my code... so it's not a performance problem of mine. I've probably configured something wrong, or failed to configure it at all, or am simply approaching the whole idea wrong -- but I sure would appreciate some insight here. As it stands now, the dispatch of mouse messages and timer messages is absolutely unacceptable. You couldn't implement a crayon drawing program for someone immersed in cold molasses with the response times I'm getting.
EDIT: Some additional info: doesn't happen on my 10.5.8 macbook pro. Just the 8--core, 6-display Mac Pro. I tried taking the display code for the croprect in drawrect out, replaced it with an NSLog()... still drags on issuing mouse updates. Also tried rebooting and running without the usual complement of apps running. And with mirrored displays. No difference.
Imagine dragging a brush across the screen; at first, is paints smoothly, then gaps appear between brush placements, then they get larger, and this goes on until you're only getting one brush placement every 10 seconds. That's how this acts. Using NSlog() and various other tracking methods, I've determined that it is at least at the highest level occurring because the mouseDragged events slow down to a trickle. The question in a nutshell is, why would that happen?
Anyone?
OK, isolated it -- the problem comes from my Wacom Tablet mouse. Plug in a regular optical mouse, and everything runs great. Same thing on my Macbook pro, using the trackpad. Works fine.
The tablet is a Wacom Intuos 4 with the stock drivers as of January 2011. I'm going over to the Wacom site and reporting this next.
What a nightmare that was. I have spent over 100 hours on this, thinking I'd hosed some subtlety in the app handling, drawing, etc. Sheesh.

BSOD while playing a sound resource

I have a VB.NET application that crashes on a client's computer with a BSOD error... KERNEL_DATA_INPAGE_ERROR.
This error occurs at a point where my program does two things:
Locks the computer
Plays a sound in BackgroundLoop mode
For locking the work station, I am just using this:
<DllImport("user32")> _
Public Shared Sub LockWorkStation()
End Sub
For playing the sound, I am doing this:
My.Computer.Audio.Play(My.Resources.ResourceManager.GetStream("somesound"), AudioPlayMode.BackgroundLoop)
Now, this sound loops until the user logs back in. My software detects the session state switch and stops playing the sound. Sometimes when I log back in, the sound card plays garbage data for a split second, instead of the rest of the audio buffer. I get the impression that this has something to do with session switching.
Could my client be having an issue where there is memory corruption occurring at the point of locking the computer?
I apologize for the vagueness of this post... I am not sure where to begin as I cannot reproduce the problem myself.
Edit: If the sound is left to play on its own, even without locking the computer, eventually the computer will lock up and then bluescreen. Playing the sound while locking at the same causes it to happen sooner.
Edit #2: So I've seen it fail now. The sound loop starts playing correctly but quickly switches to looping of garbage data. It's as if it is just reading a random location in memory and looping that. Very strange behavior!
Solved!: It was hardware all along afterall. Apparently this particular model of laptop has a problem where the speaker is installed right on top of the hard drive. When playing sounds loudly, it creates all sorts of problems.
A blue screen is almost certainly related to defective hardware or drivers. Softwarewise, there's really not much you can do about this apart from putting together a workaround.
You can perform a memory dump and try to determine what specifically went wrong, or with some clever debugging see where it bombs out in order to try to avoid it.
Otherwise, you're probably talking about doing some maintenance work on the machine in question.