I’m facing a strange problem and I really don’t know what’s the next step for me to check to find the solution.
My game is working fine a my IMac (server+client) which is six month old (NVIDIA GeForce GT 120) but is getting blocked on my Windows laptop (client only) that I call the dinosaure with a shared grapic card.
If I need to explain the game in two words. I would say that a player need to take a decision (using GUI elements) and then wait the other player’s decision before choosing a new one. So there is no a lot of information that the server need to receive or send per frame or other info that might be lost in between.
On the Mac, I’m never under 60fps. And between 20 and 30 on Dino… When I said “game blocked” I mean after few rounds (working perfectly at the begining) my poor old laptop is not receiving info from server anymore. I do see them going out of the server but nothing arrive on Dino!
It’s always the laptop which got this bug… Tried like hundred times and never on the Imac. I’m on a local network, so, it can’t be a connection problem. I’m using a lot of DirectGui objects and thinking that it might cause my troubles.
Is their somekind of known traps that eat your frames when you hide, show, resize and modify a lot of DirectGui objects ?
Do you think it’s because the laptop is not able to follow anymore and I need to get a big bro to Dino ?
Here’s the analyse of the scene, as you can see there is not that much :
Maybe it’s because of the GeomVertexArrayDatas and GeomPrimitive that are redundant. I can only guess what does this mean and really don’t know how to avoid it. 30k doesn’t look to be a big deal tough!
No, that has nothing to do with what you describe.
You describe a graphics freeze. If it doesn’t come back, it’s probably due to a driver bug, but it might also be just a lot of CPU utilization or something. It’s true that creating a lot of DirectGui elements can be CPU-intensive, and if your laptop can’t keep up, it could be a few seconds without animation. It should recover eventually, though.
Try running with “load-display tinydisplay” to prove whether it’s a graphics driver bug. If the problem goes away when you run with tinydisplay, it’s a driver bug. If it still exists, it’s something to do with your application or with Panda itself.
I’m not really familiar with how to do that. Do you mean removing “load-display pandadx9” and “load-display pandadx8” keeping only “load-display tinydisplay” ?
If yes, I did it and got the exact same failure as before
The fact that the problem accur randomly (laptop fail at the tenth or fourth hand… or whatever) made me think about something:
A QueuedConnectionReader listen for events each frame. What if the server send the info: "Come on stupid old laptop, it’s your turn to play" at the frame x that is being missed by the laptop ?
Well, I red somewhere on the manual that there is a way to recover the last frame which means that the laptop may switch few of them. So, if the frame he missed was the one the server sent something, the QueuedConnectionReader will then miss it!!!
Is that possible ?
Yes, that is what I meant with tinydisplay. Since you switched it and it still freezes, it means it’s not a problem with your graphics drivers.
So, more likely something in your application is simply locking up. If any task gets stuck in an infinite loop, or doesn’t return for any reason, the whole application will lock up and stop rendering.
Network messages are not lost just because you’re not listening at the moment they’re sent. They will be received the next frame instead. Still, you might be on to something; it might be freezing because something in the networking is getting confused; maybe it’s waiting forever for a message to come in or something. (If you send bogus data to a client that’s expecting formatted datagrams, it get can caught in an infinite loop trying to read the next “datagram” which is just garbage. That’s just one of many, many possibilities, though.)
You’ll have to debug this yourself. One approach is to put in lots of print statements all over and try to figure out the last thing it was doing before it got locked up.
Here’s all the debug I did until I found something new, skip the quote if not interested:
I’ve got something new
In order to know if my laptop still have a live connection with the server, I added a pemanent DirectButton which sends a basic test-string to the server.
When the freeze appear --> push button --> server print the test-string and additionnaly to that, the freeze disappear : The laptop turn was restored and able to play. Conclusion: When laptop freeze, network connection is still up AND sending a network message from laptop to server removes the freeze.
You were right!
I already checked that all messages sent from the server equals the exact same messages received by laptop (datagram are supposed to be empty after being red).
Also, I’m using basic addUint8() and addString(), no huge data or even classes, just strings and smallInt via PyDatagram. When they are received, I just use getUint8() and getString() in temp variables that I thread afterwards. No more, no less!
Here’s an exemple of the longest def for sending from host to server:
Is there some special manipulation you need to perform on a PyDatagramIterator after you finished reading the info it contains ? (as txt file you need to close after reading)
What kind of other test can I perform on the PyDatagram and PyDatagramIterator to determin the freeze’s cause?
I finally found the answer to that problem
While I was downloading a tool on that old laptop, I remarked that the download load-status bar was frozen in firefox. I had to manually pause it and resume it to continue the download.
So, all the chekcs/ searches I did was completly useless. It was just an old virus very well hidden on the laptop that freeze data exchanges. Any video on youtube get frozen after a minute or so… I thought about many possibilities but not that one!
Anyway, long live to Dyno with his brand new re-installation.