Bug Game Engine Runtime
Open, ConfirmedPublic

Description

System Information
Windows 7 64bit
Nvidia GTX660Ti and GTX780

Blender Version
Broken: tested with Blender 2.67 and 2.70 beta
Worked: (optional): none

Short description of error
Once a level has been created into blender, I generate the independent .exe file with the addon "Game Engine Runtime": File > Export > Save As Game Engine Runtime >
When I launch the generated exe file, an important lag (slowing down) occurs when I move the mouse (from right to left and up and down) during the first minutes (on the complete scene) or the first seconds (on the attached scene). The framerate is not impacted: this is just the mouse, I think...
This slowing down does not exist when I play the scene directly in the BGE into Blender windows...So, I think that this is the runtime which is bugged...

Exact steps for others to reproduce the error
Open the blend file attached, and activate the Game addon.
Then, File > Export > Save As Game Engine Runtime > toto.exe
Copy and paste the 2 attached folders in the same folder as the .exe one
Launch the exe file, and see the lag during the first 5 seconds...

Thanks in advance

Details

Type
Bug

Testing in Linux 64bits, current master.

I do not have a mouse slow down neither in the embedded player, standalone player (starting standalone from within blender) or bundled player (saving as executable).
However, I did have a 3-4 second waiting before everything loaded the very first time I started the bundled player.
I am not sure this is playing like it was intended to, I see a lot of textures in the blend file, that were not included in the zip. (I just see everything black with a spotlight).
If there are a lot of textures and sound being loaded, the waiting is normal and will be worst in less capable computers, I suggest a loading screen :-)

tl;dr - embedded, standalone and bundled is behaving the same for me. I do not have a mouse slowdown, however, the bundled player is taking some seconds to load (and I have no mouse until the window is displaying).

The blenderplayer has to load textures from disk, but the embedded player can reuse textures that Blender has already loaded.

Thank you all for your comments. The loading of textures could be a good explanation for the slowing down. The original scene is more complex, with many textures, and take several minutes to make the slowing down disappear (instead of some seconds with the attached scene).
However, the PC I use is really powerful, and the textures used are dds files (which are really efficient for the loading). I have 39 Mo of DDS textures to load the complete scene...which is really correct.

Brita, you say:
I am not sure this is playing like it was intended to, I see a lot of textures in the blend file, that were not included in the zip. (I just see everything black with a spotlight).
If this is black, it means that you didn't copy the textures file in the .exe folder. Maybe the result will be different with the textures ?

Hi everybody,

Some news from this "bug":
I know now, how to reproduce it: in fact, this bug occurs only with NVidia cards. Not on ATI ones. This bug is not link to the python script, becaue I tested many scripts which control the mouse rotation (in a FPS).

Here is the python script which controls a "Cube" (the character, in fact), which is the parent of an empty Plain Axes (called "cameraTarget"), itself the Parent of the Camera:
This script allows to control the camera rotation with the mouse.
In fact, an equivalent script (but more complex !), developped by Riyuzakisan has the same issue, and this is really easy to test it:
download the .blend file (included in the zip file) at the following adress:
http://riyuzakisan.weebly.com/mousemove-script.html

Generate the exe file, and you will see, after some seconds, an awful slowing down during the mouse rotation...on Nvidia cards !

So, with that bug, impossible to do a FPS with the BGE..:-(

Any idea ?

Thanks in advance

Rémi


import bge
from bge import render
g=bge.logic
scene = g.getCurrentScene()

co = bge.logic.getCurrentController()

#sensor
mouse = co.sensors["mousesensor"]

#objects
Cube= scene.objects["Cube"]
cameraTarget= scene.objects["cameraTarget"]

mouse movement

movSpeed = 0.3
rotSpeed = (0.005, 0.005)

mouse look

x = int((render.getWindowWidth() / 2 - mouse.position[0]))
y = -int((render.getWindowHeight() / 2 - mouse.position[1]))

Cube.applyRotation((0 , 0, int(x) * rotSpeed[0]), False)
cameraTarget.applyRotation((0, int(y) * rotSpeed[1], 0), True)

render.setMousePosition(int(render.getWindowWidth() / 2), int(render.getWindowHeight() / 2))

I'm not sure what I'm looking at with the attached blendfile. If I try to run it, it is just mostly black. I tried adding a hemi, and it looked like the player just falls through the level. There are also some Python errors in the console.

Hi Moguri,

Instead of using my scene (with potential issues with textures), prefers the following blend file:
http://riyuzakisan.weebly.com/mousemove-script.html

and as I previously said, generate the exe file, and you will see, after some seconds, an awful slowing down during the mouse rotation...on Nvidia cards !...

apparently, as son as you try a FPS on the BGE, on a standalone exe, you have this issue. BUT, if you stay in the Blender window, you don't have the issue...

Mitchell Stokes (moguri) triaged this task as Confirmed priority.May 9 2014, 2:26 AM

Okay, I can confirm the issue with the file from that site. I'm attaching the file here as well (License: CC-BY 3.0, Author: Riyuzakisan).

I'm not seeing the issue on Linux, so it seems like an issue with Ghost on Windows.

Hmm... strange, I can no longer reproduce it on Windows. I wonder if something was just hogging resources when I was testing last time?

Graphics: NVIDIA GeForce GT 425M
Windows OS: Windows 7 64bit
Linux OS: Arch Linux 64bit

Hello Moguri,

I do not know for Linux. For Windows, I saw your configuration which is pretty close from mine: I have a NVidia mobility card (GTX 670M), windows 7 64bit.
I could say that the slowing down is not systematic. Sometimes it occurs, sometimes, it does not occur (less frequent)...
Restart the PC, and relaunch...I didn't achieve to find the root causes, except that:

  • it is linked to the NVidia cards, mobility or not , (observed on a GTX 670 M, NVidia 660Ti, NVidia 780GTX) and the slowing down ocurs, but not systematically
  • it is not linked to the ATI cards ((I have tested my video game a large number of times on my ATI card, and the slowing down never occured)
  • that was tested on Windows 7 64bit

thanks

No issues here on Arch Linux 64-bit with Intel HD4000 or GeForce 610M.

No issue here either.
Windows 7 64bits, i7-3770, 16GB RAM, Nvidia Quadro 2000

When I run the above file I don't get any problem, but I have had a lot of issues with mouse position in the stand alone player at high resolutions.
The problem occurs when setting the position using bge.logic.mouse.position

It causes a skipping or locking of the mouse position.

I found it can be avoided by using:

mouse_position = bge.logic.mouse.position

if mouse_position != bge.logic.mouse.position:
    bge.logic.mouse.position = (0.5, 0.5)

However I don't know why this is so.

...

I found it can be avoided by using:

mouse_position = bge.logic.mouse.position

if mouse_position != bge.logic.mouse.position:
    bge.logic.mouse.position = (0.5, 0.5)

However I don't know why this is so.

Thanks i had this problem too. Fixed.