FrameRate decline down to a plateau.

Now that my track builder is complete, I’ve started taking a closer look at my game’s performance. In so doing, I’ve run into a curious issue.

When the race gets started, the framerate sits nicely at 60 fps for ten or twenty seconds, then degrades down to about 30 fps over the next half a minute or so. Then it stays at about 30 fps indefinately.

I’ve been printing out the task manager and using render.analyze() to try and get some insight into these problems.

render.analyze() is showing no changes whatsoever.

The print out of task manager isn’t showing any sort of increase in the time any of the tasks are taking, including igLoop and collisionLoop.

I also opened up the Direct Session window and Task Manager to look at resource usage. I’m not seeing any increases in CPU or memory usage during the decline.

I’m really at a loss as to what I can do next to try and evaluate this problem, short of snipping the game into pieces and slowly adding them in, one at a time, until the issue presents.

Anyone have an idea on what I can look at to try and get a clue as to the cause?

That sounds like video synchronisation. Try disabling it. Put “sync-video 0” in your Config.prc.

Okay, I tried that as you suggested. On my opening menus I got around 450 FPS, which is not wholly unexpected. Then I jumped into the game proper, and I had the same decline. This time from about 65 fps down to the same 30 fps.

Try using pstats, you should be able to identify where the slowdown is happening pretty quickly.

I looked into pstats, and I think that would be pretty helpful. Unfortunately, in my experimentation, I haven’t been able to get it to work. Can you give me an example of how I would use it to get a report?

That will make it run when you start your program. When you’re viewing the time breakdown of the frames you can double click the tags to the bottom left to get a more detailed view of that component. Click around to find what task or function is taking the most time and then debug your code to try to isolate it.

I followed both those steps. I started up pstats.exe, and i got a panda3D icon on the start menu (though no window opened). I the added the want-pstats 1 to my config.prc.
I let pstats run in the background and I started one my Panda3D apps, and nothing happened.

Nevermind, it was because I already had a want-pstats variable in the config.prc. I removed the one I had added and changed the value for the pre-existing one, and now I’m getting a read out.