GUI not resizing after changing resolution

Started by alzabel, Wed 15/11/2023 10:09:02

« previous - next »

alzabel

I am a complete beginner using the 3.6 version and the Sierra-style template.
When I go to "General Settings" and change Resolution to something else than 320*200,
the gui and the dialogs do not resize.
Is it the expected behaviour? How should I fix it?  :confused:


Khris

I just tried this with 3.6.0 and creating a new game from the Sierra template; right after changing the resolution I get this:



However this resizing is pretty useless anyway imo because you'll usually want pixel-perfect GUI elements that fit the actual resolution so for an actual game you'll rework the GUIs anyway.

alzabel

Thank you for the prompt response!
So, if I understood correctly there is no way for the images to be resized automatically.
If I want to change the resolution to 640 x 480, as in your example, how can I calculate the dimensions
of the sprites, so as to be pixel-perfect.

Thanks again! 
 

Khris

AGS will just calculate a factor (or two I guess, if the width changes by a different factor than the height) and apply that to GUI sizes and positions and also GUI control sizes and positions.

You only have the option to do this automatically after changing the game's resolution, afaik.

However, increasing the resolution of the Sierra template to 640x400 will completely ruin the existing GUIs if you choose to also resize them. The button images will not scale up, so you'll end up with images that only cover the top left quadrant of the button.
You'll also want a bigger font. You can replace the small font used for the GUIs by opening the first font (0: Normal) and clicking the "Import over this font..." button. Pick a font and a larger size like 20. This should more of less fix the text aspect of the buttons.

If you want to simply upscale the button images for now, you have to do it manually. If you set up your image editor in the preferences, you can edit the sprites directly by double-clicking them. AGS will now open the editor and pass the image. Resize it, then save and close, and AGS will replace the sprite using the resized version.

AndreasBlack

To further on explain what Khris said in more detail.

If you use Photoshop (or any other image-software) and you use pixelart. You need to make sure that in the image-size it's set to nearest neighbour or else you'll get blurry anti-aliased pixels which you do not want when resizing pixels!

Here comes my math professor PHD, choose percentage in the image-size (I'm taking Photoshop as an example) and then use multiplication.

If the resolution is 320 x 200 originally in AGS. You go 320 x 2 = 640, 200 x 2 = 400. Which means that you should set it to 200% in the image-size and you should get the correct image for your game assets

Khris

Another thing I want to make clear because you said you're very new to AGS:
If you just want to increase the window size, there is no need to increase the game's resolution.

The game's resolution should be based on the kind of graphics you want to use. A 320x180 game can be upscaled to Full HD when running it.

I'm primarily noting this because you seemed to want to upscale the GUI graphics automatically. There's no good reason I can think of to ever want to do this. Depending on the upscaling filter you'll either end up with extremely ugly sprites or needlessly upscaled ones.

What is your goal here? Why do you want to increase the resolution in the first place?

Snarky

#6
Just as a sidenote, I have been toying with the idea of a module that would automatically resize the GUI sprites (technically: replace them with resized DynamicSprites) if you change the game resolution.

In most cases this wouldn't be a good long-term solution, but it might be suitable if you scale up the resolution by an integer factor (for example from 320x200 to 640x400 to provide higher-resolution fonts, while still keeping other graphics at 320x200), or as a temporary solution until you get around to redrawing the graphics.

... Or, as in the case I would use it for: when I want to make a test game based on one of the templates, in order to play around with some particular feature (e.g. as a demo/test game for a module), but I need a higher resolution.

heltenjon

#7
Quote from: Khris on Wed 15/11/2023 14:35:28I'm primarily noting this because you seemed to want to upscale the GUI graphics automatically. There's no good reason I can think of to ever want to do this.
I think the point may be that the option seems to indicate that the GUIs will just work if you upscale.   As a new user, you want the inventory window, options menu etc. to just be there and work properly without having to make them from scratch. (Frankly, I wish the option would work that way, too. But you have explained adequately why it doesn't.)

alzabel

#8
Quote from: Khris on Wed 15/11/2023 14:35:28If you just want to increase the window size, there is no need to increase the game's resolution.
Unfortunately the only relevant thing I have found is to set fullscreen or windowed mode from Build -> Run game setup...
I cannot find a way to set the window size in the "General Settings" tab. Is it something done in code?

Quote from: Khris on Wed 15/11/2023 14:35:28What is your goal here? Why do you want to increase the resolution in the first place?
In fact, I was just playing with the different settings to learn the engine.

Quote from: Khris on Wed 15/11/2023 14:35:28The game's resolution should be based on the kind of graphics you want to use.
Could you elaborate more on this please? Is for example a 320 x 200 resolution good for vector based graphics? Is it good for pixel art?

Khris

@alzabel
Press F7 so the game is compiled, then use the Windows Explorer to go to the game folder, then to Compiled/Windows. In there, run winsetup.exe and you can pick a scaling method for fullscreen and window mode.
Provided you didn't change the relevant setting in the editor's preferences, this configuration is now used when you run the game from the editor by pressing F5.

As for the resolution: 320 was the width used by games from like the late 80's till the early 90's roughly. If you want to recreate the classic/pixelated/retro look and yes, use pixel art, this is probably what you should pick. Use 180 as the height and you can use x4 or x6 scaling for fullscreen modes supported by pretty much all modern machines. (example: MI2)

For vector based graphics you'll want a high resolution, one where individual pixels are not visible. Same for hand-drawn backgrounds, or a cartoon style and the like. I'd probably pick 1280x720 in that case, since there's still lots of laptops with 1366x768 and similar resolutions around. (example: A New Beginning)

Crimson Wizard

Quote from: Khris on Thu 16/11/2023 08:49:50@alzabel
Press F7 so the game is compiled, then use the Windows Explorer to go to the game folder, then to Compiled/Windows. In there, run winsetup.exe and you can pick a scaling method for fullscreen and window mode.
Provided you didn't change the relevant setting in the editor's preferences, this configuration is now used when you run the game from the editor by pressing F5.

I'd like to elaborate a bit.

AGS distincts game properties (these define game's internal behavior) and runtime config which tells how the game is run. Game author may provide default config, but players are free to change it using the provided setup program (or even by editing cfg file by hand).

In the Editor, there's a tree node called "Default Setup". It lets you set the config defaults.

You may also run setup application either by going into Compiled folder, like Khris explained, or doing "Build -> Run game setup" in the menu. This setup application lets you run game differently and experiment with settings, but be aware that anything you change there will be your personal settings on this exact computer, and won't affect your players.

More information may be found in the manual:
https://adventuregamestudio.github.io/ags-manual/DefaultSetup.html

alzabel

Thank you for your thorough explanations! You have been very helpful!
If I get stuck anywhere else, I will raise another topic.

SMF spam blocked by CleanTalk