Direct Play Freezing

Blitz3D Forums/Blitz3D Programming/Direct Play Freezing

Craig H. Nisbet(Posted 2004) [#1]
Hey Guys, I've coded a strategy game using direct play. I've noticed that if I play my game in single player mode, which doesn't work that much differently from the multi-player mode, that game on the client node will occasionally just totally freeze up. Anyone have any idea why Blitz would just freeze completely like that? Is it a memory thing or is it Direct Play?


Jeremy Alessi(Posted 2004) [#2]
Are you reading all incoming messages every loop or only checking 1 per loop? I made that mistake a few years ago and it caused it to basically freeze because the message queue just builds up. Look at my FPSNetUpdate code and it show's how to use DirectPlay in the UpdateNetwork() function you see how it reads all messages that loop.

Got non - 3D code snippet of the month in the newsletter ;)

http://www.blitzbasic.com/codearcs/codearcs.php?code=1149

Specifically to your problem though it sounds like it's freezing in single player on a client/Server setup ... well it could be what I'm saying ... or maybe you are sending too many messages. I put mine on a timer as you can see in the code. Depending on how much information you're sending a timer is a good thing to have because that can also cause the game to lock up.


Craig H. Nisbet(Posted 2004) [#3]
Wow!! Great example!! I'll be referencing this a lot!!


Craig H. Nisbet(Posted 2004) [#4]
Hey Jeremy, you were right. That's what it was!


Jeremy Alessi(Posted 2004) [#5]
No probs ;)