lock to v-sync

hi all,

is it possible to lock the geme refresh rate to the v-sync of the grafics adapter??

thx and greetz

chriss

think sync to vbl is what you’re after…

thats cool…

thx and greetz

chriss

So what happens if your frame rate is less than the monitor’s refresh rate?

Each frame it waits for next monitor refresh. So if refresh is at 60Hz, that means each actual frame will be a next multiple of 16.7 milliseconds. If your game would be normally running at stable 20 milliseconds/frame (50Hz), it will run at 33 ms/frame (30Hz).

You see this kind of thing a lot in console games. The framerate will jump from 60 to 30 when things get heavy. Personally, I’ll take that any day, over a bunch of broken up pieces of screen from previous frames.

the problem with it is that you can get very ugly “stuttering game experience” when you have things that only jump in every few seconds and take longer than a frame because the FPS will not decrease slightly, it will start to jump and humans are able to recognize that directly and it feels like non fluent game play even thought both are 30 FPS and higher …

As long as you are not massively below the “Screen FPS” or a multiply, disabling vertical sync is a good thing normally.

I’m sure I’ll learn more about this kind of stuff down the road, but the solution that console game makers seem to take is “make sure it always runs at 60fps”. That’s a lot easier to ensure if you only have one hardware configuration to worry about, however. In the PC realm, you can give people a billion options, like enabling VBL sync, but while the game will look better when properly configured, the options screen will likely be a nightmare in terms of usability for the average user.

It might be best practice to enable or disable this, and several graphical options, automatically. Even the relatively cleanly “Good”, Better, Best" settings are meritless if there is no option to choose from them in a clear A-B comparison. What if your user chooses “Fantastic”, and their computer is really old, and they never bother to try out a less expensive setting because of how poorly the game ran on Fantastic?

As for console games, I have yet to see any options other than On/Off settings for Antialiasing, Progressive Scan, and Widescreen. Accessibility is key. People don’t want to waste an hour or more trying out all the permutations of your graphic options before they can get a nice-looking, playable experience. As Unity developers, I think it is our job to know what the performance possibilities are, and do as much work as possible to stop players from having to fiddle with anything but the actual gameplay.

Agree with that, it would be great if the startup thing could be scripted / modified as well to ensure that only that is offered that can even be used on the given hardware like WoW does it for example (it disables anything in the options for which the GPU isn’t good enough anyway to handle it on a usefull performance).

I used to do that in the past by using a benchmark that ran behind the regular startup logo stuff and collected some performance data.

Sorry to resurrect… a question tho… . is it possible to switch vbl syncing on and off within a script?

Wow, no. The only way to do that would be to have an identical quality setting, and then IncreaseLevel / DecreaseLevel. I’d never want to play a game without it, but you should probably request this feature.

I want Unity Tech to fully expose the quality/input settings. Why aren’t things like vsync and AA exposed through scripting? Did someone forget about these variables? :?

Well actually there are some technical issues. Vertical blank syncing could very well be switchable - we already see that it can be switched on and off… but as for antialiasing it is tied in to the way that the graphics API sets up the graphics buffers which happens when the screen is created by the o/s. To do FSAA/MSAA it has to allocate extra buffer space and extra stuff. Usually you have to close the screen down and open up a new one in order to switch it on or off, which is why it’s usually an option in a menu external from the game.

But vblank sync on/off should be switchable in-app.

Just wanted to add my voice in support of this essential and easily added feature. I also created an entry for it on the Unity Feedback site:

http://feedback.unity3d.com/forums/15792-unity/suggestions/1069149-scripting-access-to-rendering-options-such-as-vs