Tiny cubes makes game run slow??!!

After you kill an enemy, little pieces of meat fall to the ground. The thing is, when approaching those little pieces of ‘meat’
the game dropped as low as 2.1 FPS (OMGWTFBBQ!!!)

I had the pieces END when the player came close enough to it, but this problem still persists :mad:
If it helps, I’m using 2.65, and never had this problem with earlier version.
Thank you for your assistance!

Use the framerate profiler to see what’s sucking your FPS down.

How many piece of meat are you talking about? And what are there physics properties?

Sent from my Nexus 7 using Tapatalk HD

It is not the size it is:

  • the amount of physics objects
  • the amount of intersecting collision boxes (from your description I guess they are closed together)
  • the physics shape which influences the processing time a lot.

So you should think about other solutions/effects. The first question: Why is there “meat” falling down? Is it necessary? Can it be just some “explosion cloud” of smoke and liquids?

So you should think about other solutions/effects. The first question: Why is there “meat” falling down? Is it necessary? Can it be just some “explosion cloud” of smoke and liquids?

Or and explosion of dynamic ghosts that last 2 or 3 seconds?

Sorry for the late reply :s
SO, there are 3 cubes (6 faces) and the player. (Another 6 faces)
SO there isn’t much going on. It’s strange…
but what I did was make the pieces of “meat” END when coming close to the player. It sorta worked, it doesn’t happen as
frequent anymore.

I think it would help us more if you made more use of the profiler like Solarlune said, because the physics of a few cubes should not be slowing the game down to 2 FPS (because a lot of people have dozens upon dozens of physical objects in their games at 60 FPS).

It could be multiple things, it could be highly unoptimized logic, it could be less than optimal physics settings ect… Again, use the profiler this time because this will show you where the bottleneck is).

Without this information (along with no screens of the settings being used), we’re only guessing.


Here is a screen… and stuff

What is the polygon count on that gun model, because not only does it seem excessively high, but it will also slow down the game significantly if the object is being looked for with near sensors and radar sensors (which I believe check on a per-polygon basic rather than the coordinates of the origin).

If the meat cubes are using near sensors, then you can make the logic go a lot faster by replacing it with a simple Python script using the getDistanceTo() function. Lowering the polygon count of the gun wouldn’t hurt either.

This red cubes are the debris?

They’re actually supposed to be pieces of an enemy (you shoot them and they break apart into little pieces)

As for the gun… It’s not the one that triggers the end of the cubes, the player is.
The game I was using this for is gonna be delayed (again)
I’m attpting to learn rigging, so thanks for your help everyone!! But yeah… I never even considered the gun model to be
The cause :0

I suggest to avoid any near sensors at the debris as Ace already suggested. Several near sensors will make it very slow.

I have made a few games with blender and suffered the same problem, the problem is with the near sensor, if you run it in debug like that you will see a large increase in logic when you enter the near sensor.
To fix the problem make a module to check for collisions using getDistanceTo() function and run it once every 30 frames or twice every second.

You can also switch the near sensor for a Collision sensor, this will only slow the game when you collide with the object.

The fastest way to control collisions I found is to make a master object that checks for the collisions instead of allowing each object to check them self.

Just realised that you are making the objects look for the player this means each object is wasting logic, you should instead make the player look for objects near it this way you will only need one sensor, saving logic.

@ScoutingNinja, would you provide a code to take a look?

OK, first the basic:


import bge
con = bge.logic.getCurrentController()
own = con.owner
sce = bge.logic.getCurrentScene()


Player = sce.objects['Player']


if own.getDistanceTo(Player) < 10:
    own.endObject()

use it with a Always sensor on the cube
Then the collision manager:


import bge


con = bge.logic.getCurrentController()
own = con.owner
sce = bge.logic.getCurrentScene()


Player = sce.objects['Player']


for obj in sce.objects:
    if "Meat" in obj:
        if obj.getDistanceTo(Player) <10:
            obj.endObject()


use on a empty or other object in the scene
If a object has the property of meat it will end.

Thank you.