How can I optimize my game? Such as higher FPS?

My game is indoors based, so not many polys on view at one time, but I see have low FPS when testing it. It isn’t my computer, It’s brand new with a decent processor and Gcard. I have noticed that the rasterizer is using most of the render time, how can I optimize this?

Make sure that complicated objects aren’t set to having collision calculated. So for example for a weapon or a character use no collision instead of static ghost. That helped me for my game. This might not be your problem though since it’s the rasterizer, I don’t know much about that kind of stuff.

Yea, I’ve already set all the complicated models to collision box.

what does your profiler say?

anything that does not really need dynamic lighting, don’t.

rasterizer, or scene graph or logic?

Rasterizer takes up 83%, and what do you mean dynamic lighting?

Looks like you are using some shaders. They eat rendertime too. Try to identify the shaders that eat most but do not have much effect.

Lights with shadows use a lot of rast, the bigger the shadow buffer the more intense,

high resolutions eat rasterizer,

shaders,

excessive polygons

my whole game has 8000 triangles at the moment.

I have 106k triangles… However, usually a very small fraction is visible at any given time while playing. So I can speed up lights by decreasing buffer size, thanks!


How many rooms you have? Image does not show very complicated so 18 fps is very low for modern gpu’s.
If you have many rooms, I advice separete them different scenes or files and load them when needed…
Or simplier solution, separete them with occlusion culling (Occluder eats cpu, but saves gpu).
Make simple plane inside of the walls, and set it to occluder (from physics panel)
Set Occlusion culling on from bullet panel.

Have you big textures?
Try keep textures size with power of two (512x512 , 1024x1024 or 1024x512 pixels)
Make sure textures that dont need alpha make them ‘rgb’ not ‘rgba’. (They eats gpu’s memory and possible may impact speed too)

Create good lod (simpler mesh from trees when camera if far from object) Specially for trees they look complex, and they have propably alpha sorted textures.

I don’t really think that the separating rooms thing will work out very well, but I will do the occlusion idea. Thanks! Also I do have pretty well balanced textures, I think.

Lots of objects can reduce FPS. Merge (object/texture) where appilcable.

Well I just did a test where the starting room was in it’s own layer, apart from the other rooms, and it still had the same fps…

what resolution?

What do you mean? Game resolution? 1080p, all of the spot lamps are 128.

in the render tab,

try lowering your resolution,

1080p is a pricey resolution in the bge,

That’s a little annoying, with that I wouldn’t be able to tick desktop and have it work when I compile it and run it on other computers… Also, Is it possible that blender itself needs to be optimized? Because, I mean, as of now it can’t hold a candle to engines like the cry engine.

You might want to use the BGE’s built-in LOD for some of the higher poly objects like the trees. Also, you can use a simple logic system that turns the visibility on and off for static objects that are not being seen because the player is inside or something.

To note on Blender needing optimization, the BGE cannot, as of now, display a polygon resolution that is equal to that of a modern day AAA game without reducing everything to a slideshow. That means that the excess in geometry in some places might need to be swapped out for normal maps.

If you have a decent graphics card 1080p shouldn’t be a problem, I would agree with the LoD implementation however if you are only in one room at a time this probably isn’t necessary. As also mentioned disable physics for objects that don’t require it like the roof for example.
Alternatively you could use one cube as the collision box for multiple items that are close to each other, which will increase your performance.

also how many lights does your scene contain and are you using any modifiers (e.g. subdivision surface)?

Otherwise you could post the .blend here so we could look at all the settings etc. however if you want to keep this private that’s completely understandable.

What are your textures like? What kind of compression are you running and what res? How much textures do you have?

In situations like this, a profiler would be incredibly useful since it’ll tell you where the choke points are; unfortuntely, this has always been a weaker aspect of the BGE.

I don’t think logic or physics are the problem here. The issue appears to be mostly due to rasterization/GPU. Technically, those trees outside are still being drawn, if they are in the viewing frustrum. BTW, you’re using GLSL mode?

Generally, you want to maximize reusing resources. From what I know, texture binding is the most expensive state change, which means it’s best to use a single texture atlas and set the UV coordinates appropriately. However, your scene looks simple, how many different textures are you using?

For example, if you remove all the trees, how much does the rasterizer usage change?