• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM Game displays very low resolutions with tiles

G

Guest User 1

Guest
This is a screenshot of my computer with my project as of yet. You will notice that the game is extremely pixel-y, yet each one of those block images is 128px across. They are part of a background on which I have placed all the required images so far with a big gap as without the gap, lines were appearing on the screen where interpolation was creating bleed from surrounding images. This screenshot is with it turned off. I am not using views and this room is 1600x1000 with no other objects in it other than the main one which is creating all the tiles, it's create event code of which is shown on the left. These are 1080p monitors so it should display fine and it was when I only had one tile per background image.

Could someone explain why this is happening? And how it can be fixed.

Thanks for any help.

 
G

Guest User 1

Guest
I did full-screen it, but it only scaled up by a veeeeerry tiny bit. Before full-screening, the game window almost filled the screen, and even then it was this pixel-y. The room is 1600x1000 and all of it is displayed.
 

RangerX

Member
1080p = 1920x1080. If your room is 1600x1000, you are not only scaling it up by a float number but you also change its shape/ratio. This means not only you get pixel deformation because well, fractions of pixel don't exist but it gets even worse because of the stretch.

1920 / 1600 = 1,2
1080 / 1000 = 1,08

I wouldn't expect it to look better than that from the start. Remove the stretching and you should use views + scaling up by integer values only. As soon as you scale up by a float, pixel graphic will always get damaged. Its just pure logic.
 
G

Guest User 1

Guest
If I run the game with a game window that is exactly 1600x1000 so there is no stretching what-so-ever, it still looks really pixel-y. Each of those blocks looks like it's 32 pixels across, but the actual image resource in GMS is 128px wide. This worked perfectly earlier even if I was stretching the game window. Why has adding more tiles to one background made the resolution go down by a factor of 4?
 
G

Guest User 1

Guest

This screenshot is of the game window at 1600x1000. Absolutely no stretching has happened at all.
 
G

Guest User 1

Guest
Here in this one, I've reduced the gap between each image on the background from 128px to 16px. The background is still the same size, yet it appears less pixel-y. All I have done is moved each image around on the one background image and it has improved. Why is this? Instead of taking a 128x136px image in 256x172px intervals, I'm taking a 128x126px image in 144x152px intervals. That is all that has been done. Nothing has been changed to do with views, game window, graphics, anything. I have moved some pixels around on an image. Why does that affect the resolution at which the game displays?
 
A

anomalous

Guest
Based on what you describe, you can check your original background on your texture page, it is probably scaled there and looks wrong.

One guess is that if you were using that big of a gap between your tiles on the background, you had a gigantic background image. Typically the gap should only be on the order of 2-8 pixels or so, hopefully that will keep your background image size within your texture page size.

This background image gets scaled automatically to fit your texture page size, so this would explain why when you decreased the gap, perhaps it auto-fit that smaller background without issue.


Also, not sure if you know but instead of round(random_range, you can use irandom_range if its appropriate.
 
Last edited by a moderator:
G

Guest User 1

Guest
texture page? What is its size? And how can I enlarge it significantly as I intend to have a very large number of further images on the one background, increasing its size by a factor far above 10.
 
A

anomalous

Guest
What were those two background image sizes in pixels?

You access that here:
Resources>> change global game settings> windows>>graphics

texture page size is on the right. Hit preview and it should pull up a directory with the texture pages (0, 1, 2, etc.), take a look at them.
I think default is 2048x2048, and it would be unlikely you would want/need to go above 4096 for windows. You can set it whatever the graphics card on the target device can handle, but compatibility-wise 2048 or 4096 (less so but maybe OK for PCs) seems where its at.

You will need to make your backgrounds fit on the texture page, not the other way around. GMS does all this stuff for you, all you need to do is stay within the size of texture pages. If you did this manually, it would take 10x longer and you'd still need to stay within the texture page size.

If you were only doing it out of convenience in coding, all you really need to do is now keep track of background and the x/y position on the background.
 
G

Guest User 1

Guest
I think they were about ~1500x~5000 so yeah it would have been breaching it. If you look at the code that selects the image, it takes the value for the block number and the height, then selects it through multiplication on the top and left coordinates in the tile_add() function. How could I just have it switch between multiple smaller backgrounds without needing massive blocks of if statements? The only way I can think of doing it would be to name all of the backgrounds in the format "bgr_ground_#" where the "#" is the block number. Then instead of cycling down one image, it would somehow convert the number into a string and attach it onto the end of the background name so that it chooses the right one, and that just sounds inconvenient.
 
Top