Jump to content


nutsaq

Member Since 08 Nov 2006
Offline Last Active Apr 13 2011 04:26 PM

Topics I've Started

Game Freezing!

05 August 2009 - 11:21 PM

Hi there

I am working on a game in GM7 pro utilizing 39dll for net code. I've been having some strange behaviour and wondering if anyone might know what might cause it.

The game will freeze up at what seems like random times. Sometimes with a game going with multiple people activily playing, and sometimes with just a server + client idling. The freezing can happen on either the server or the client. The game freezes up and stops processing user input and drawing.

I have ruled out an infinite loop because if the server freezes up, you can still connect to it as a client and run around etc.. The server's game will be locked up and "not responding" yet it is still receiving and sending data because the clients are still receiving and processing it. Also the server will still hear the sound fx based on what the clients are doing.

The server sends updates to all clients of their position every 10 frames. When the server freezes up and the clients can still play, they get into this super speed where they are getting the update much more often. It's as if the server is sending data much faster than it should. It is definitely not an infinite loop because I have debugged by writing the current frame to a txt file and the frames are increasing outside of the loop.

It's almost as if GM is skipping code! Here's why I think this. To debug, I made the game write into a text file the current frame and the number of instances (I thought maybe there were objects being created when there shouldn't be).

this is all in a step event:
debug= file_text_open_append("debug.txt");
file_text_write_string(debug, "Frame: "+string(currentframe));
file_text_writeln(debug);
file_text_write_string(debug, "Instances: "+string(instance_number(all)));
file_text_writeln(debug);
file_text_close(debug);

It will work fine for a while, then when the freeze happens, I get errors "Error opening file for appending." and "File is not opened for reading." This is wrong because clearly the file is opened and closed in the right way.

Has anyone experiences symptoms like this, and do you know what might be happening?