Vertical Sync should be permanent Disable.

Post here if you want to help developing something for FAF.

Vertical Sync should be permanent Disable.

Postby Destructor » 29 Dec 2018, 04:48

Sorry by my english, but i'm trully sad about this.
Everytime that game are slow on team games, they usually blame brazilians, but is not our fault!

Some dumbases players dont know that FA runs with a single core (main time), and some people have bad graphics card.
Than...
When they use VERTICAL SINC ON, game will RUNs with 60 FPS (Frezze FPS) at all costs.

BUT.... When it's occur in poor computers, specially after 10 minutes on team games, the game will reduce the main velocity for everyone in the game, to make the correct renderization to 60 FPS for some players.
Soooo.... the game will be slow to other players too.

--------------------------------
My suggestions:
1 - Complete disable of Vertical Sync
2 - Show FPS, permanent status when game starts to player.
3 - Show FPS, for other players when u push F11

Thx for that.
WhatsApp +55064992857623
Destructor
I really waiting for logical arguments to nerf ACUs.
User avatar
Destructor
Avatar-of-War
 
Posts: 79
Joined: 25 Jul 2012, 02:25
Location: Brazil
Has liked: 24 times
Been liked: 24 times
FAF User Name: BRS_DESTRUCTOR

Re: Vertical Sync should be permanent Disable.

Postby Uveso » 30 Dec 2018, 06:43

Hello Destructor,

i am sorry, but you are wrong.

If you disable vsync then this function is changing the fps:
https://github.com/FAForever/fa/blob/develop/lua/ui/game/gamemain.lua#L253

Its reading the value from the adapter menu "1920x1080(85)"
Then it's using the "85" to set the frame time clamp.
So if you disable the vsync by default, the fps will increase to 85 if the user has set it.

And i bet most user will set to 1920x1080(100) and will run with 100 FPS because it's cool ^^

Maybe it's not a good idea to disable vsync ;)

If you want to reduce the FPS to lets say 30, then you need a mod and execute these 2 lines:
Code: Select all
local fps = 30
ConExecute("SC_FrameTimeClamp " .. (1000 / fps))

You can also write this as console command:
Code: Select all
SC_FrameTimeClamp 33.33

Greetings, Uveso.
User avatar
Uveso
Supreme Commander
 
Posts: 1788
Joined: 11 Dec 2015, 20:56
Location: Germany
Has liked: 70 times
Been liked: 291 times
FAF User Name: Uveso

Re: Vertical Sync should be permanent Disable.

Postby Destructor » 01 Jan 2019, 22:26

No... I'm not wrong about this.

With no VSinc enablead, FPS can FLOW 0 - 100 FPS. This thing willl fix some game issues to slow computers!!
I really waiting for logical arguments to nerf ACUs.
User avatar
Destructor
Avatar-of-War
 
Posts: 79
Joined: 25 Jul 2012, 02:25
Location: Brazil
Has liked: 24 times
Been liked: 24 times
FAF User Name: BRS_DESTRUCTOR

Re: Vertical Sync should be permanent Disable.

Postby Uveso » 02 Jan 2019, 00:58

Also with vsync disabled the FPS can't flow between 0 and 100.

This is all handled by the same function:
https://github.com/FAForever/fa/blob/develop/lua/ui/game/gamemain.lua#L253

This is the function:
Code: Select all
function AdjustFrameRate()
    if options.vsync == 1 then return end
    local video = options.video
    local fps = 100
    if type(options.primary_adapter) == 'string' then
        local data = utils.StringSplit(options.primary_adapter, ',')
        local hz = tonumber(data[3])
        if hz then
            fps = math.max(60, hz)
        end
    end
    ConExecute("SC_FrameTimeClamp " .. (1000 / fps))
end


The fist line checks if we have vsync on or off.
If we have vsync on, then we return and don't execute this function.
So this function will only run with vsync off.
Code: Select all
    if options.vsync == 1 then return end

Then we set a defaul value for the FPS in case we don't find a value inside the gameoptions:
Code: Select all
    local fps = 100

This part gets the value for the FPS from the gameoption:
Code: Select all
        local data = utils.StringSplit(options.primary_adapter, ',')
        local hz = tonumber(data[3])

Here we are calculating the minimum FPS for the game.
math.max(60, hz) is using the highest value from 60 or hz.
In this case we set the FPS to the value from the gameoption,
or if hz is lower then 60 we will get 60 as minimum FPS
Code: Select all
            fps = math.max(60, hz)

And the last step, we are setting the waittime between each frame.
If we have 60 FPS then we set as timeclamp 16.66.
That means the game waits 16.7 milliseconds before it will render the next frame.
Code: Select all
    ConExecute("SC_FrameTimeClamp " .. (1000 / fps))


The game only set the FPS between 60 and the value that was set in the video option menu.
That's how the gamecode is handling it.

You can interpret this like you want. ;)
User avatar
Uveso
Supreme Commander
 
Posts: 1788
Joined: 11 Dec 2015, 20:56
Location: Germany
Has liked: 70 times
Been liked: 291 times
FAF User Name: Uveso

Re: Vertical Sync should be permanent Disable.

Postby Destructor » 06 Jan 2019, 22:43

Some people dont use correct congfigs to it.
Soo, Always better fix to all noobs.

My computer for example. With Vsync enablead just set on 60 FPS.
For me is not a problem, my computer is one of fatest, but some players have a trully potato computer
I really waiting for logical arguments to nerf ACUs.
User avatar
Destructor
Avatar-of-War
 
Posts: 79
Joined: 25 Jul 2012, 02:25
Location: Brazil
Has liked: 24 times
Been liked: 24 times
FAF User Name: BRS_DESTRUCTOR

Re: Vertical Sync should be permanent Disable.

Postby Sartek » 08 Feb 2019, 17:21

Doesn't vsync cap the fps to 30 if it can't hit 60 fps? The correct way would be to sleep for a variable amount of time based on how long it took the last frame. and don't sleep at all if the game is struggling to hit 60 fps. Dynamic/adaptive sync disable vsync if you can't hit 60 fps and enable it if you can get 60 fps.
Sartek
 
Posts: 1
Joined: 08 Feb 2019, 17:18
Has liked: 0 time
Been liked: 0 time
FAF User Name: Sartek

Re: Vertical Sync should be permanent Disable.

Postby ozonex » 27 Feb 2019, 13:15

Vsync is not about clamping FPS, its work is to display frame in good moment with synchronization to our display. Its old known thing that if you have less fps than your display refresh rate it will slow down your game.

For example if we have 60hz screen that mean it displays 60fps (each frame every 0.0166ms) . If game is running in 40fps (0.025ms) that means it can't fit the 0.0166ms interval and need to wait for the next one, so frame that calculating took 0.025ms will then wait 0.008ms to display in the next, nearest frame after 0.033ms (2x 0.0166). In that case cpu and gpu were idle for ~24% of calculating time.

For 58fps that idle time will be ~48%
FAF Map Editor Alpha v0.605 > Get it now!
User avatar
ozonex
Priest
 
Posts: 358
Joined: 16 Feb 2012, 20:11
Location: Poland
Has liked: 197 times
Been liked: 263 times
FAF User Name: ozonex


Return to Contributors

Who is online

Users browsing this forum: No registered users and 1 guest