vegastrike / Vega-Strike-Engine-Source

Vega Strike Engine
Other
260 stars 44 forks source link

Detect available screen resolution in fullscreen mode #882

Open evertvorster opened 1 month ago

evertvorster commented 1 month ago

There is a lot of complexity involved in the screen setup, and this may be a hangover from ye olden days.

What is really needed is in the vsettings app is a screen detection routine. It should detect the number of screens and the resolution of those screens.

This assumes that you want to be playing full screen and at the native resolution of the selected screen. This is almost always the case.

However, if you want to be playing in windowed mode, then some common resolutions should be listed.

royfalk commented 1 month ago

This is definitely not the case with modern games. Most games can't run in 4k with a decent framerate.

Vegastrike is an outlier here as it doesn't really use modern GPUs and CPUs properly and so can run in 4k with no problem.

However, I can see us using more resources in a year or two and having to revert this. From a programming standpoint, something like take the native resolution probably isn't a significant effort.

I'd like to see some discussion/polling on this before committing. Maybe on gitter?

evertvorster commented 1 month ago

I beg to differ. My computer can run DOOM in 4K at ultra mode and still gives me 100+ fps. It's a bit of a beast, though. In the future more powerful machines will be made, and they will have no issues to run games in these high resolutions. At least that is my opinion based on the current trajectory of hardware development.

While we are discussing other games, on the first run most games give you a list of resolutions you can pick from, and this is usually picked up from what is available to the system. Once you select that resolution, if it is lower than the native resolution, it scales it to the native resolution of the monitor.

My understanding on how this is achieved is that when the game launches, it first reads the available screen resolutions with SDL. Then it checks to see if the screen resolution that was saved in the previous run of the game is available. If it is, it launches the game.

If the saved resolution is not available, then it picks a resolution from the available list, and uses that. There is some inconsistency between what other games do here. Some pick the closest lower resolution available as compared from the last run, some pick the lowest resolution supported by the game. My opinion, the former is superior. Either way, with the modified resolution it launches the game.

In short, reading the available resolutions from SDL is something that will be useful no matter what is used in the future, and makes the game instantly more accessible.

royfalk commented 1 month ago

OK. See if you can find a reference in SDL as well as a discussion or code snippet to implement this. If you can find it, I'll implement this.

@BenjamenMeyer if Evert can figure out some ref code in SDL, are you OK with dropping the resolution picker and settings? Also for #884. I will keep support for manual resolution and window as it's very useful for developers.

BenjamenMeyer commented 1 month ago

Yes, I'd like to see something in the VS Settings App - there's something minimal in there now; but we should be able to query and select. Same for monitors.