320 x 240 games on a widescreen monitor

Started by Dave Gilbert, Fri 29/02/2008 18:05:05

Previous topic - Next topic

subspark

#20
We've spoken about this before actually. I'll admit my entire suggestion is spread over two threads but its basically outlined above. Most of what I suggested lies in the suggestions thread rather than this one but I'll quote myself for clarification's sake:

Quote
QuoteBy allowing us to customize those to either resolution, we could make the best of both aspect ratios.
GarageGothic is right and as I have suggested a few times already I think we need to be able to control 'screen layout' in the editor along with the other features found in the default game setup exe.
Paul.

On quite a few occasions already, I have reinforced this idea with suggestions on how to go about such a feature. My point is, this idea would be an important part of a greater feature set in an effort to overhaul the resolution system.

Ironically, as much as we both crave resolution independant development, I imagine the easier task on Chris' part would be to code in support for automatic resolution detection.
So again, I agree with you; First things first.  :)

Cheers,
Paul.

Edit: We are chasing the same animal GarageGothic ;).
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=33896.msg440632#msg440632
We're both suggesting the same thing in other words, however, I have thought ahead a bit and added a bit more to the idea regarding resolution detection and a GUI based setup screen.
I strongly reccomend these three things should be given equal attention and should be worked on in conjunction with one another. They are essentially directly related features.

GarageGothic

Sure, I know we're arguing the same cause here, and I didn't mean to detract from your suggestions. I just felt that the three bullet points in your "All that has to be done is the following" post didn't directly address the issue I'm currently struggling with (although the development aspect is a prerequisite of the automatic detection suggestion).

subspark

Ahh! Sorry you posted before I could reply. It's a grand idea GarageGothic and one I choose to support you on.
I'm sure Chris can see the importance of this feature and I imagine it will eventually come to be.
I was getting worried when this topic ended up on the second page of the technical forum :o so I had to revive it. I'm sure glad we both feel it is important and must be addressed at some point in the near future.

Many cheers,
Paul.

GarageGothic

#23
I just made some experiments, and it's perfectly possible to re-compile a 640x480 game to 640x400 resolution and control the screen offset through creative use of SetViewport. The main problem is that you'd have to distribute the game in both a 4:3 and a 16:10 version, which could confuse some people and lose you a download - it would be much easier if this choice could be made in winsetup instead. Or through auto detection as suggested by subspark. Of course this would have to be a feature "allowed" by the developer, not something you could activate for any game since they might not support it.

Another problem is that screen coordinates for GUIs lock to the smaller viewport, causing misplaced GUIs as shown in the screenshots from Blackwell Unbound that I posted in another thread. Since most GUIs would have to be placed/sized differently in a 16:10 game anyway, this is not too big a deal, as long as it happens consistently (haven't done much testing of that). But nevertheless it's somewhat annoying.

subspark

Releasing two versions of the game both with a winsetup executable that allow you to choose which aspect ratio to use for the game is a great temporary solution. I imagine this would indeed be a reasonable prerequisite for future control over screen layout for a single release.

Thumbs up.

Cheers,
Paul.

Pumaman

Quote from: GarageGothic on Tue 18/03/2008 11:44:42
3) A 800x500 widescreen alternative to the 800x600 resolution.

Right, I decided to take the plunge and get a widescreen monitor so I could see what all the fuss was about.

Having done so, I do understand your point, and I think adding an extra couple of widescreen modes to AGS wouldn't be a bad idea.

The problem is, I'm having trouble finding out if there are "standard" widescreen resolutions that all monitors support. For example, wikipedia claims that 768x480 and 1024x640 are standard resolutions, yet my monitor doesn't support either.
On the other hand, my monitor does support 960x600 which is not listed on wikipedia.

And then, when running a 640x480 game on a widescreen monitor it'd be great for AGS to initialize a 768x480 screen and add black borders to the sides. But that resolution doesn't work on my monitor at least.

So what's the solution? I'm not sure. Potentially AGS could try to find the nearest available resolution and then add 4 borders, or stretch the image. But neither of those are very satisfactory solutions.

I guess this is the problem with adventure games having fixed size backgrounds, whereas most games these days are 3D so the screen resolution isn't particularly important.

subspark

#26
Well even today's modern 3d games these days scale their graphics to match the native desktop resolution rather than switch the actual monitor resolution. I suggest, given AGS' non-resource hungry engine, that the graphics be smooth-scaled up to match whatever resolution the user was using on the desktop. This is not only a convenient way of supporting all resolutions but it is more convenient for the end user too. Games that switch the monitor's resolution always end up bugging up the desktop layout and sometimes forgetting to switch back to the desktop resolution. This can be a near disaster in a 640x400 situation. You wouldn't even be able to access the display properties without having to guess your way around using the keyboard. It has happened to me before but then again, AGS was always pretty good at switching back my original res.

Screen scaling (incorrect term?) is suitable for all games and makes things easier all round.

Modern games like Crysis and Unreal 3 titles use screen scaling to maximize compatibility with an unlimited range of monitors.

Edit: This should help:
http://msdn.microsoft.com/en-us/library/aa970067.aspx

Cheers and good luck with this,
Paul.

scotch

"Modern games like Crysis and Unreal 3 titles use screen scaling to maximize compatibility with an unlimited range of monitors."

3D games are resolution independant because they are vector based, they don't do any upscaling, they simply render at the desired resolution. Whichever resolution that is, the raster elements (the textures) are getting distorted constantly, so they have to be filtered. Pixel art games on the other hand are drawn for one resolution and are completely ruined by scale filters in most cases.

However, scaling isn't a bad option if there is no filtering when doing the scale, in fact as a safe mode it'd probably be the best thing to do, perhaps have it as an option on the setup program. Full screen, native desktop resolution, do the rendering at standard game resolution and then rescale without filtering. We'd still have bars of course but only as long as AGS is tied to certain resolutions, and it seems to be moving away from that.

subspark

You obviously haven't played Crysis nor do you know what I am really talking about. I'll try to explain it better, sorry.
Any 3D game is vector based, but at what resolution you choose to draw those vectors is a completely separate issue. I'm not talking about resolution of content, but the resolution itself.
Perhaps you would like to visit the link I posted, scotch, and see what this is all about.

Cheers,
Paul.

scotch

QuoteYou obviously haven't played Crysis nor do you know what I am really talking about.
Oh, really.

I didn't disagree that Crysis renders its 3D scene to whatever resolution you want, obviously it does like virtually all 3D games, and I was backing up the suggestion of using the desktop resolution for best compatability. All I was pointing out was that while Crysis rasterizes graphics on the fly to arbitrary resolutions and aspect ratios, it is not a good idea to do the same thing with pre-drawn sprite art. Especially I wanted to point out that not many people would want their sprite art "smooth scaled", but that's not disgreeing with the whole idea.

If this was implemented it'd have to take care not to mess up the aspect ratio, to avoid texture filtering and inconsistently scaled texels. Not all resolutions are good candidates for scaling between, and there are some non obvious decisions to make.

QuotePerhaps you would like to visit the link I posted, scotch, and see what this is all about.

I did, it's about how the changes to the user interface scaling in Vista affect automation programs that assume absolute coordinates... I guess you googled for "screen scaling" and assumed it was relevant? Crysis does nothing that is known as "screen scaling". Please leave the rude tone behind on the tech forums, we're not all idiots.

subspark

QuoteIf this was implemented it'd have to take care not to mess up the aspect ratio, to avoid texture filtering and inconsistently scaled texels.
Yeah I agree. I guess the aspect changes would call for automatic black bordering for 4:3 and 16:10.

QuoteAll I was pointing out was that while Crysis rasterizes graphics on the fly to arbitrary resolutions
Sorry I misunderstood you scotch. No offense intended whatsoever. I get a little short sometimes when people misread my posts and reply as if I had never posted. Your not guilty of this in any way and I agree with your statements on many levels.

QuoteI guess you googled for "screen scaling" and assumed it was relevant?
Yeah I was on my way out of my apartment and did a quick google search. Its obviously not relevant afterall, perhaps you could find some valid information on the scaling technique I am talking about.

Cheers mate,  ;)
Paul.

Pumaman

The stretch-to-desktop-resolution thing is a possibility, but wouldn't work in a lot of situations. For example, if the game res is 800x600 and the player's desktop is 1024x768, the resulting scaling would look pretty awful; whereas if the game was 320x200 then it would probably be more acceptable.

Also, I'd need to investigate the performance of stretching to full screen, especially since many people run desktop resolutions like 1600x1200 these days.  It's just a shame that there doesn't seem to be a set of standard widescreen resolutions, like there are for 4:3 resolutions.

subspark

QuoteIt's just a shame that there doesn't seem to be a set of standard widescreen resolutions, like there are for 4:3 resolutions.
You can say that again.  :'(

The Direct X scaling method in the 3D gaming world seems to be pretty sharp and clear. You have to remember that the graphics is being scaled up from (in my case) something like 1024x768 to 2560x1600. It looked good because the pixel size wasn't blocky due to actual resolution change but instead a smooth interpolation was presented. It may not wont work as well with lower resolution games like 640x400 or 320x200 but the principle is the same. It is going to look better overall and solve more problems than not if the graphics are scaled to match your desktop rather than run in a blocky and 'interlacy' native resolution on your monitor. There are some very smooth scaling techniques that really do seem to increase resolution when it is really not. I don't move in programmer circles normally but I get the feeling there is some very free source code for this kind of thing over on major development sites. There might be something GPU-wise in the AMD/Nvidia DirectX SDK samples. Microsoft would have its own knowledge base for this technique. I thought I had the link yesterday but scotch brought it to my attention that it was unrelated after all.

Cheers, :D
Paul.

Gilbert

Quote from: subspark on Tue 05/08/2008 00:45:11The Direct X scaling method in the 3D gaming world seems to be pretty sharp and clear. You have to remember that the graphics is being scaled up from (in my case) something like 1024x768 to 2560x1600. It looked good because the pixel size wasn't blocky due to actual resolution change but instead a smooth interpolation was presented.

No, it depends on the graphics. If the graphics are photorealistic it won't look so bad (though enabling interpolation may even make it look better in this case). However, for pixel arts such kind of scaling would be awful, in fact, alternating double and triple pixels would be very noticiable and ugly (things can only go worse if interpolation is enabled here). (Actually if it's just 320x240 or 640x480 scaled up to 2560x1600, the result may not be that bad, as a pixel block with say, 5 screen pixel width may not look that difference from one with 4 pixel width.)

Unfortunately we don't have much choice for "modern" LCDs (this is the primary reason I dislike LCDs and won't get one, as I change resolutions A LOT).

subspark

QuoteActually if it's just 320x240 or 640x480 scaled up to 2560x1600, the result may not be that bad, as a pixel block with say, 5 screen pixel width may not look that difference from one with 4 pixel width
I'm not quite with you mate. Could you clarify your argument for me please? I'm not sure I follow.

Cheers,
Paul. :)

Spire

Quote from: Pumaman on Mon 04/08/2008 19:27:09It's just a shame that there doesn't seem to be a set of standard widescreen resolutions, like there are for 4:3 resolutions.

It's not quite as standardized as 4:3 monitors, but there are a few common 16:10 resolutions:

1280x800
1440x900
1680x1050
1920x1200
2560x1600

Pretty much all recent 16:10 monitors out there have one of these as their native res.  My monitor's is 1440x900, and it's been a while since I played a 640x400 (16:10) AGS game, but I have to play the 4:3 ones windowed.

This is, I think, an important point.  Games will look much better if they're scaled to each monitor's native res.  How feasible this is, I don't know.  Does pixel-based scaling have to be power-of-two based to look good?
Quote from: subspark on Tue 05/08/2008 00:45:11

The Direct X scaling method in the 3D gaming world seems to be pretty sharp and clear. You have to remember that the graphics is being scaled up from (in my case) something like 1024x768 to 2560x1600. It looked good because the pixel size wasn't blocky due to actual resolution change but instead a smooth interpolation was presented.

Are you saying that you ran Crysis at 1024x768 and your monitor is scaling it up?  Because otherwise, if your monitor's native res is 2560x1600, then the game is running at 2560x1600 with no scaling.

subspark

QuoteAre you saying that you ran Crysis at 1024x768 and your monitor is scaling it up?
No. I am saying that I ran Crysis at 1024x768 and the game scaled it up to 2560x1600. Although it was stretching the aspect ratio from 4:3 to 16:10, it didn't look too bad.
But when I changed the game resolution to 1280x800, the game scaled it up by a power of 2 without ever changing the monitor's resolution and it was difficult to detect the individual pixels due to the superb interpolation going on.

You have to understand that on a monitor such as mine (30" 16:10 Dell), running monitor resolutions like 1280x800, 1 game pixel uses 4 actual screen pixels, making the pixels themselves very obvious and distracting. The same for a 20" 4:3 monitor running 320x240. If you scale and interpolate those pixels as smoothly as in Crysis or other games not necessarily 3D either, you forget that there's scaling going on because it is so smooth it becomes invisible. I'm not sure what interpolation algorithm Crytek used for Crysis but the same technique would certainly help AGS become more convenient with differing resolutions and aspect ratios.

My point is that this is a new feature in modern games (2D or 3D) and should be considered for AGS because of it's convenient benefits.

Cheers,
Paul.

visionastral

Hello there, excuse my english, it's not my home language.

When I started to read this topic, I didn't understand at all what was Subspark talking about crysis interpolating to greater resolutions and I must say I thought he was just plain wrong... but, after searching for info about it, he isn't at all.
Crysis have the same resolution related issues than Doom III had when it came out, that's why you couldn't choose a lot of resolutions in Doom 3 (formerly 640x480, 800x600 and 1024x768 if I recall correctly, as I never played it with higher res due to lack of hardware  :P ).
The problem comes with the intesive use of pixel shaders, wich are graphics functions you send one time to the Graphic card and let it (the GPU) do the dirty work for you pixel by pixel in your screen.
This is mainly used to perform Bump mapping (and normal mapping, wich is a variant of it), non gauraud shadings (phong and bling types) and heavy screen efects like Bloom or Glow (wich involve modifying every pixel in the screen to render the global effect) as well as reflection distorsions.

The fact is, when you use pixel shaders for every thing (like crysis do  ::) ) the more the resolution of the screen, the more GPU power you need because the more pixels have to be processed, wich quickly goes to an exponential issue with your GPU, even with paired cards (SLI and stuff).
Another problem they face is the diference between efects performed for a resolution and another bigger one don't render equally, so they have to test the resolution carefully.
Thus, they found a trick to let every body play at their monitors native def; they render in a standard/under control resolution and then they rescale to the desktop.
The technical part involves rendering the game to the texture memory and then use this texture to render 2 poligons streched to fill the screen size.
I don't know if they are using a special filtering method to do this, but I don't think they could any way. (but hey, those guys worked with Nvidia directly for this game, so every thing is to be expected from them  ;) )

Sooo, for AGS this technique should work too, as it has already been used in emulators like Dosbox, Mame, BlueMSX and even NeoRage mainly thru OpenGL (because it is easy to implement and portable to other systems).

I thought AGS was all ready using this kind of tips because of the D3D9 driver implementation, but it seems you use DX acceleration for drawing segments of graphics (sprites and the like) in the same way one would use Direct Draw to do this.

To make AGS really screen resolution independent, you should:

1- Declare a D3D window like if you were to render a real 3D game

2- Define a texture with a pointer on it (in order to be able to render on it on the fly)

3- Fill your D3D windows with 2 triangles forming the screen rectangle together (as every thing should be done with triangles unless you use OpenGL, but you would have other issues however  :P )

4- Assign correct UV coordinates to the triangles for the texture to be correctly applied over them (as UV coordinates are normalized  from 0 to 1)

5- Assign your texture to those poligons

6- Render your game to the texture memory segment defined before

7- Update your D3D window


All emulators using OpenGL HW accel are using this method, as it is really simple to implement and don't makes you change your core engine.
The only diference for the core engine of AGS is it should render to another segment of memory than your actual back buffer.

However, if you are using well optimised methods to render your sprites, this could be an issue, because rendering directly to a texture could (perhaps) not allow you the use of some particulars methods ( I don't know, as I'm only figuring out how AGS works internaly  ;) )

If you are really serious on that, you should search about "render to texture" topics in Nvidia forums or simply Google it.

About the "standard" Wide Screen resolutions, as far as I've seen, Inspired is right, they are:

For sure:
1280x800
1440x900

The higher res aren't fully "standardized" because not so many monitors suport they  ;)
But you really can count on this two.
To be really sure, you just have to search for recent laptops of every brand, they all are wide screen, and this resolutions are the standard.

However, keep in mind that the latest drivers of Nvidia and ATI do support left and right black bars for correct aspect ratio when using 4:3 resolutions on 16:10 screens (as it has been a real issue for gamers since wide screens appeared).

Actually, I make my game in a tiny Packard Bell laptop with a screen resolution of 1280x800 with correct aspect ratio preserved in full screen, thanks to the Nvidia drivers (8600 card).

I would want to point to a funny thing that happens with TFT screens:
I was hoping for AGS to support bigger resolutions (because making a game in lesser resolutions could be cool and nostalgic, but it's not well viewed from the point of view of modern players). And thus, I was very happy for the new 1024x768 resolution, wich I found to be the minimum to expect from a modern game.
But, in fact, in a TFT screen, the image is much more distorted by the stretching in 1024 than in 800!
That's because 1024x768 is more close to full/real resolution of actual TFTs than 800x600, and then, what happens is: in 1024 you often have a pixel wich became only one monitor pixel, but the others become 2 pixels. Wich makes a weird appearance, like "waves" in your screen.
800x600 usually gets 2 pixels (or more) to make one, and don't look so bad so!
Thus TFT screens really pisses me off! How happy was I with my huge 19" CRT monster over the table  ;D
(but, hey, TFT have benefices, because now, I have 4 monitors of 21" over the table  ;D )

(just in case you wonder for what I should use so much monitors, I make 3D animations for living... and 1 monitor is for internet and emule, of course xD )

visionastral

Man, I didn't realised how long my post was...  :-[
sorry  :P

subspark

Your english, visionastral, is excellent, and your understanding of the screen scaling process is astounding.
Thanks for explaining it for us. I wasn't sure where to start looking for technical answers so thank you for your research.

2560x1600 is the maximum resolution a 16:10 widescreen monitor will allow under current GPUs and as a result I think it can be considered standard as well.
By TFT do you mean LCD? I also run an animation studio (visual effects to be more precise) and use many screens as you do. Good to see a fellow 3D animator enjoying the wonders of AGS.

Cheers,
Paul.

SMF spam blocked by CleanTalk