Alas, I seem to have hit a performance pitfall, and find myself a little lost as to the way out.
Having made some progress on the generation of my levels, and having a frame rate that I was happy with, I recently began placing enemies, replacing the old single, hard-coded enemy that I had had in place previously.
This, it seems, is where the problem came in: it seems that with my current numbers of enemies (not uncommonly between 30 and 70, I think), my frame rate takes what seems to me to be a fairly large drop, all to often drawing closer than I’d like to or falling below 60.
Runs with PStats have yielded some results: it appears that collision accounts for at least some of the problem, and indeed, removing the lines that add each enemy’s object-collider (as opposed to the collider used to detect weapon impacts) to cTrav and to my CollisionHandlerPusher seems to improve matters - but not by terribly much, it seems to me.
Beyond this I find myself a little more lost: PStats also mentions some time spent in App->Show Code->update, but I don’t know to what this refers, and there seem to be tall, very brief spikes in at least a few different categories.
I’ve also tried experimentation, removing various elements and changing the ways in which I’ve been doing certain things (including reducing my environment’s geom count thanks to the readout provided by render.analyze()), but thus far I seem to have seen little improvement.
As to the enemies, each is an animated model (non-instanced, I’m afraid, as they could easily each be playing different animations at different points, it seems to me; I suppose that I could use a limited number of “prototypes” from which to instance, but would rather not unless I am confident that doing so will significantly reduce my problem), each with one CollisionSphere, one CollisionTube and one CollisionRay, as well as a traverser for the ray, as I recall.
Perhaps significantly, a noticeable drop appears to occur when a number of enemies are on the screen - something that might perhaps not be surprising, save for that the number of enemies seen at once seems to me to be lower than I would expect to be so great a problem.
The shader generator is on, I believe, but switching it off doesn’t seem to produce much benefit.
Does anyone have any suggestions, and if so, what are they, please?
My thanks for any help given.