When GraphicsModes() lies to you....

BlitzMax Forums/BlitzMax Programming/When GraphicsModes() lies to you....

GfK(Posted 2010) [#1]
An issue has cropped up with my game whereby it allows the user to set an unsupported graphics mode.

Graphics modes are made available depending on what the OS says is available. If the monitor driver is left as "Default Monitor", this will show all manner of resolutions which the monitor may not support.

Setting one of these rogue graphics modes still returns True, i.e. I can set my graphics mode to 2048x1536 - the monitor does not support higher than 1024x768 and therefore displays "INPUT SIGNAL OUT OF RANGE" (thats a monitor warning - nothing to do with Blitz or the OS).

Before anybody tells me "use Linux", "Update your drivers, doofus", "your monitor is crap" etc etc, I'd simply like to know if there is any way of checking whether the graphics mode is correctly set or not.

Failing that I'll just have to do it how Windows does it, i.e. "Can you see this text?" and a countdown for 10s, after which it reverts to the last used res.


ziggy(Posted 2010) [#2]
I *think* as long as the card supports the mode, I'm not sure you can control it from the program. It's usually a monitor driver issue most of the times, otherwise the Os "knows" wich display modes are supported.


GfK(Posted 2010) [#3]
Hmm... so a visual prompt after changing the graphics mode may have to be the way then.....


Jesse(Posted 2010) [#4]
evend Windows has that problem so do what it does:
notify the user that it is about to switch mode,
if they accept the mode, notify the user that they need to press a key with in a specified amount of time, if they don't press anything switch back to the original mode.
create a log of valid modes so it won't have to ask everytime they want to switch modes.


GfK(Posted 2010) [#5]
Hmm.... you know, I might just lock it to 800x600 and only allow fullscreen/windowed, since that's what everybody else does anyway.


Dreamora(Posted 2010) [#6]
at least do it in 1024x768 then otherwise you risk that people are pissed because the gameboy screen sized window in front of them is really annoying ;)


xlsior(Posted 2010) [#7]
Keep in mind that some monitors no longer support 800x600 these days, Windows Vista/7 default the OS to 1024x768 as well.


GfK(Posted 2010) [#8]
Keep in mind that some monitors no longer support 800x600 these days, Windows Vista/7 default the OS to 1024x768 as well.
Well, after a long day I've decided to rip out all the res-changing stuff and stick with 800x600. Too many systems are reporting graphics modes that they simply aren't capable of and that's pretty much all I have to go on.

No offence but I have it from an authority bigger than GOD that 800x600 is what people want. I.e. the little people who don't have monitors the size of Westminster Abbey.

If its good enough for the all mighty, its good enough for me.

Thanks all.


xlsior(Posted 2010) [#9]
Hey, you're free to pick whatever resolution you want -- just be aware that 800x600 won't work for *everyone* anymore.

Perhaps you should consider keeping the resolution changing hidden away somewhere, so you have the option of forcing an alternate resolution through a command line parameter or something?
That way you still have a way to 'fix' the game on a computer that otherwise wouldn't be able to run it at all.


Dreamora(Posted 2010) [#10]
People that don't have large screens (ie 1024x768) don't have 3D TnL gpus either so they won't play your game.
So not GOD but Darwin made clear the way ;)


GfK(Posted 2010) [#11]
People that don't have large screens (ie 1024x768) don't have 3D TnL gpus either so they won't play your game.
What?


xlsior(Posted 2010) [#12]
He means that people that NEED 800x600 tend to have a crappy computer, so why pick that resolution out of all of them?


therevills(Posted 2010) [#13]
What?


TnL = Transform and Lighting Graphics Cards...

BlitzMax games require a 3D card to run, didnt you (Gfk) get your game running on an old GeForce 2 or something? Dont worry about it....

Why not offer 1024x768 and 800x600, but name them High and Low? Most graphics cards should be able to those resolutions (apart from some of those netbook things...)


GfK(Posted 2010) [#14]
He means that people that NEED 800x600 tend to have a crappy computer, so why pick that resolution out of all of them?
Because a high percentage of the target audience has "crappy computers", and they've money to spend on games.

Anyway, I think we're barking up separate trees here - I'm not making Doom IV. I do wish it was possible to ask a question here lately without it turning into "This vs That".

[edit] therevills: we've already agreed to stick to 800x600 now and avoid the screen res changing issue completely. I'm offline for a bit in the coming days, so I'm keen to get it wrapped up ASAP. You know how it is.

BlitzMax games require a 3D card to run, didnt you (Gfk) get your game running on an old GeForce 2 or something?
It worked perfectly on a PCI GF2MX. It also ran incredibly well on an old 8MB onboard Trident something-or-other, except it didn't seem to like 512x512 textures. But that was always a big ask anyway. ;)


therevills(Posted 2010) [#15]
Its a shame... I really liked playing your game on my native res (1680 x 1050), you did a great job there as it didnt look blurry...


Dreamora(Posted 2010) [#16]
You don't seem to understand GfK: Nobody denies that they might have money nor does anyone deny that they might only be on 800x600

But you seem to totally forget that BlitzMax is ALWAYS 3D.
Its not like BlitzPlus / Blitz3D where using Graphics instead of Graphics3D made you switch to the 2D mode which ran on such machines.
SiS, pre GMA 900 Intel and alike will not run your game on an acceptable FPS at all, so you hopefully have a hidden object game cause already a match 3 will be too much action for pre-TnL hardware.
We are talking about a decade old hardware and to target them I would definitely recommend to go with Graphics in Blitz3D / BlitzPlus, not trying to go with 3D hardware acceleration which is the only thing available in blitzmax

(PS: Doom 2 and alike would run worlds faster as it used the cpu not graphic card capabilities)

People bound to 800x600 have hardware thats commonly worlds older / weaker than GF2 ... already my notebook had 1600x1200 back in these days soon a decade ago and desktops had 1024x768 when not being TFT or 1280x1024 when being TFT


GfK(Posted 2010) [#17]
SiS, pre GMA 900 Intel and alike will not run your game on an acceptable FPS at all, so you hopefully have a hidden object game cause already a match 3 will be too much action for pre-TnL hardware.
We are talking about a decade old hardware and to target them I would definitely recommend to go with Graphics in Blitz3D / BlitzPlus, not trying to go with 3D hardware acceleration which is the only thing available in blitzmax


It works on this (with 8MB shared VGA) http://www.giga-byte.co.uk/Products/Motherboard/Products_Spec.aspx?ProductID=1440

...so I'd say you're quite wrong to assume BlitzMax won't work on "decade old hardware" - because that's precisely what that is.


Dreamora(Posted 2010) [#18]
Then your game is simple enough which is great :)


Russell(Posted 2010) [#19]
@xlsior: I would be very surprised to find a *monitor* that does not support 800 x 600. True, the newer OSes default to 1024 x 768 or whatever, but the monitor itself will still display 800 x 600 (In fact, even 320 x 240 is no problem).

Probably 99% of all monitor in use today will support the following ancient modes:
- 320 x 240
- 640 x 480
- 800 x 600
- 1024 x 768

With widescreen monitors becoming the 'norm', several wide aspect modes are becoming more common, but not yet standardized (AFAIK):
- 1280 x 720
- 1440 x 900
- 1920 x 1080

Russell


Jesse(Posted 2010) [#20]
my 3 year old HP laptop screen does not suppor anything less 800x600. Any program that I design that sets any smaller mode does not display at all. black screen only.


xlsior(Posted 2010) [#21]
@xlsior: I would be very surprised to find a *monitor* that does not support 800 x 600. True, the newer OSes default to 1024 x 768 or whatever, but the monitor itself will still display 800 x 600 (In fact, even 320 x 240 is no problem).


http://www.blitzmax.com/Community/posts.php?topic=77864#872069


RexRhino(Posted 2010) [#22]
Check out the Max2D command "SetVirtualResolution".

Set the virtual resolution to 1024x768. Then, set the non-virtual resolution to the current desktop resolution (a res that you know for sure the monitor supports!).

After that, you write everything as if it was 1024x768 (or whatever resolution you choose), and Max2D should automatically scale everything to whatever resolution you set.


ziggy(Posted 2010) [#23]
SetViewPort has some issues with the RexRhino suggested "fix" becouse of the rounding/truncation. If you're using it, you better look for another solution.


RexRhino(Posted 2010) [#24]
What issues ziggy? I am not disagreeing with you, or being argumentative, it would be helpful to everyone if you could explain the issues.

I am making a 3D game, so I don't use SetVirtualResolution in any actual programs... but from my quick tests, it seemed to work as expected.


*(Posted 2010) [#25]
TBH I would lock at a fixed resolution, I would lock as you have at 800x600 and as has been said LOADS of people buying coffee break games have simple computers that cant run things like Doom3 but run these fine.


ziggy(Posted 2010) [#26]
What issues ziggy?

Well... SetViewPort can only work with integer numbers, as it does represent real pixels, not virtual ones, but after the matrix conversion, you could be needing a viewport at pixels 13.65, 16.56 or whatever, and this gets truncated or rounded wich in both cases can (and in fact it does) produce artifacts when you need pixel perfect viewport operations.


Russell(Posted 2010) [#27]
True, SetVirtualResolution() has some issues such as the rounding issue(s) and a slightly fuzzy picture (this depends on many factors - Is the virtual display larger or smaller than the actual display?, Are the two modes the same ratio?, etc). But it can come in handy in special situations.

Running at the same res as the desktop is ideal, if you can get your game to fit in it properly: If their desktop is running at 1280 x 1024 (a 5:4 ratio) and your game is, say, 800 x 600 (a 4:3 ratio), then things might not look right (squashed/stretched).

Do some tests with SetVirtualResolution() on different display modes and see how it looks. Maybe it will be acceptable... or maybe not ;)

Russell


Dreamora(Posted 2010) [#28]
In addition it might beat you back cause gpus like the one GfK mentioned are pre TnL, they don't like global scaling ops that much as they have to use cpu for all this stuff


RexRhino(Posted 2010) [#29]
Even if SetVirtualResolution doesn't work, it isn't hard to create your own object that would do the same thing (and safely put black bars on the 4:3 aspect ratio monitors). You simply have to do the math yourself in code, but realistically if you are creating a game to sell, you have the skills.

Develop for 16:9, and do your graphics for 1920x1080. 16:9 fits nicely in 16:10, and 4:3, and black bars look nicer on the top and bottom than on the side (it is a 'letterbox' effect most people are used to!). 1920x1080 graphics will be scaled down on most computers, as most people don't have monitors greater than 1920x1200 to see any blocky upscaling.

It wouldn't even be that crazy to create custom graphics for each of several resolutions/aspect ratios (for an Xbox360 game I was working on, it produced better results to create custom graphics for 480p, 720p, and 1080p displays rather to do any scaling).