Why is my game slow even though I did the LOD system?

I cannot optimize my game so well. Anybody who wants to check my faults, i add the link of my game below. It is a fps game. Mice invaded a city and you try to survive in Adana (Turkey’s city).

It is an exe. program so your antivirus system can give you warning. Do not worry about it.

file link: https://we.tl/t-s7JJW3reEr

What version are you using?

Have you looked at static draw call batching?

What is it?

Are you sure? Why?

Static mesh call batching can draw 100s of objects for the cost of ~1 object.

Search Kx_batchgroup

i use standart blender game engine. Ok i will search.

Turn the frame rate from 60 fps to 40 fps. Lowering the frame rate actually increases the frame rate because it gives the PC less frames to calculate per second. Also, keep the game window a reasonable size.

This is the main problem, if you make LOD for each object of the scene, you create an excessive load on your game, the levels of detail are needed only for the main-highly detailed objects, if you created LOD for a plane - for example, for the floor, you will only add an extra size to your game, an extra load for logic-because the game engine will calculate distances for LOD from the active camera. By itself, the system of the level of detail will not give you 100% frames per second - there are still methods such as placing clipping objects that hide some of the objects not visible to the player’s camera-excluding them from the render calculations and partially collisions - but this is closer to the level design because the clippers can not be placed in the entire scene of 100 pieces, they need to be placed in key places like a screen in the theater. There is also a spawn of objects when the player passes the level - it is not necessary to keep all the objects and the entire level on the starting layer at once - you can load parts of the level, enemies, NPCs, weapons and parts of the level step by step during the passage-not forgetting what I described earlier, then your level will give about 30-55 frames per second, which is a normal indicator for games

1 Like

Very informative reply, thank you so much. Within this context i have several questions:

1- So i understand that i should create lod only for high detailed objects, not for plane, floor or walls right?

2- In this sentence do you mean using occluder object?

Yes. Exactly. But how can i spawn or hide objects? By making visible from invisible? Or is there any method show or hide layer in game? I cant find it.

I found the root of problem but i still need help. My rasterizer amount is big. What are the things that increases the rasterizer?

optimizing sounds might help

1 Like

Hi again, yes you understand me right, use LOD only hipoly objects - actors models, gun models, technics models, occlusion object not support collision detection - this type object work how ghost, and need use collision model for object occluder - i use occluder for big house or mounts this is good overlapping invisible objects and cut invisible objects to calculation game engine, if you map or levels very big use small parts and spawn this parts in game - player finish in zone 1 and sensors ray or radar registration player and add - spawn zone 2. If you rasterizer get high numbers - you camera see very more objects or very more polygons in game, maybe you see hard texture - 4048 x 4048 or high

1 Like

in upbge there is mesh draw call batching

by default each object is 1 drawcall

you can have 100’s of objects drawn in a single draw call, but they must all use 1 single material and be static*
this is why older games used material atlas - so things can be batched,

“It is important to know what are draw calls and what are batches. A draw call is a call to the graphics API to draw objects (e.g draw a triangle), while a batch is a group of draw calls to be drawn together. Batching objects to be drawn together, minimizes the state changes needed to draw each object inside the batch. This is turn leads to improved performance by reducing the CPU cost of rendering the objects.”
https://shuvit.org/python_api/bge.types.KX_BatchGroup.html

1 Like

Do you suggest joining several unimportant objects into a single object? Does this make my game faster?

All stationary objects should be joined together for maximum performance, yes.

1 Like

Thank you!

Yes join objects to object for more speed you game, use group and link objects frome library blend files in game levels this method get for game analog asset system - quick editor objects not the dependence of sets on the files of game levels, if you need to replace the model, you change it only in the library file, all links are updated regardless, the objects connected and added to the game levels are configured with logic blocks-you can configure some monster in one file and its behavior will spread when linking to all models, link groups is one more way to speed up your game

It didn’t work. Conversely fps decreased! :frowning:

Sounds good but i need to understand somethings.
1-What is library?
2-how can i reach it?
3-and how can i link and group objects?

First, the library is the blender files-which are in the folders with the game - it can be monsters, weapons, first aid kits (each file is a library) objects in these files must be added to the group - and the group must have a name that reflects the essence of the object. Second, to add such a group to the game level file, you must make a link - and specify which group you are linking. Third, to group an object, you must select it and create a group in the object panel and specify its name, then set the offset from the cursor next to the create group icon there is a triangle button by clicking it set the offset from cursor - where the 3d cursor will be there will be a new center of the group (be careful with this, it is better to set the 3d cursor to the center of the object) and when the group is created, you can add it via shift+A add a group, do not forget to save the file and if you edit groups that are linked to other files, also save the changes

1 Like