PStats problem [SOLVED]

I’m having some problems with PStats, but maybe I’m doing it wrong.
I’ve looked here: … ith_PStats but that gives me nothing.

I’ve edited the Config.prc file changing want-pstats to 1 but after doing that my game doesn’t start at all (the window pops up for a fifth of a second and that’s it, no warnings, no errors, no messages, no nothing). This happens whether or not I’m running the pstats server.

When I leave the prc alone and just call PStatClient.connect() at runtime the same thing happens.

I’ve tried pview and pressing shit+s with pretty mush the same result (a second window pops up for a second thou and then pview closes with not a word of complain).

I’m starting the Pstats server with pstats.exe from panda\bin and a program named “PStats 5185” is running when I try to do this.

I’m using windows xp, panda 1.6.2 with the python version that ships with panda3d. What am I doing wrong?

Is it really exiting without an error message? What happens when you run Python interactively from the command shell, instead of clicking on an icon or something?


I’m running it form the command prompt (like “python” or “pview my_model_name.egg”) and there’s no “trackback”, no nothing, really.

When I run Python interactively, I’ve typed in:

from pandac.PandaModules import PStatClient

the python shell displayed a mysterious “1” and PStats started -showing mostly empty space but it did start :wink:

When I’m not running the PStats server and press shift+s from pview I’m getting a “can’t connect error”:
:net(error): Unable to open TCP connection to server on port 5185
:pstats(error): Couldn’t connect to PStatServer at localhost:5185
…but frankly I wouldn’t expect anything else to happen.

This is precisely the correct behavior. The “1” means that your PStats connection has been made successfully. The empty window is because your client is paused; you can type:

to resume execution and the PStats window will start showing real data.

This is also, of course, expected behavior.

As to the mysterious crashes in other cases, I still think you’re somehow not seeing the error message, since it works when you run it interactively. When happens if you run:

python -i


python -i

makes no difference, PStatClient.connect() ends the program and exits python :frowning:

I’ve tried:

from pandac.PandaModules import PStatClient

(PStats start at this point)

from direct.directbase.DirectStart import *

(a Panda window pops up with black background)


…and it all closed down. The Panda window, the PStat window, and I get kicked back to the command prompt (but the PStat server is still running)

Here’s a copy-paste of the command prompt and what I wrote:

Looks like a candidate for the Abnormality Of The Month Award :wink:

It’s weird all right. Perhaps a virus-scanner is mistaking the PStats communication for some kind of virus, and killing the program? Or, something is broken in your low-level UDP stack that causes a crash at the first UDP datagram?

Try setting:

pstats-tcp-ratio 1

in your Config.prc file. This will disable the use of UDP, and tell PStats to use strictly TCP datagrams, which appear to be working in your case.


Setting pstats-tcp-ratio 1 worked!