Jibble

A redesign of the AGS site is being planned! Please check out the mockups and give your feedback.


Two factor authentication (via app or email) is now available for the forums. You can enable it on your profile.

Author Topic: Other Resolutions.  (Read 19388 times)

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Other Resolutions.
« Reply #60 on: 11 Jul 2013, 07:54 »
There may be a sense in selecting x2, x3 etc filters for windowed mode, but is there a point to explicitly choose them for fullscreen? Why should you not using your current display resolution?
Also, what if it is not x2 or x3 multiplier, but 1.5 or 3.2 which fits best for your screen?

Snarky

  • Global Moderator
  • Global Moderator
  • Mittens Lord
  • Private Insultant
    • Best Innovation Award Winner 2018, for his numerous additions to the AGS open source ecosystem including the new Awards Ceremony client and modules
    • Snarky worked on one or more games that won an AGS Award!
    •  
    • Snarky worked on one or more games that was nominated for an AGS Award!
Re: Other Resolutions.
« Reply #61 on: 11 Jul 2013, 08:43 »
There may be a sense in selecting x2, x3 etc filters for windowed mode, but is there a point to explicitly choose them for fullscreen?

With the plain x2, x3 etc. filters it's not so important, but it definitely makes sense for the hq filters (and other more advanced filters that might be available now or in the future), so it's mainly a matter of consistency. Though it would also, to my mind, affect screen captures (which should ideally capture it at the effective filtered resolution, but ignore the subsequent window stretching).

Why should you not using your current display resolution?

Wait, are you asking why there should be options for different resolutions at all?

Well, what if some combination of filters gives an effective resolution of 1280x800, maybe that's a resolution supported by my video card/monitor, and I'd rather just set my screen to that mode than have AGS stretch it do a different screen size.

Edit: Another thing we haven't really talked about, but which some emulators support, is to make the game resolution larger than the screen resolution, so that the screen just shows part of the whole graphics canvas (there needs to be a way to scroll around it or zoom back out, obviously). That could be useful if you're on a small screen, like a smart phone.

Also, what if it is not x2 or x3 multiplier, but 1.5 or 3.2 which fits best for your screen?

You set it to whatever is closest and then use the stretch mode to fit it to the screen however you like. With 3.2 I'd probably just set it to x3 centered, but with 1.5 I'd set it to x1 or x2 best proportional fit.
« Last Edit: 11 Jul 2013, 08:48 by Snarky »

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Other Resolutions.
« Reply #62 on: 11 Jul 2013, 08:52 »
But why should I choose a multiplier or resolution at all, if I already know that my desktop resolution is supported by the graphics card?
Can't I just tell: stretch it to current display?

Snarky

  • Global Moderator
  • Global Moderator
  • Mittens Lord
  • Private Insultant
    • Best Innovation Award Winner 2018, for his numerous additions to the AGS open source ecosystem including the new Awards Ceremony client and modules
    • Snarky worked on one or more games that won an AGS Award!
    •  
    • Snarky worked on one or more games that was nominated for an AGS Award!
Re: Other Resolutions.
« Reply #63 on: 11 Jul 2013, 09:23 »
Can't I just tell: stretch it to current display?

Yes, just leave the filters off, leave the resolution at the default, and set it to stretch or best fit in fullscreen.

But why should I choose a multiplier or resolution at all, if I already know that my desktop resolution is supported by the graphics card?

Well, as mentioned above, what if your screen is slightly larger than 4x, and for optimal crispness you just want to center the 4x graphics on screen without stretching them? Then you need the filter option.

And if you prefer to let the video card handle the stretching rather than AGS (it might use a slightly different algorithm that some might prefer), you need the resolution setting. (Though since it is more of an edge case these days, it might make sense to put it as an advanced option and maybe behind a "force screen resolution" check box or something.)
« Last Edit: 11 Jul 2013, 09:43 by Snarky »

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Other Resolutions.
« Reply #64 on: 12 Jul 2013, 11:03 »
For anyone savvy in 3d graphics out there: if I have a 2d texture rendered in 3d world, and I want it be not stretched to whole screen, does it matter if I change "position" matrix to make it appear "further" from camera, or change "perspective" matrix to make camera "zoom out"? Or is it essentially same thing, the difference is only in which object moves and which stays on same place? I am interested mainly in how it affects rendering speed, does one of those methods make calculations faster/slower, or there's no difference at all?

Calin Leafshade

  • Long live King Cat!
    • I can help with making music
    • I can help with voice acting
    • Calin Leafshade worked on one or more games that won an AGS Award!
    •  
    • Calin Leafshade worked on one or more games that was nominated for an AGS Award!
Re: Other Resolutions.
« Reply #65 on: 12 Jul 2013, 13:22 »
Well you should really be using an orthographic camera so distance from it shouldnt make a difference in rendering size.

If you want to render something at a different size you should change the vertices of the poly.

Re: Other Resolutions.
« Reply #66 on: 12 Jul 2013, 13:33 »
I agree to Calin Leafshade.
Ortho is the right way to handle 2d graphics within 3d space. But you can also use the scale component of the object matrix to resize a plane.

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Other Resolutions.
« Reply #67 on: 12 Jul 2013, 13:53 »
So, to clarify, I do not touch the projection matrix, but move/scale a plane I render texture on?

Calin Leafshade

  • Long live King Cat!
    • I can help with making music
    • I can help with voice acting
    • Calin Leafshade worked on one or more games that won an AGS Award!
    •  
    • Calin Leafshade worked on one or more games that was nominated for an AGS Award!
Re: Other Resolutions.
« Reply #68 on: 12 Jul 2013, 13:55 »
Yes, providing the matrix is currently an orthographic matrix and not a perspective one. It should be but I remember looking at the D3D code in AGS and it looked like CJ copied it straight from a tutorial or something because it had unrelated comments so it might not be.

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Other Resolutions.
« Reply #69 on: 12 Jul 2013, 15:25 »
Thanks!

Woo, its getting shape:



And just for lulz:
« Last Edit: 12 Jul 2013, 15:37 by Crimson Wizard »

Ali

  • What will become of the baron?
    • Ali worked on one or more games that won an AGS Award!
    •  
    • Ali worked on one or more games that was nominated for an AGS Award!
Re: Other Resolutions.
« Reply #70 on: 12 Jul 2013, 15:31 »
Yay!

Any chance of seeing a full-size version of the screenshot?

Sorry to harp on, but would the technique you're working on allow (hypothetically) for scaling down a larger screen size like 1280x or 1920x?

Dropped Monocle Games

  • You can call me Sox
    • I can help with animation
    • I can help with backgrounds
    • I can help with characters
    • I can help with play testing
    • I can help with web design
    • Dropped Monocle Games worked on one or more games that won an AGS Award!
    •  
    • Dropped Monocle Games worked on one or more games that was nominated for an AGS Award!
Re: Other Resolutions.
« Reply #71 on: 12 Jul 2013, 16:44 »
Quote
Sorry to harp on, but would the technique you're working on allow (hypothetically) for scaling down a larger screen size like 1280x or 1920x?

I would also like to know about this! working in a higher res would be amazing :D
I know I'm pretty new around here but I have big plans on making games in AGS

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Other Resolutions.
« Reply #72 on: 12 Jul 2013, 17:35 »
Any chance of seeing a full-size version of the screenshot?

Blackwell Deception (640x480 game) playing on 1680x1050 fullscreen (nearest-neighbour transformation):
http://img827.imageshack.us/img827/4937/qrj3.jpg

Sorry to harp on, but would the technique you're working on allow (hypothetically) for scaling down a larger screen size like 1280x or 1920x?

Nelly 2 playing on 320x240 :P


There's still number of issues, both with drawing and mouse cursor position.
And we need to plan how the setup should work.

Alan v.Drake

  • ...
    • Alan v.Drake worked on one or more games that won an AGS Award!
    •  
    • Alan v.Drake worked on one or more games that was nominated for an AGS Award!
Re: Other Resolutions.
« Reply #73 on: 12 Jul 2013, 18:38 »
Hooray

Igor Hardy

  • Mittens Serf
    • Igor Hardy worked on one or more games that won an AGS Award!
    •  
    • Igor Hardy worked on one or more games that was nominated for an AGS Award!
Re: Other Resolutions.
« Reply #74 on: 12 Jul 2013, 19:32 »
Most impressive.

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Other Resolutions.
« Reply #75 on: 12 Jul 2013, 20:48 »
Funny, I found I must set a Viewport for D3D, because otherwise scrolling rooms are drawn on the side borders too, making it visible what shouldn't be :).

E: Oh, actually not just scrolling rooms, but anything that goes beyond "border", like moving objects etc. CJ did not use it, because the image was always stretched to whole window.

EE: Also, important note, simply for the record. AGS engine has 2 set of parameters defining screen size: scrnwid & scrnhit, final_scrn_wid & final_scrn_hit. The difference is only that the latter takes side border into consideration. Since now borders are defined by graphics driver/filter, only one pair is needed, the one which defines game size.
The "screen sizes" returned by script functions (GetScreenWidth/Height) are "virtual screen" sizes (which = game resolution), not real window sizes the game is currently running.
While making some experiments I forgot about that, and this resulted in weird misalignment of guis and fonts in several games.
If the script API will ever allow to get real window size, there should be separate set of functions for this.
« Last Edit: 12 Jul 2013, 23:30 by Crimson Wizard »

Monsieur OUXX

  • Mittens Vassal
  • Cavefish
  • Mittens Half Initiate
    • I can help with proof reading
    • I can help with translating
    • I can help with voice acting
    • Monsieur OUXX worked on one or more games that won an AGS Award!
    •  
    • Monsieur OUXX worked on one or more games that was nominated for an AGS Award!
Re: Other Resolutions.
« Reply #76 on: 14 Jul 2013, 11:27 »
My idea is to invert the logic of using scaling filters. At the moment the selected scaling filter define final resolution. While it is final resolution that should define which scaling filter to select. Setup should have following options:
- Display resolution
- Fullscreen (yes/no)
- Placement mode:
  • Place (just render starting from 0,0)
  • Center (center inside window)
  • Stretch (stretch to window)
  • Best fit (stretch proportionally as much as fits in the window) - this is the default option
- Scaling filter to use if necessary: nearest-neighbour (plain/AA), hq2x, hq3x.

I like your idea.
But as Snarky pointed out, sometimes the choice of the resolution by the player (at least me) is a bit irrational. Especially the zooming level. Sometimes I want to play in window-mode, and I decide sort-of afterwards if I want the game to use up most of the screen (3x) or just part of it (2x).

However I strongly agree that we have to find a way to "hide" those resolution calculations from the player.

Maybe we could have a list of recomended modes (appearing in bold in the list)?

Or have a thumbnail of what the result would look like in the winsetup.exe window? (a bit like in the Display Parameters window of Windows XP -- see the upper part of the screenshot below.) : you'd see a larger rectangle symbolizing the screen, with a message on top of it : "your screen needs to be able to display resolution 1024x768" and a smaller rectangle inside it symbolizing the game window ("the game will appear as a 800x600 window")

 

RickJ

  • fix'n one thing and break'n two ...
    • I can help with scripting
    • I can help with story design
    • RickJ worked on one or more games that was nominated for an AGS Award!
Re: Other Resolutions.
« Reply #77 on: 14 Jul 2013, 14:45 »
I also like CWs ideas, it is much simpler and much more sane. I think Monsieur OUXX and Snarky are correct in that "you can't please everyone so you have to let them please themselves";)

So instead of junking up CW's clean design why not have a button labeled "Other Options" that opens a little window containing the irrational options.  Just a thought!
« Last Edit: 14 Jul 2013, 14:47 by RickJ »

Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Other Resolutions.
« Reply #78 on: 14 Jul 2013, 19:05 »
Basically it is either window size that define scaling or otherwise. But we can have both options.
All we need, IMO, is to add another placement option: "Resize window". When selected, the resolution selection (in setup) will be disabled, and when run, the engine will make the window size = base game size * chosen scaling.
Other options (stretch, center, etc) will work opposite: they will create window of defined size independently of scaling mode, then scale and put a game image inside.


Crimson Wizard

  • Local Moderator
    • Lifetime Achievement Award Winner
    • Best Innovation Award Winner 2013, for spearheading the AGS 3.3.0 project
    • Crimson Wizard worked on one or more games that won an AGS Award!
    •  
    • Crimson Wizard worked on one or more games that was nominated for an AGS Award!
Re: Other Resolutions.
« Reply #79 on: 19 Jul 2013, 19:08 »
Test build (engine only): http://www.mediafire.com/download/4adkw2du7kdj63u/custom_dispres.zip

Related branch: https://github.com/adventuregamestudio/ags/tree/feature_display_resolution
(forked from latest 'master')

I have to apologize, I wanted to make a build with new options in winsetup, but feel too sleepy to write code :p. I am also leaving my city for several days, so I thought maybe I'll upload what I have just to show how it works.
The only way to setup new settings is to write them manually into acsetup.cfg. Put following into "[misc]" category (where you have "gfxdriver", "gfxfilter" and similar stuff):

Code: Text
  1. renderstyle=N
  2. // N=0 - center
  3. // N=1 - stretch
  4. // N=2 - stretch proportional (aka "best fit")
  5. // N=3 - resize window - this makes window size equal to (default game size)*(filter scaling).
  6. // if you set renderstyle=3, the following screenwidth and screenheight params are ignored.
  7. screenwidth=X
  8. screenheight=Y
  9. // Where X and Y are wanted window resolutions.
  10.  

I scrapped most of gfx mode initialization code in the engine, and now it does following:
1. Tries to initialize requested resolution.
2. If failed, looks for the nearest supported resolution in the internal driver list, and tries to initialize it.
3. If failed, tries to initialize originally requested resolution with alternate color depth.
4. If failed, looks for the nearest supported resolution with alternate color depth.
5. If failed, quits with error.
This is good to know, because you may end having different resolution than you asked for. Press Ctrl+V in the game to see system stats - it tells which resolution you are running.
Also, this process is reflected in the game log file (agsgame.log).
Log example:
Spoiler: ShowHide
Quote
Switching to graphics mode
Trying gfx mode 320 x 200 (16-bit) fullscreen
Attempt to switch gfx mode to 320 x 200 (16-bit)
Failed, resolution not supported
Attempting to find nearest supported resolution
Trying gfx mode 640 x 480 (16-bit)
Attempt to switch gfx mode to 640 x 480 (16-bit)
Succeeded. Using gfx mode 640 x 480 (16-bit) fullscreen


Remember, if you are running old games (AGS 2.7 and lower) run new engine's setup program at least once before launching game in this engine - to set graphics driver and other 3.x options properly, otherwise you may get weird results.

Known problems:
OpenGL driver not yet updated, therefore engine ports won't work (or work weird).
Mouse will act annoyingly slow with very small games run non-stretched in large windows; also in proportionally stretched games it may be too slow or too fast moving along one of the axises. I think this needs some kind of automatic fixing + mouse sensivity setup.