Best bit depth?

BlitzMax Forums/BlitzMax Programming/Best bit depth?

Grey Alien(Posted 2006) [#1]
Is it fair to say that all modern cards should handle 32-bit 800x600 no problems? I would have thought so. But I do remember the time 24bit was the normal desktop bit depth, and before that 16 bit.

However, is it worth trying to set 32 bits, and then calling GraphicsDepth() to see if it fails, then trying 24bit and failling that 16 bit, then after that producing an error?

What do other people prefer to do, esp. those who made games for a wide audience?

Thanks in advance.


Dreamora(Posted 2006) [#2]
Drop the 24bit idea. NVIDIA and ATI don't support it anymore since quite some time.

I would go for 32bit (NV and ATI work internally on 32bit anyway and downscale the output to 16bit) and fallback to 16 if needed. IE: Use graphicsdepth 0 which does exactly that :-)


popcade(Posted 2006) [#3]
Some game offers an external Applet like Config.exe, or bind in your game, users can switch back and forward.

I don't know if you can enum it before switching(It can be done in Windows via WinAPI, but don't know if there're similar things on other platform).

Or even simply get the desktop bit depth and use it?


Grey Alien(Posted 2006) [#4]
thanks for the info

IE: Use graphicsdepth 0 which does exactly that :-)
well that makes it windowed mode on mine. I want full-screen 32 bit or full-screen 16 bit or windowed mode at whatever depth the desktop is.


xlsior(Posted 2006) [#5]
check out getgraphicsmode

It will tell you exactly which display modes are supported by the computer in question. No need to guess 16, 24 or 32 bit, when you can find out from the graphics adapter if it even supports those.

Another potential problem when you 'assume' that 800x600 will work, is that nowadays there are more and more systems with a widescreen display, especially laptops, that no longer support the 640x480 or 800x600 screenmodes, so those aren't always a safe fall-back resolution either.

You can then just look down the list of available options, and pick whichever which one would work best with your game. If you can't find anything suitable for full-screen mode, you can always fall back to windowed mode at that point.

(One caveat: When it comes to refresh rate, keep in mind that it's possible for a graphics adapter to support a refreshrate in a certain resolution that may not be supported by the monitor in question... so try to play if safe if you pick a refreshrate.)

Here's a sample:

' enumerate all available resolutions:

For x=0 To CountGraphicsModes()-1
	GetGraphicsMode(x,wid,hei,dep,her)
	Print x+" Width: "+wid+" Height: "+hei+" Depth: "+dep+" Hertz: "+her
Next


Now, as far as whether it's best to pick 16 bit or 32 bit: most of the time 32 bit will look better, but you also need more video memory. I suggest you take a look at the highest supported resolution: if you see something low like 1024x768 as the maximum resolution, then the video card probably isn't very high end, and likely won't have a lot of memory to work with... you may want to consider defaulting to 16 bit at that point, so you save some meory you can use to store your images in. If you higher resolutions as well, you could pick the 32 bit version. Of course, after successfully launching the application, you can always make it customizable in your game options.


Grey Alien(Posted 2006) [#6]
This is great information and advice thanks. I was going to aim for 60Hz refresh, but if that fails, or if 800x600 fails, it will default to windowed mode. It won't affect the gameplay as I'll be using fixed rate logic.

I will stick to only one res so all the graphics can be designed around it and still look good, I don't want to scale everything and let the user choose different res. This is a casual game for a casual non-tech audience not a FPS for 3D gamers so it doesn't need it. Most of the portal games don't have a screen res option.


xlsior(Posted 2006) [#7]
This is great information and advice thanks. I was going to aim for 60Hz refresh, but if that fails, or if 800x600 fails, it will default to windowed mode. It won't affect the gameplay as I'll be using fixed rate logic.


You may want to consider picking a slightly higher refreshrate (75 Hz, or something) if it's listed among the supported resolutions. Most of the time it will look significantly easier on the eyes than the 60Hz does.


Grey Alien(Posted 2006) [#8]
good idea, i'll see if I have time to do the whole checking all modes and picking the best one thing as opposed to just trying 32 bit 800x600 60Hz, nah failed, 16 bit 800x600 60Hz, nah failed, OK do windowed mode.


ozak(Posted 2006) [#9]
Many TFT screens can only run at 60hz remember :)


Robert Cummings(Posted 2006) [#10]
Blitzmax will default to 60 if the desired refresh isn't supported.


FlameDuck(Posted 2006) [#11]
What do other people prefer to do, esp. those who made games for a wide audience?
I setup my game to default to the same resolution/bitdepth as the users desktop. That or request they pick a resolution at startup.


Grey Alien(Posted 2006) [#12]
ok thanks FD, so you've employed scaling on all graphics. Does this slow down the game at all or do most graphics cards handle this without any penalty?


Qube(Posted 2006) [#13]
For the fastest resolution for 99.9% of older machines.
640x480 @ 16bit still performs very well.

Overall, 16bit and 32bit colour depth will be supported just fine. 24bit is pretty much gone these days as far as accelerated support. Old 3DFX users (pre voodoo 4) dont have accelerated support above 16bit. Not sure if thats an issue these days but I guess it depends on your target audience (why loose a potential sale or two as an independant?. Every sale counts).

Personally I'd stick to 640x480 @ 16bit / 60hz as a default and work up via that from an in game menu. That way you're pretty much guaranteed to work fine for the range of old to new machines.


xlsior(Posted 2006) [#14]
Overall, 16bit and 32bit colour depth will be supported just fine. 24bit is pretty much gone these days as far as accelerated support. Old 3DFX users (pre voodoo 4) dont have accelerated support above 16bit. Not sure if thats an issue these days but I guess it depends on your target audience (why loose a potential sale or two as an independant?. Every sale counts).


Of course, 32 bit mode looks a lot better than 16 bit (no banding) on many systems, so forcing 16 bit may just as easily make you lose those sale or two becuase the game is less 'pretty'.

Best practise is to query the display driver and find out for sure whether or not 32 bit is listed as a supported mode.


Qube(Posted 2006) [#15]
Best practise is to query the display driver and find out for sure whether or not 32 bit is listed as a supported mode.

Does querying the display driver 100% guarantee that only the supported accelerated modes are shown?

Granted 32bit mode works on modern machines no problems. But going on the games Grey Alien is producing I suspect that quite a few target audience PC's will not be quite as modern as the FPS freaks have.


xlsior(Posted 2006) [#16]
Granted 32bit mode works on modern machines no problems. But going on the games Grey Alien is producing I suspect that quite a few target audience PC's will not be quite as modern as the FPS freaks have.



therefore, like I mentioned above:

I suggest you take a look at the highest supported resolution: if you see something low like 1024x768 as the maximum resolution, then the video card probably isn't very high end, and likely won't have a lot of memory to work with... you may want to consider defaulting to 16 bit at that point, so you save some meory you can use to store your images in. If you higher resolutions as well, you could pick the 32 bit version. Of course, after successfully launching the application, you can always make it customizable in your game options.



Qube(Posted 2006) [#17]
Yeah, but if its a slow ass video card which supports higher resolutions and 32bit depth, for example a Savage 4, then profiling for what the card is capable and applying 1024x768 @32bit just because the card can do higher may result in a slow clunky game.

Personally I'd have 640x480 16bit as default with options to change inside the game. If the games were 3D beasts aimed at high end rigs then of course that low end resolution becomes a null point.


FlameDuck(Posted 2006) [#18]
Does this slow down the game at all or do most graphics cards handle this without any penalty?
Not in my experience, but it hasn't been tested on anything worse than GeForce2Go and Intel Grantsdale (IIRC) chipsets.

Also they don't always scale. In some cases it will simply show more of the map. It depends on what type of game it is.


Grey Alien(Posted 2006) [#19]
FD: ok, I see. thanks.