cant understand why the fps is slow

hi, imake a very simple game with a car and a liitle bit of other stuff, the probelm is that somtimes the fps is getting low and the game is very lagy, i read abput it on google and read all the tut of how to reduce the lags but its stil not work.
why its happen? and how the hell i can play far cry on my computer and its work all fine but when i try to play a little game that i made with BGE its have alot of lag???

I think you’ve gotta send us a pic of the framerate and profile.

the bge is very inefficient at some things, like the way it creates the visuals, the mouse over actuator, etc.

we might need need the game to really figure it out. you could replace all the meshes with basic cubes to reduce the file size.

Yep, lets see a profile pic.

  • OK, I do not believe you that BGE is slowing down. If you use shaders that are not very high quality, then there will be low performance. And so - the resources of the engine have not been uncovered by anyone.

There can be many causes.

They can easily be introduced by “naive” implementations such as using height detailed meshes, inefficient physics models or simply to many objects.

According to the above description

Your game might be not that little as you think it is.

To investigate turn on game/Show Frame Rate and Profile before starting the game. Check when the frame rate is below 60 and what component eats the most time. This is where you can focus on to improve performance.

  • in general, in the professional offices, there is a whole specialty - game optimizers. And the salary in such people is good.
uniform sampler2D bgl_RenderedTexture;

const float BRIGHT_PASS_THRESHOLD = 0.5;
const float BRIGHT_PASS_OFFSET = 0.5;

#define blurclamp 0.002 
#define bias 0.01

#define KERNEL_SIZE  3.0

vec2 texcoord = vec2(gl_TexCoord[0]).st;

vec4 bright(vec2 coo)
    vec4 color = texture2D(bgl_RenderedTexture, coo);
    color = max(color - BRIGHT_PASS_THRESHOLD, 0.0);
    return color / (color + BRIGHT_PASS_OFFSET);    

void main(void)
    vec2 blur = vec2(clamp( bias, -blurclamp, blurclamp ));
    vec4 col = vec4( 0, 0, 0, 0 );
    for ( float x = -KERNEL_SIZE + 1.0; x < KERNEL_SIZE; x += 1.0 )
    for ( float y = -KERNEL_SIZE + 1.0; y < KERNEL_SIZE; y += 1.0 )
         col += bright( texcoord + vec2( blur.x * x, blur.y * y ) );
    gl_FragColor = col + texture2D(bgl_RenderedTexture, texcoord);

  • an example of a simple shader, but a heavy system of resources.I do not know the language of shaders, but probably somebody can make it so that the shader only acts on one of the materials written in it, and not to scan (process) everything.

p.s. shader from Martins Upitis

There is no need to talk about shaders when there is no information that shaders are used at all.

  • no problem, man.
  • the discussion stopped, as if it were not the point.

Still waiting for the pic!

OP seems like the kind of person to post something then forget that they posted it and can’t understand why nobody helped them.

the game is a car game with a very simple car and very simple road with no texture at all, the slow fps happen Usually when i turn the car (the camera is from in the car) and then the fps go down to about 20 fps for a minute and then come back to 60, i also try to use the camera clipping and low it value but stil not work…
here a simple picture of the game:

and her from the gameplay:

i use the CarSetup for the scripting

your physics is really high

I found this thread some while ago, because i had performance problems too and it helped my a lot

Yup, the physics is really high. It’s very likely you have permanantly intersecting objects - which is a big performance drain. Try setting objects to No Collision unless they need physics.
Also try enabling the physics visualization (menu bar at the top. Game -> Show physics visualization) and then start the game.

also try having objects the static objects the player collides with collide with the player but not eafh other using collison masking layers

ok, i enabled physics visualization and now i see that when the game is start there is a ball that come from the car, what is it and why its come? it download the code from here:

and i serach the code and i wasnt see what cuse that, here a pic:

theres your problem. the hi poly car is using physics. thats a big no-no. you need a simple box that runs physics, then disable collision for the visual car mesh. then have the car as a child of the box. code should run on the simple box as well.

Yeah, wow…it’s a common mistake if you are just starting out…you will also suffer some performance having two different editors open…unreal and blender.