1 (edited by JonastheRoman 2015-06-25 16:27:49)

Topic: V-Sync not working?

Hello everyone,

I wanted to reduce the CPU usage of Teeworlds and therefore activated v-sync. However Teeworlds still made my laptop stew.

Now I finally used fps counters (Fraps and Steam), and they both show 120-600 fps most of the time, which is way too much and unnecessary stress for my pc.
What could be the reason for v-sync apparently not working?

Are there any known incompatibilities?
My system: Win 7 64 bit, AMD HD6770M (AMD PowerPlay with an Intel HD4000), Intel i7-2670QM

Thanks in advance! smile

Loving TW since 2010 smile

2

Re: V-Sync not working?

I think

cl_cpu_throttle 1

could fix this. I don't remember what it does so just test it out.

Not Luck, Just Magic.

3

Re: V-Sync not working?

I don't have any answer to your question, but with Nvidia graphic cards you can enable vsync manually through the system control for single executables, I just tried it and it seems to work with teeworlds aswell, without enabling vsync ingame.
Maybe there is an option like that for AMD aswell?

burn the land and boil the sea, you can't take the sky from me.

4

Re: V-Sync not working?

Thanks for the answers!

Dune wrote:

I think

cl_cpu_throttle 1

could fix this. I don't remember what it does so just test it out.

Just compared the fps. Enabling it reduced it from ~600 to ~500, so that's something! Thank you. smile
Still not a real solution, unfortunately.

wappsify wrote:

I don't have any answer to your question, but with Nvidia graphic cards you can enable vsync manually through the system control for single executables, I just tried it and it seems to work with teeworlds aswell, without enabling vsync ingame.
Maybe there is an option like that for AMD aswell?

AMD has an option for that, but it doesn't seems to have an effect whatsoever...

--

Does V-Sync work for you guys?

Loving TW since 2010 smile

5

Re: V-Sync not working?

It seems to be broken, it doesn't work for me either.

6

Re: V-Sync not working?

Thanks for the information, at least I am not alone! smile

Loving TW since 2010 smile

7

Re: V-Sync not working?

"cl_cpu_throttle 20" (or some number that's higher) is what you're looking for. it's not a binary value, but a percentage. and i've never heard of vsync reducing cpu load though, it just tries to make it not tear when there's lots of movement on the screen by lowering the fps to the Hz of the display (e.g. my desktop+vsync=60, my tablet+vsync=130)

Clan: Riot (I'm one of three leaders: Mile, Deku, pie)
Host teeworlds maps on a fng/ctf/dm/ddrace server for testing:http://riotproductions.tk/teewo/ broken-need reinstall nginx http://riotproductions.tk/bounce?whatEven, Teeworlds NA Discord chat

8

Re: V-Sync not working?

Well, I thought that lowering the fps to 60 would reduce the load on the cpu.
And v-sync still doesn't seem to work, at least I get way more than 60 fps.

But your setting really does the trick, thank you, pielover! smile
Now I just have to find the right percentage... Problem is, this setting gives me tearing, although I have around 60 fps sad

The best solution so far was for me to use a Windows power saving mode to limit my cpu to like 30%. But this in turn is kinda inconvenient to enable every time.

Loving TW since 2010 smile

9

Re: V-Sync not working?

pielover88888 wrote:

"cl_cpu_throttle 20" (or some number that's higher) is what you're looking for. it's not a binary value, but a percentage. and i've never heard of vsync reducing cpu load though, it just tries to make it not tear when there's lots of movement on the screen by lowering the fps to the Hz of the display (e.g. my desktop+vsync=60, my tablet+vsync=130)


CPU Throttle is not a percentage but a time in ms. The client will sleep this amount of milliseconds.

engine/client/client.cpp in CClient::Run

...
// beNice
if(g_Config.m_ClCpuThrottle)
    thread_sleep(g_Config.m_ClCpuThrottle);
else if(g_Config.m_DbgStress || !m_pGraphics->WindowActive())
    thread_sleep(5);
...

It's just a sleep period to minimize CPU load. Also, due to there is no rendering while sleeping, the FPS drops, too.

Just try a few numbers and see how its the best for you(too large pauses will cause the game to lagg, also you ping will go up.)

VSync doesn't work for me either, its about 80~130 FPS of 200+ FPS without vsync.

King regards,
FuroS

"Panos."
               -FuroS

10

Re: V-Sync not working?

Thanks for the clarification! The problem is if I want to reduce my cpu load significantly via this setting, the game gets really unresponsive (connection lags, tearing). If I set it to a low value like 5 or 10, I am at least able to reduce the load by a little bit without getting those lags.

As everyone here has problems with V-Sync, it really seems to be broken (on some configurations at least).

Loving TW since 2010 smile

11

Re: V-Sync not working?

VSync mostly just depends on the driver (and bit on the OS). OpenGL just allows to wait for v-blanks or not.
Anyway you can try playing around with the values of `gfx_finish`, `gfx_threaded` and `gfx_asyncrender`.
I would recommend you setting them to 1, 0, 0.
Maybe this helps as there is currently no kind frame limiter implemented except manually setting the sleep time per frame via the `cl_cpu_throttle` command mentioned above

12 (edited by HeroiAmarelo 2015-12-30 00:28:18)

Re: V-Sync not working?

I had the same issue and forcing v-sync from the control painel from NVidea solved the issue.

Playing Teeworlds since 2011!
"I will always be topless for you"
                  - Günther Branlutte

13

Re: V-Sync not working?

Thanks for the reply. smile
I just tried the same in the Catalyst Center and it worked, though it made Teeworlds stutter very much.
But maybe this advice might help other people with different configurations.

Loving TW since 2010 smile

14 (edited by jwonder300 2017-10-18 22:30:58)

Re: V-Sync not working?

JonastheRoman wrote:

Thanks for the reply. smile
I just tried the same in the Catalyst Center and it worked, though it made Teeworlds stutter very much. I believe it was some kind of an accident, like when you fall and get injured and it talked about it before and people had a positive reaction to it. If they wanted to continue, they would have asked here instead of asking for information. You also have people here who will do the same. See below for more information.
But maybe this advice might help other people with different configurations.

Worked for me too and also the little stutter. smile but I take this over no v-sync anytime.  Still, is there another way or similar solution to this without the sideeffect?  I'll do some tweaking myself so I will post if I have a fix for it.  Thanks guys.

15

Re: V-Sync not working?

If you just want to reduce the load on the CPU in general you could try what's been suggested earlier in this thread:
Open your settings.cfg (for Windows it is located in %appdata%/Teeworlds/) and put in the line

cl_cpu_throttle 5

, if it is not already there.
It defines a time in miliseconds for the game to "sleep", and so can be used to reduce CPU-load on faster computers. For me setting it to 5 is adequate, but most likely you'd have to try out some values yourself.

Loving TW since 2010 smile