This might seem confusing, but I have an issue relating with my FPS affecting my logic bricks. When I play on wireframe, everything works smoothly as I am capped at 60 fps with no lag. When I play in textured, I am stuck around 20 fps and some logic simply doesn't work. I know I'll receive replies asking for whats going on with my logic and what is my logic anyways. It is not one thing, it is rather many. Any object that has logic could potentially work incorrectly or malfunction. It doesn't seem that there is any way around this. How can I fix this issue? Any suggestion will be greatly appreciated, thanks!

  • 2
    $\begingroup$ Well we really can do nothing without some information. What logic doesn't work? In what way does it fail? What does work? $\endgroup$ – gandalf3 Oct 14 '15 at 0:58
  • $\begingroup$ Obviously you created a scene that takes too long to render (20fps). The BGE tries to get the set 60fps for logic, by skipping the render step if the time is running out. To avoid a frozen screen, this will only happen for 5 consecutive frames, after that a render gets forced. This will create a logic lag - but the logic will still work. What might happen is that the timing does not work. This can have some effects on physics. -- The solution - reduce the render time. You need to do that anyway. $\endgroup$ – Monster Oct 14 '15 at 4:05
  • 1
    $\begingroup$ @Monster But that is not really a solution. Of course 20fps is bad, but no game developer guarantee that the user will never have spikes of lag. A computer lag might even not be caused by the game itself. I mean: your game perfectly optimised game should not break even if the user's antivirus starts running on the background, completely lagging the entire computer. If this problem is ultimately unsolvable, then BGE is not a game engine to be considered for real applications. $\endgroup$ – caulitomaz Oct 14 '15 at 15:01
  • $\begingroup$ @caulitomaz "then BGE is not a game engine to be considered for real applications," that saddens me a lot after all my thousands of hours of investment into the game engine. It was said, I think, in a meeting, that the game-engine would be getting useful updates and work done with it after some things are achieved (outside the engine). Maybe this would be fixed then if that happens, but do you think we could submit a bug report? It doesn't seem as a bug, but rather improper construction of the engine. $\endgroup$ – blackhole Oct 14 '15 at 18:05
  • $\begingroup$ @blackhole This is possibly a known issue, and quite possibly fixable one. I'm not here to bring doomsday news, I've never developed for BGE. Take a look at this report: developer.blender.org/T43909 . Try changing the parameter Logic Steps In World->Physics->Logic Steps ( blender.org/manual/_images/BGE_World.jpg ) $\endgroup$ – caulitomaz Oct 14 '15 at 20:14

This is possibly related to the issue of Delta Time issues. I am not familiar with Blender as a game-engine, but this is a common issue in game programming.

For those not familiar with the issue: The amount of movement the engine needs to make between frames depends not only on the mathematical/physics calculations, but needs to consider the time (in real life) it takes between two frames, ans use it as factor in any transformation (translation, rotation, scaling) to mitigate lags. This factor is known commonly as deltaTime.

It seems like blender game-engine doesn't have a built-in deltaTime factor you can use, but this post seems to suggest you could easily create it.

Blender seems to be even more peculiar on the issue, by trying to use a fixed frame-rate of 60fps to calculate physics, and that decision is most likely affecting you. I suggest you read this post by SolarLune and try out his and MrPutuLips's solutions.

  • $\begingroup$ Looks great! Thanks. I will take a better look at the links when I can though. $\endgroup$ – blackhole Oct 14 '15 at 3:29

Not the answer you're looking for? Browse other questions tagged or ask your own question.