When my machine firing, fps was decreasing pretty much. I finally found the problem. Problem was the bullets thats comes from rifle. Anything doesn’t effect the fps but the bullets. How can restore my fps when my rifle is firing?
MY BULLETS:
-has no shadows,
-has backface culling,
-spawning up to number 10,
-are very low poly and has collision bounds,
-are dying after firing within 50 blender time unit.
-are rigid body but even if it has “no collision” feature, problem still occurs.
*My fps is decreasing only during the firing. After firing, there is no problem. Please help!
90% of the time bullet collision calculations are made using raycasts for optimal performance. Not with physical objects (that method will always prove to be physics heavy).
I see the major factor that is decreasing your framerate is your graphics column. You might try redeasing your sample count and game resolution if you haven’t already.
You might also look into your computer’s graphic settings and see if you could restrict some of the graphic effects. You’d be surprised how disabling some graphics settings that seem unrelated to Blender Game Engine really do effect it, performance wise.
Is it perhaps related to the “addobject” process?
On my Windows PC I get a fps hit when adding objects and this also disturbs all physics calculations.
wats physics type bullet you use? im use for object bullet sensor physics type for detect static colliders and spawn more 100 bullet in game and my fps equal 60 frame or use ray cast method -
start = barrel.worldPosition
end = barrel.worldPosition + barrel.getAxisVect([0, -100, 0]) # minus Y direction shot
ray = barrel.rayCast(end, start, 0, “”, face=1, xray=0)
hit = ray[0]
pos = ray[1]
if hit:
if “health” in hit:
hit[‘health’] -= 1
elif not “health” in hit:
bullet_hole = scene.addObject(“bullet_hole”, barrel, 0)
vect = bullet_hole.getVectTo(pos)
bullet_hole.worldPosition = pos
bullet_hole.alignAxisToVect(-vect[2], 2, 1.000)
I’m pretty much sure the question is about the ejected cases not the bullets shots. I’m going to agree with musikai and say it’s probably an issue related to ‘addObject’.
Blockquote * You might also look into your computer’s graphic settings and see if you could restrict some of the graphic effects. You’d be surprised how disabling some graphics settings that seem unrelated to Blender Game Engine really do effect it, performance wise.
Exactly. It is related “addobject” thing. When i typed -skip 20- in left button sensor that goes to “add object”, my fps increased a little more. But now, my bullet case production went way more down. Is it possible to keep high fps without not losing the amount of bullet cases?
example_bullet_ray.blend (103.2 KB)
this example file (version UPBGE 0.2.5) press left mouse button and you see how substract health property and add blood mesh, in last block i create laser ray - for understand how work ray cast
If you have a NVIDIA graphics card, go into your NVIDIA Control Panel and set all performance settings to maximum performance, literally and metaphorically.
Adjust Image Settings with Preview
Slide the Use my preference emphasizing slider all the way to the left to state you prefer maximum performance
Having the performance slider set to performance priority automatically disable most of these graphic settings, but if you’d prefer to, “keep,” some graphic settings enabled, you can re-toggle them here.
If you have a dedicated GPU, you should be able to enable PhysX for that GPU. This setting can genuinely change your physics performance in a positive sense, quite drastically usually.
create flash muzzle shot - and assign this object to gun barrel - shot only ray cast, and make flash muzzle shot - visible or invisible - this imitation add to scene flash or bullet shot effects