Adding Collide tag to maze model lowers FPS to unplayable

Hi, I am using the PRPEE exporter (formerly YABEE) to export the model of my maze but when I export it with the collide tag and then load the model into the game it reduces my FPS from 144 to 2/3 FPS. I exported the model without the collide tag by unchecking the box on the exporter and that seemed to stop the FPS from dropping but I would then have to manually add the collision solids (probably polygons) around the model which since it is a fairly large model would take a lot of time to do.

Does anyone know of a way to stop my FPS from tanking when I add the collide tag to my .egg file? or any way to automatically add collision solids to a model without using Bullet physics or ODE as the character controller I am using does not allow for the use of those physics engines.

It’s hard to say quite what might be going wrong without more information on your model and collision-geometry/tags, I fear. [edit] And your in-game collision setup, for that matter. [/edit]

That said, my understanding is that PRPEE is not a recommended exporter for most purposes: it’s specific to one user’s project, and while I don’t know the specifics offhand, I seem to recall that it has some issues that maybe problematic in other projects.

If you’re using Blender 2.78 or earlier, I recommend using YABEE. If you’re using Blender 2.79 or later, I believe that “blend2bam” or one of the other export-pipelines is generally recommended.

I just tried to export the model of the maze using blend2bam and specified the builtin physics engine but still it is causing my game to drop to 3FPS, does that mean that it is something to do with my model?

Presuming that blend2bam did as expected–I’m not familiar with it, so I don’t know its proper use–it could be something to do with your model, or it could be something to do with your code.

For example, if your collision-model is particularly large and particularly detailed (the latter such as via sharing data with your visible geometry, perhaps using the “keep” property of the “Collide” tag), that might be a problem, I think.

A quick test might be to replace your model with something very simple–just a box, if feasible.

Does this help?

model = loader.loadModel(...)

Where does PStats show most of the time is being spent?

How complex is your scene?

1 Like

I added the line of code you suggested and it thrown an error: (this is when loading the .bam file when trying to load with the .egg file it threw a different error)

The scene itself (in my opinion) is not very complex at all. there are only three models loaded into the scene (the surrounding environment, the player and, the maze itself) here is an image taken from the game running with the stats in the left hand corner:

Have you tried connecting your game to to the PStats tool? (i.e. This one)

If so (or if you do), where does it report the program spending the greatest share of its time?

Just tried connecting to the PStats tool and it tells me that its unable to open the TCP connection to the server? I followed the documentation on how to connect. I ran the pstats.exe and then connected using want-pstats 1 in my configs.prc file and I have tried the other method of connecting PStatClient.connect() is there something I am doing wrong?
Here is an image of the error message I am getting:

Is your firewall (or antivirus?) perhaps blocking that port?

I just went into my firewall setting and my antivirus settings to check and they are both allowing network traffic through those ports. Giving the documentation a closer look it says something about a GUI opening when I run the pstats script? But that does not seem to be happening. Should I be running the script in my terminal on PyCharm?

When PStats is first run, it should produce only a small GUI–a little label indicating that it’s running. See here:

Screenshot from 2021-03-15 17-43-12

As to how to run it, I usually just run it from a normal terminal. I don’t usually run it from within PyCharm.

Specifically, I don’t run it as a script–instead, I run the command that should be installed along with Panda, like so:

When you attempt to run PStats, does anything happen? Does the command-line return immediately, or produce any output?

I know there are a few ways to run a .exe file in the windows CLI so I tried a few of them most of them resulted in the errors seen below and no GUI. except when I ran start pstats.exe which gave no output but did not show the small GUI as pictured in your post

EDIT I did also go into the directory where the script is saved and tried to run it in there but it gave the same errors

Hmm… That’s odd! It looks as though there’s something wrong with the way that PStats or Panda has been installed–as though it’s missing a directory in some system variable or another.

I’m not familiar with this, I’m afraid–perhaps rdb or one of the others might know or figure out what’s going on there!

Oh no that doesn’t sound good! Thank you for your time and help with this!

First run pstats.exe and then your Panda app with want-pstats 1 in config. There is no window when you start pstats on Windows but you should see it on taskbar.

Yeah i have done all that but as thaumaturge has said it looks like there is something wrong with the way that either panda3d or PStats has installed

Did you install Panda with pip btw? I saw some people had problems if they did.

And check that you have PATH variable like this in your user system settings:


Python was already set up as an environment variable from the setup when I installed Python. I just added the panda files as an environment variable like suggested in your post but that still does not seem to work as I am still getting the same errors as before

EDIT I did install panda with pip i believe. is it worth me uninstalling panda and then adding it to my files using the source code? I have also tried upgrading the panda package (as i was running on 1.10.7) but i am still getting the same errors when i try and run the PStats

Completely uninstalling Panda and then re-installing it made the pstats run and it is now working :slight_smile:

1 Like

@rdb Now that i have the PStats running, What am i looking for to find out why my FPS drop from 144 to 2/3 when i add the model with the collision tag