Archived

This topic is now archived and is closed to further replies.

Eric

Selecting video mode at run-time

Recommended Posts

I want my game to run at 30-50 fps regardless of a user''s hardware. To do this, I''m going to enumerate the list of available video modes (really just resolutions) during initialization, and then I''d like to immediately pick the one that is most likely to give the user my target framerate (whether it be 320x240, 1600x1200, or whatever). My question is, how can I easily get a benchmark of the user''s system? Originally I planned to pick like 640x480, then run the game for half a sec and use the framerate achieved there to make a best guess (during all that I''d keep the screen solid black). This seems like overkill, though. Can anyone think of a 3D hardware capability or a combination of capabilities that I could use to somewhat accurately predict my framerate? Note: The user will have the option of changing the framerate, too. Most casual players will probably just play the game "as is", though, which is why I want to pick a good mode for them initially.

Share this post


Link to post
Share on other sites
I personally HATE programs that make that kind of (or even more complex) decisions without bothering to ask me what I''d like. Ask the user what he/she would prefer.

Share this post


Link to post
Share on other sites
Hmmm... I am very surprised at your guys' viewpoints on this. Hway, you may have misunderstood me: the user will have the option of changing the video mode; I'm just trying to pick a good default mode.

Witchlord, regarding using 640x480 as the default: you're right, if a user ends up playing the game at 640x480 even when their system is capable of 1600x1200, that's no big loss. But what about the inexperienced player w/ a crappy system that plays the game at 640x480, gets only 20 fps, and, as a result, uninstalls my game after the first play? (Trust me when I say that my game is not fun at low framerates.) I would think that, on low-end systems, switching from 640x480 to 320x240 (or similar) would significantly improve framerate.

Anyway, I would appreciate other opinions on this. Certainly I don't want to bother implementing this if it's not needed. I remember when I first got Quake I, though, it was a month before I discovered the video mode options... luckily, the default (320x240 I think) had been a good choice for my system.

Edited by - Eric on July 24, 2000 6:45:37 AM

Share this post


Link to post
Share on other sites
If you''re that bothered about someone not thinking to change video modes, youy could try this:

Calculate the average frame rate throughout the game, then once they''ve finished (a level, whole session, whatever) determine whether the frame rate was over or under your desired threshold (e.g. 30 fps).

If the performance was below your threshold then bring up a message stating that they might benefit from changing to a lower resolution and state how to do this. In addition you might want to add the option of disabling the warning message as it could become irritating if you prefer higher resolution to higher frame rate.

Damn fine solution if you ask me

Share this post


Link to post
Share on other sites
I agree with Witchlord and Hway. Automatic selection runs a remote chance of ending up in an unsupported or invisible mode, rendering the game useless. Use 640x480x16 default and open with a menu that clearly allows "setup" or "options"...

I also hate programs which decide things for you...

Share this post


Link to post
Share on other sites
Well right now I''m just trying to get a demo version of my game ready for IGF... I guess I can hold off on considering this feature, because presumably the IGF contest judges will know how to switch video modes

Poontardis, I also considered what you suggested. I think, though, for the experienced gamer, to even have to deal with a "suggest video mode change" prompt once would be annoying as hell. If done well, though (i.e. non-intrusively), it could work.

X-Man, I agree that picking weird modes, even when they''re enumerated by the hardware, is risky. I notice that some modes (like 480x360 w/ my card) require that I recalibrate my monitor in order to center them correctly -- I don''t want that. So, if I ever do decide to implement this, I''ll probably just pick between 640x480 and 320x240.

By the way, I appreciate your guys'' input, but I really don''t understand what you mean, Hway & X-Man, when you say that you would hate for a game to make this decision. Every game that plays full-screen makes a decision about what video mode to use by default... I''m just saying, instead of blindly picking 640x480, why not put a little more thought into it?

Thanks again guys

Share this post


Link to post
Share on other sites

As for programs making decisions, it''s not only games.
Musicmatch didn''t bother asking me ANYTHING before installing itself - to wrong drive, to wrong directory, and doing everything else too wrong while being at it.
MS Office is always trying to "automagically" decide what I''d like to do - and usually guesses wrong, and results definitely are unsuitable for children''s ears.
As a result, I have come to conclusion that any automation activated automatically is bad, stupid and worthless. And did I mention bad...

Automatic mode setup has other drawback too: imagine your program detects a low-end system and switches to 320x200 without notifying player properly. Imagine then player seeing a fair performance, but in low-res - junking the game only because of that. 640x480 still is industry stardard, thus making a good default mode. (and I still play most games at 640x480x16, although my system definitely could do better)

When first time run, my program enumerates devices and modes, and based only that sets "default" mode, prompting user with some comboboxes with device and mode selections, and a few buttons. I guess "auto-select mode" would fit onto that screen, too, and when used, it''s run the test (see below) and pick a mode - still letting user to override decisions made.

If you want after all to make such mode decision process, switch to some mode - 640x480x16 is widely supported and probably will no just nicely - draw a few million specific-sized tris and choose mode according to measured pixel throughput. Or the other (possibly better) way around, draw as many tris as you can during a one second period, and figure out pixel throughput that way. Based on that, you should be able to decide mode...

And btw, some monitors have auto-fit option. Like this He... I mean Dell''s. Works pretty nicely, too...

Share this post


Link to post
Share on other sites