how to avoid Frame rate drops ? ????????

Hello everyone yes im back and its been a short year and finally i have resumed my projects which seem to be really progressing very slowly which is not bad at all. Because i believe that the project will be successful in the future.
Today i will be asking questions just to have a clear understanding of what can be done about the animation frame rate in the BGE.

So the Big question over here is that how do you lock the frame rate at a constant variable?
Now let me take an example so in the case of a highly detailed scene with lots of objects and animations And maybe lets say that i want the game to play at 60fps. locked at 60fps this means that what ever happens in that scene happens at that frame rate. And look i know that in the render panel under display properties for the game , blender normally sets it to a default value of 24

So basically is they a script that deals with the overall peformance of the game that also plays a part in Locking the animation frame rate at a constant value. (If possible please let me know)

Why am i asking this ? Well im currently working on 2 projects right , 1 of them being a racing game and the other being an action adventure game. Normally for racing games it is preferable to have 30fps and in an open world adventure game the standard being 60fps . Sometimes as we continue to add more and more things to the scene or Game as a whole the frame rate shatters down even below 24fps which is bad for peformance.

And ive already watched optimization tutorials so i know about them i just want answer’s from the community as a whole.

Thank You very much for your responses i look forward to them.

step 1 - create generic objects you will use alot

step 2 - gather textures you know you will need for terrain

step 3 - bake all of that onto one big atlas texture

step 4 - use upbge instancing, and static draw call batching when that lands.

this is what I am doing for wrectified,

another huge issue is animations that deform vertex (armature modifier) take up far more resources than bone parented game objects

another huge issue is ik vs fk for animation costs.

So basically is they a script that deals with the overall peformance of the game

That would be a million dollar script for every game developer out there. :smiley:

But…there is one thing that is widely used for keeping high fps. Good LOD system combined with wisely made level design. This will save you the most performance, unlike any other techniques.
And as Blue said, using a good practice of optimizing anything you can, is never wrong.

1 Like

I just saw this video about Shadow of the Colossus, running at 15~20fps it was the slowest game produced on ps2 or perhaps the whole gaming history, it’s a legend

What frame rate are you talking about.

Render frame rate: The number of images rendered per second.
Logic frame rate: the number of logic cycles per second
Physics frame rate: the number of physics update calculations per second
Animation frame rate: the number of frames played per second.

The overall frame rate is what you see -> the render frame rate.

The logic frame rate influences the behavior of the game (e.g. counting slower/faster). It should be kept constant to provide a consistent behavior.

The physics frame rate should at least match the logic frame rate. So you get a physics update after each logic change to the scene.

The animation frame rate has no impact on the overall frame rate. Animations do not require discrete frame numbers to be played (1,2,3). It is easily possible to calculate intermediate poses (e.g. at frame 2.16). This means you can have any animation frame rate you like. Per default it matches 24fps as this is how you would design your animations for a movie.

Playing an animation with 24 fps with a 60fps render frame rate still plays the animation with the speed you expect (even when you change the render frame rate).

The exception is, when you manually set the pose via logic as this follows the logic frame rate. In that case you need to calculate the “step size”

step size = animation frame rate/logic frame rate.

which is with default settings step size = 24/60 = 0.4.

You increase the animation frame by 0.4 at each logical frame. So you get: 1, 1.4, 1.8, 2.2, …

Thank you everyone surly the diversity of the nature of answers i have received are truly helpful.

step 1 - create generic objects you will use alot

step 2 - gather textures you know you will need for terrain

step 3 - bake all of that onto one big atlas texture

step 4 - use upbge instancing, and static draw call batching when that lands.

Thanks to BluePrintRandom i truly appreciate your answer and i guess i will try the same.

That would be a million dollar script for every game developer out there. :smiley:

But…there is one thing that is widely used for keeping high fps. Good LOD system combined with wisely made level design. This will save you the most performance, unlike any other techniques.
And as Blue said, using a good practice of optimizing anything you can, is never wrong.
LoL haidme but thanks as well bro.

I just saw this video about Shadow of the Colossus, running at 15~20fps it was the slowest game produced on ps2 or perhaps the whole gaming history, it’s a legend
LoL Again guramarx but thanks.

What frame rate are you talking about.

Render frame rate: The number of images rendered per second.
Logic frame rate: the number of logic cycles per second
Physics frame rate: the number of physics update calculations per second
Animation frame rate: the number of frames played per second.

The overall frame rate is what you see -> the render frame rate.

The logic frame rate influences the behavior of the game (e.g. counting slower/faster). It should be kept constant to provide a consistent behavior.

The physics frame rate should at least match the logic frame rate. So you get a physics update after each logic change to the scene.

The animation frame rate has no impact on the overall frame rate. Animations do not require discrete frame numbers to be played (1,2,3). It is easily possible to calculate intermediate poses (e.g. at frame 2.16). This means you can have any animation frame rate you like. Per default it matches 24fps as this is how you would design your animations for a movie.

Playing an animation with 24 fps with a 60fps render frame rate still plays the animation with the speed you expect (even when you change the render frame rate).

The exception is, when you manually set the pose via logic as this follows the logic frame rate. In that case you need to calculate the “step size”

step size = animation frame rate/logic frame rate.

which is with default settings step size = 24/60 = 0.4.

You increase the animation frame by 0.4 at each logical frame. So you get: 1, 1.4, 1.8, 2.2, …
Thanks Monster your answers were very
helpful now i understand Frame rates more easily. I was talking about the Render frame rate anyways.

Hear’s a last question bro do all these frame rates have a significant impact on the overall games performance?
(in particular to the Render Frame Rate) And if so how do you explain Render frame rate drops?
(Under Display Properties in the render Tab "Framerate and Profile [Enabled] and in the game it shows
frame time at the left corner of the screen and usually its 60fps i know that sometimes it can drop depending on whats happening in the scene.)

Fred/K.S

Yes/No.

Animation frame rate is relatively independent from the other rates. You can have the play speed as low or high a you like.

It is more a “conversion” from Blender to BGE rather than a real influence. Imagine it as “playing an NTSC video (30FPS) on a PAL (25) device”. While this is difficult on that media (video frames live in a discrete space), it is easy with Blender animations as they use curves which results continuous frames. In other words it is easy to convert from Blender animation pose to a rendered image even when the frame is a float.

The other rates have impact. E.g. when the physics engine updates twice a second, you will notice that even when you see 1000 rendered frames a second. This means the lowest of the rates is what counts.

There are more things to consider. The quality (or detail) of the physics engine matters on the physics update rate, as smaller the steps (higher frame rate) as more precise the result, but as more calculation power is required.

Now look at the logic. In difference to Physics and Animation a logic frame is in an discrete space (0,1,2,3 …). There is no “interpolated” behavior between two frames. While higher physics rates increase the precision, higher logic rates makes the game feeling faster. E.g. a counter runs faster, a character runs faster, you die faster, the reaction window is smaller. Typically you want this frame rate at the same speed throughout the whole game and across different systems. Otherwise the game experience is depends on the hardware.

The render frame rate is in discrete space too. Typically a user can live with a few dropped frames (not rendered images), but you still should avoid it. The BGE automatically skips up to 4 rendered images when the overall processing time of a frame exceeds the limit (default 1s/60).

This is a method to try to keep the other frame rates constant. Unfortunately this helps on expensive rendering only (as it is skipped). Lags caused by physics, logic and animation will still be present.

Overall you have the limit of 1s/60 all the time. You need to design your game that it never drops below that limit.

General advice: the less to do the less time is required on processing

less faces -> less render, less physics
less objects -> less render, less physics, less logic
less sensors -> less logic
less code -> less logic
less bones -> less animation
less materials -> less render

Be careful, the influence is not equally the same. Typically you look at the profiler where the most time is used and try to work on that first, as this is where you can potential save the most.

Reducing something comes with a reduction of details. So you need to find a balance between details and performance.

Animation frame rate is relatively independent from the other rates. You can have the play speed as low or high a you like.

It is more a “conversion” from Blender to BGE rather than a real influence. Imagine it as “playing an NTSC video (30FPS) on a PAL (25) device”. While this is difficult on that media (video frames live in a discrete space), it is easy with Blender animations as they use curves which results continuous frames. In other words it is easy to convert from Blender animation pose to a rendered image even when the frame is a float
OHHHHHH okay now i get it
thanks bro.

Now look at the logic. In difference to Physics and Animation a logic frame is in an discrete space (0,1,2,3 …). There is no “interpolated” behavior between two frames. While higher physics rates increase the precision, higher logic rates makes the game feeling faster.
True i agree to that statement.

Otherwise the game experience is depends on the hardware.
Is it possible to do Optimization last once the entire game is completed rather than during its production?

This is a method to try to keep the other frame rates constant. Unfortunately this helps on expensive rendering only (as it is skipped). Lags caused by physics, logic and animation will still be present.

Overall you have the limit of 1s/60 all the time. You need to design your game that it never drops below that limit.

General advice: the less to do the less time is required on processing

less faces -> less render, less physics
less objects -> less render, less physics, less logic
less sensors -> less logic
less code -> less logic
less bones -> less animation
less materials -> less render

Ayt man i will give it a shot and hopefully i’ll give feedback on the results.
Infact let me reconstruct the entire scene again.

And are LOD Enhancements with relation to textures applicable as a way of keeping the Render frame rate within that limit?

and i also noticed a few things as i was making my demo for Speed Racer i noticed that every time the game started (well
the scene) the Screen went completely white and it took like 1 to 3 minutes to load the entire scene this is what led to the
massive framerate drop. which was Bad for the overall demo. I also noticed that the framerate would pick up and get to 60
in certain parts of the map where there was not much detail and i felt that this is actually good for the player.

Now i feel like i need to dig deeper in to the game’s Map and scout and see whats leading to the massive frame rate drops
Loading is also slow.

Is they a way perhaps i could load all the open world assets/Objects during a loading screen without the
game acting like its not responding for a few mins before the scene actually starts? (it shows a white screen before the scene is shown)

I will take your words into consideration

Reducing something comes with a reduction of details. So you need to find a balance between details and performance.

Fred/K.S