Reasons for decrease in Fps - Animations?


What’s causing this sudden increase in “Animations?”
It sometimes reaches 90%, and other times the bar barely moves…

It’d make some sense if the game were larger than it is now, all I have is a First Person Shooter template with a cube Ai that seeks the player. Not only that, but the framerate decreases while the player is stationary (player has no animations when stationary.)

I admit I have a pretty ‘low-end’ laptop, but I’m pretty sure it should be able to run this just fine.
Any idea what it might be?

Thanks!

do you Ik fighting?

are you spamming a animation?

lk fighting?

And nope, no animations are playing… my only suspect was a brick that makes the gun return to it’s normal position when no keys/mousebuttons are being pressed.
Deactivated that but the slow-down still persists

is your file small?

I could take a look,

Remove all animations (completely) and see if your fps is still low. I’m pretty sure, the problem is somewhere else.(collision bounds,logic, physics).
Rasterizer should be 70%+ at all times for an optimized game, physics should be less than 1-2ms and Logic should go up to 7-10ms max in heaviest scenes. What I see in this screenshot, is that your game is in its very beginning(no textures,lights,maps,complex meshes). The debugger data is not near to “normal” for this stage of the game.

@BPR: Here’s the file.

@Haidme: I’ll try that as soon as I’m done writing this post.
All those numbers are good to know, I’ll keep that in mind when optimizing the game later on

Attachments

AnimationsLag.blend (1.25 MB)

So, I’ve deleted pretty much everything in the scene, except for the player (got rid of the gun and empty)
and it’s still doing it, every couple steps I take.

Guess its the character’s fault, but why?
It’s nothing but a cube…

EDIT: NOPE, it’s actually the… camera?
Deleted the player cube, animations still going up to 40%.
What is this?!

I am getting .03 ms animations.

hmmm.


Yeah, on some occasions it doesn’t lag.
Did you try restarting the game (with ESC) a couple time? Or walk around at all?

Any instances where the animations would skyrocket?

what blender are you using?

I have a middle of the line pc, with 2.7, 2.71 and 2.72B

Newest version (the one I’m using for this project) is 2.71,
I also still have 2.67b. Haven’t tried it using the older version, I shall try that and report back

Edit: The animations bar doesn’t even budge in 2.67 (haven’t tried it before with this particular project, should’ve tried it before starting this thread…)

A couple times animation briefly spiked on the first shot with a freshly-opened blender. Otherwise it’s pretty stable.
However the .blend is complaining about a missing script. Not sure if that’s why we can’t replicate it.

Python module can't be imported - object 'LocCamera', controller 'Python':
ImportError: No module named 'Scripts'

^ Oh, that’s because the mouse look script file I’m using is external.
Python file is in a folder named Scripts, didn’t bother sending it along with the .blend

Tested with 2.72 Windows 64, Nvidia
Nothing lag seen…I reduced cpu-cores to one and half speed, Nothing slowdown seen exept fontgeneration at beginning.

I think, you have two text elements with text.resolution 15, It so huge memory eater (I think 15 times larger than normal)
Test it without resolution.001 scripts.

You have allso (scale) keys for the gun, that i think unessessary (That may not affect that, but still unessesary things).

For 2d fonts is better way to use BLF library.

Interesting idea to use just one animations and use different segments for different actions…

Don’t know if that’s causing a problem though.

I didn’t get any animations problems. Usually the only thing that would make animations jump is skinning a mesh to an armature, or complex things parented to bones.

One unrelated thing you should check out is the bounds for your player, you’ve got them set to box, which is always centered on the center of the object, but your object is off center sot he bounds don’t match the visual representation of your player.

If you turn on physics visualization, (for both collision bounds and with it turned off) you’ll see the difference. Before hitting “P”, it does look very off.

-You have allso (scale) keys for the gun, that i think unessessary
-I think, you have two text elements with text.resolution 15

I was tempted to ask if that mattered, could also be the font’s fault, wasn’t sure how much = high resolution

Fortunately BluePrintRandom got me to test a different version, the problem was gone.
The animation bar didn’t spike, and stayed still.

Guess it’s got to do with the version of Blender I was using (2.71)…
this thread did help me with optimizing though

Interesting idea to use just one animations and use different segments for different actions…

I thought that’s how everyone did it… :spin: