Graphics are very slow on all Windows 7 machines

I made a very “Simple Application”, with that great blue cube, except that I deactivated the flycam and the settings dialog, and then I added keyboard controls to move the cube Up, Down, Left and Right.



On all Linux machines it works perfectly, but on Windows 7 machines I get very slow graphs, seams like 4 FPS on so…

However the FPS info is always showing like 5000 FPS on All machines…



I tried on 4 different Windows 7 machines (3 are 64bit and one is 32bit), and 4 Linux machines (all 64bit)…

All 4 windows 7 machines have that same lag, and all Linux machines run perfectly.

I tried different configs, LWJGL_OPENGL_ANY, LWJGL_OPENGL_OPENGL2 , tried to enable VSync, etc.



I even tested on a Linux virtual machine which is on a Windows 7 Host…

Guess what, the Linux VM was running perfectly smooth while the Windows 7 Host was lagging like hell !



The problem seams to be irrelevant of the computer’s performance and CPU usage, and is the same lag delay for every Win7 computers.

It seams to be a Java window refresh rate problem or something like that…

By the way I can also open 16 times the app on the same Windows 7 machine, and the lag stays the same for each java window.



I looked everywhere on the net, nothing helped, I read that I should use D3D instead of LWJGL… but JMonkey doesnt support it…



Thanks for your help!



Here are my current gameSettings :



AppSettings gameSettings = null;

gameSettings = new AppSettings(false);

gameSettings.setFrequency(60);

gameSettings.setVSync(false);

gameSettings.setBitsPerPixel(24);

gameSettings.setResolution(1280, 720);

gameSettings.setFullscreen(false);

gameSettings.setTitle(“Galaxy4D testing1”);

gameSettings.setUseInput(true);

gameSettings.setSamples(1);

gameSettings.setRenderer(AppSettings.LWJGL_OPENGL_ANY);

gameSettings.setAudioRenderer(AppSettings.LWJGL_OPENAL);

app.settings = gameSettings;

app.setShowSettings(false);

app.setPauseOnLostFocus(false);

Does your windows machines have different graphics hardware?

What performance is if you switch from windowed to full screen?

Sounds like a driver issue to me.

Driver related, had the same issue. Also what kind of hosts are we talking about?

And virtual machines are not something to count on as a test result.



I got windows 7 ultimate on a 2gb ram dual core 2ghz machine with 40 fps frame limiter running the application from eclipse while my processor is already busy with other opened stuff like music on youtube and etc.

http://i.imgur.com/UVfQr.jpg

It sounds to me like this is specific to the test.



A) the reported FPS is still high (so FPS is actually high!)

B) somehow the original poster thinks FPS is low… even though FPS is reported high.



Was it jittery before you disabled the fly cam and changed the movement?



It’s way more likely that you are moving the cube incorrectly based on input and this is somehow slower on windows.

Change your move speed.

Windows also uses the GPU for the UI now, maybe it sees the same performance hit for graphics applications as MacOSX does now.

I’m running on windows 7 and get >3000 fps on simple cube apps.

Maybe try to disable the D3D pipeline:

-Dsun.java2d.d3d=false

-Dsun.java2d.noddraw=true



Check if you use the appropriate driver. Activate the debug. If you see something like this:

OpenGL Vendor=Microsoft Corporation
OpenGL Renderer=GDI Generic


it means that you really need to install the driver provided by your vendor.

Thank you all for your help, I actually didnt think I will get all those replies in less than a day…

I will clarify some other things…

Again, the issue is irrelevant of the computer’s performance and CPU usage. Both CPU and GPU stay at less than 3% used while vSync is on.

I always get the exact same lag on all windows machines, but still showing between 3000 and 6000 FPS.



The four windows 7 computers have different hardware (1 AMD dual cores and 3 quad cores [1 AMD and 2 Intel including a Sandy Bridge] ).

Two have nvidia cards and two have ATIs.



The one with the Linux virtual machine (Using VirtualBox) is the Intel Sandy bridge with an ATI card (actually it is a laptop).

But again, the 64bit Linux virtual Machine runs smoothly while the 64bit Windows 7 Host is lagging…

The other 3 64bit linux systems are all different hardware also.

Tried both windowed and full screen on two of the windows 7 machines, same problem.



The debugging machine is my 64bit Linux on a SandyBridge CPU with ATI HD6990 card.



All other machines use the jar (java -jar MyGame.jar)… On the four windows 7 machines I tried both the .jar and the .exe that JMonkey creates and still get the same problem.



All the drivers was updated during the tests, problem still there).



This is how the game works :

The keyboard movement does not use the TPF.

The Action sets for exemple a variable MoveLeft to True when you press the Left key, and than to False when you release it.

An other Thread which is launched at the beginning of the application, will loop while MoveLeft is true and add 0.1 to a global Vector3F variable which is used in the Update loop to set the object’s position.

(The MoveLeft loop will sleep for 30ms after each loop, to ensure the movement speed stays the same… And the lag is irrelevant of this 30ms… tried 10ms with 0.03 movement for same speed, and the lag still occurs…)

I am doing this like that so I can afterwards replace my new thread with a networking thread so the keyboard inputs will be sent to a server and the server will send the new positions to of the cube to the client.



The original SimpleApplication works fine on Win7 though…



One last thing, if I re-enable the FlyCam, it still lags in the same time than the cube lags, even if the cube does not move. (still while showing like 5000 FPS…)



Thanks again for the help, I hope I gave enough information this time.

If you don’t use tpf the jerkiness/strange time is inherent. Use tpf. Probably the windows machines have vsync disabled which would keep the framerate fairly constant (but still thats no solution).

1 Like

Is that thing available anywhere? I’d like to see that behavior in action myself.

1 Like

But… but… but… you guys… he says the FPS reported is high!!! So the FPS is HIGH.



It’s a movement problem.



Edit: sorry… was responding to earlier posts where no one was reading the original post…

And these are my favorite on the subject:

Source Multiplayer Networking - Valve Developer Community

Latency Compensating Methods in Client/Server In-game Protocol Design and Optimization - Valve Developer Community



They tell you just about everything you need to know about high performance game networking.

1 Like

To the original poster, please post a simple test case.



Also, how are you transferring state between the background thread and the rendering thread? Do you have a dual core machine by any chance?

I can see why you are taking that approach but I really don’t think it would be the recommended one. It’s very inefficient and will scale terribly. It’s also going to be incredibly jerky.



Just think about internet/network latency for a moment and you will see why - the server is physically not going to be able to send 30 updates a second at a constant framerate.



The way to do it is to update the position smoothly in the update thread using tpf - and set a “target” vector using the networking message. Then the positional update moves you towards that target vector smoothly and you update the target at appropriate intervals.



If its a twitch style game (i.e. FPS) then it gets worse and you need to run the world simulation on both client and server and have the server send out updates that the client then uses to correct it’s situation.



There are a bunch of nice articles on this sort of stuff around online, I just found one with a quick google which is good although it’s not the one I was really looking for: http://web.cs.wpi.edu/~claypool/courses/4513-B03/papers/games/bernier.pdf

Thanks pspeed, that first one is the exact one I was looking for. (The second one actually is the same one I linked but packaged differently).

Thank you very much guys!

I was actually going to implement the networking as position intervals with smooth transitions like you said…

I will try some things tonight and maybe make simple test case for you to test.

Thanks

Wow I’ve just found the problem here…

It was the debugging output… I had 3 System.out.println every 30ms …

Somehow it affects the display refresh rate on all windows 7 platforms…



Thanks anyway guys!