[SORTED OUT]pixel image quality

RODO

Member
hello guys, I come to ask for help. I have a question and a problem about pixel resolution / quality in my game.
I was setting up the scenario for my game until I lost that when I started it, the quality of the pixels dropped a lot or they bugged and the pixels disappeared. (Image for better understanding):


in the room editor
1616745350802.png

inside the game
1616745412822.png

is there any way to solve this problem? I would love to maintain the quality of the scenery tiles, they are very beautiful. In this case, I already tried to fix it through the camera but that doesn't change anything, it continues with the poor quality


I will be very grateful for any help.
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Moderator
Make sure that when you start the game you are setting the size of the application surface to the size of the camera, and that the camera is a correct multiple of the viewport. So, for example, if the viewport is 640x480, the camera should also be 640x480, or a divisor of that, like 320x240. Then in the Create Event of the very first object in the game you would set the app surface to the size of the camera, eg: surface_resize(application_surface, 320, 240);

Basically, you want to make sure that the app surface, camera, view port and window size are ALL in the same format and size range.

If you are unsure of any of this, then please tell us how you're setting up the room camera and viewport (room editor or code?) and the values for both of them.

Oh, and one VERY important thing that can cause issues if you're not aware of it! The game window is set by the size of the first room in the game. If that room has no views active then it's the room size that sets the window size, and if the room has a camera active then the window will be set to the view port size. This means that if you have a start room that is 480x480 then the window will be 480x480 FOR ALL OTHER ROOMS, regardless of the size of the viewport or room or camera. So, make sure that your FIRST room is correctly setting the window size for the resolution and aspect ratio that you want for the whole game. :)
 

RODO

Member
Make sure that when you start the game you are setting the size of the application surface to the size of the camera, and that the camera is a correct multiple of the viewport. So, for example, if the viewport is 640x480, the camera should also be 640x480, or a divisor of that, like 320x240. Then in the Create Event of the very first object in the game you would set the app surface to the size of the camera, eg: surface_resize(application_surface, 320, 240);

Basically, you want to make sure that the app surface, camera, view port and window size are ALL in the same format and size range.

If you are unsure of any of this, then please tell us how you're setting up the room camera and viewport (room editor or code?) and the values for both of them.

Oh, and one VERY important thing that can cause issues if you're not aware of it! The game window is set by the size of the first room in the game. If that room has no views active then it's the room size that sets the window size, and if the room has a camera active then the window will be set to the view port size. This means that if you have a start room that is 480x480 then the window will be 480x480 FOR ALL OTHER ROOMS, regardless of the size of the viewport or room or camera. So, make sure that your FIRST room is correctly setting the window size for the resolution and aspect ratio that you want for the whole game. :)
well, I tested what you told me and nothing, the pixels are still poorly optimized or strange


I don't know if it's really a problem with the camera, window or surface because I changed the values and nothing changed. It put absurd values but it was changing

I'll put the camera and window settings I'm using in the game:
1616753153162.png
I am using these default config for the whole game. In this case, 480x360 I use for my camera where it shows my character, it is very small because it is a procedural map game and I don't want the player to see much of what is around him.

Thank you for your help. I will use this technique of surface in other games because some I have problem with camera, different from this one.
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Moderator

RODO

Member
480x320 is NOT the same aspect ratio as 1366x768... 480x320 is an aspect ratio of 1.33333, while the other is an aspect ratio of 1.77864. These need to be the same, always! Try 480x270, which is the same 16:9 aspect ratio as 1366x768, and make sure to set the app surface to 480x270 too.

PS: this is a handy tool... https://aspectratiocalculator.com/16-9.html and this is an excellent table of "true" 16:9 resolutions: https://pacoup.com/2011/06/12/list-of-true-169-resolutions/
I made the small change and, again, there are still problems, but with this method that you gave me I decided to do a test and found that when I put the tile design (in this case, I took a part of it and turned it into a sprite) in obj or anything that can be applied to a sprite, the quality does not decrease, and only when I move my tile set to room and make the changes, if I put it on a sprite, the quality remains. Can you tell me what can make a tile's quality drop? thanks for your attention for the help so far.

obs: thanks also for the site, it is very good and useful
 

RODO

Member
[SORTED OUT]

I discovered the problem, it was the tiles set that I had brought to the project. For some reason, if I transported a drawing above 1024x1024 the quality would drop when I put it in the room (if anyone wants to explain it to me right here, I'll be very grateful). But anyway, thanks to
Nocturne for helping me so far with the problems and giving me several tips
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Moderator
I discovered the problem, it was the tiles set that I had brought to the project. For some reason, if I transported a drawing above 1024x1024 the quality would drop when I put it in the room (if anyone wants to explain it to me right here, I'll be very grateful). But anyway, thanks to
Well done! Glad you resolved the issue... Now, before you go changing all the tilesets, you should know what is probably causing your issue...

All the GFX in your game are placed onto Texture Pages and these are swapped into and out of memory as your game is played. Now, the thing is, that texture pages have to be a "power of 2" in size, for efficiency on the GPU. This means that they can be 1024x1024, 2048x2048, etc... in size (although GM will actually adjust this to save space, for example 512x1024 is a valid size). GameMaker gives you an option to choose a maximum size for the texture page, and if any graphic that is added that is larger than this maximum (including texture border width) will be SCALED DOWN and then placed on the texture page. Can you guess now what your issue is? :)

See here in the manual for more information: https://manual.yoyogames.com/Settings/Texture_Groups.htm
 
I have a related question, is having a viewport size of 640 by 360, and a camera size of 320 by 180 ok? Or will this lead to problems?
 

Nocturne

Friendly Tyrant
Forum Staff
Admin
Moderator
As long as the camera, port, window and application surface are all the same aspect ratio, then everything should be fine (and those value are the same aspect ratio... :) ).
 
Top