OpenRA / OpenRA

Open Source real-time strategy game engine for early Westwood games such as Command & Conquer: Red Alert written in C# using SDL and OpenGL. Runs on Windows, Linux, *BSD and Mac OS X.
https://www.openra.net
GNU General Public License v3.0
14.79k stars 2.69k forks source link

Cap framerate by default to prevent possible GPU damage #20557

Open matjaeck opened 1 year ago

matjaeck commented 1 year ago

Motivation

Graphics cards and fans can fail over time if a static or low-detail scene is rendered at an uncapped rate. See https://web.archive.org/web/20170903085237/http://www.dailytech.com/Hot+Starcraft+II+is+Frying+Graphics+Cards+Blizzard+Issues+Temporary+Fix/article19224.htm and https://games.slashdot.org/story/10/08/02/1251203/is-starcraft-ii-killing-graphics-cards. Although it is not primarily the application's job to prevent the hardware from overheating and breaking fans, the application should use the available resources wisely and not just push the limits.

Proposed solution

Mailaender commented 1 year ago

We already do. The static limiter was just replaced with VSync in https://github.com/OpenRA/OpenRA/pull/17439.

PunkPun commented 1 year ago

No, we don't do this. We don't automatically reduce framerate nor we let it be set lower than 25

Mailaender commented 1 year ago

https://github.com/OpenRA/OpenRA/blob/b619dd14c56767425aabf9f3101ba1f8d0c551e1/OpenRA.Game/Settings.cs#L176-L177

penev92 commented 1 year ago

By the way... while @Mailaender is correct and we do have VSync on by default (which is a bit weird but okay...), if we look closely at the original post, it requests/suggests 2 things, both pretty reasonable (especially as a bonus to VSync being on by default), neither of which we do currently.

pchote commented 1 year ago

Also note that VSync doesn't work everywhere.

Mailaender commented 1 year ago

So the plan is to revert fe13196f028cc0ecde4799b431537c2fa116a043 then?

penev92 commented 1 year ago

No, the plan would be to:

  1. Add serious frame limiting to static screens (drop it to 1? to 10?) regardless of user settings because it makes little sense to draw static screens at 240FPS.
  2. Add an implicit limit at say 240 or 360 FPS. Currently disabling all limiters can result in FPS reaching 1000 (on my machine), which can't be good for the hardware and is not something that brings any value. Just in case we can have an advanced option to explicitly disable that for the 1-2 people that might want to run an experiment.
Mailaender commented 1 year ago

I can confirm that VSync is not reliable: https://github.com/OpenRA/OpenRA/issues/20681