Fixing screen resolution ideas

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
User avatar
Gunroar:Cannon()
Party member
Posts: 1085
Joined: Thu Dec 10, 2020 1:57 am

Fixing screen resolution ideas

Post by Gunroar:Cannon() »

So I got a complaint about the screen resolution from one guy who played my game in its bare stage (Dust: Battle Beneath)
I'm not sure what resolution it's meant to be in, but on my 1920x1080, the avatar was barely a centimeter tall and I saw the entire level - kinda felt like its zoomed out (but I dont know).
(I work on a 1280x800 resolution screen)

Now I'm wondering whether anyone has any ideas or advice on fixing screen resolution. Like, for example, should I go with using a camera...
In that everything is drawn to a canvas at a base resolution and then that canvas is scaled to the final screen using the nearest filter mode. This is how a chunky pixel look can be achieved and it's generally how pixel art is scaled in games.
...or using something like "push"?
Should I also scale ui or should I use the methof where I make all the ui relative to the real screen width (e.g.Button.w=screenWidth*.7)?
And what's pixel perfect?
The risk I took was calculated,
but man, am I bad at math.

-How to be saved and born again :huh:
User avatar
togFox
Party member
Posts: 764
Joined: Sat Jan 30, 2021 9:46 am
Location: Brisbane, Oztralia

Re: Fixing screen resolution ideas

Post by togFox »

I use this on EVERY project automatically.

https://love2d.org/wiki/TLfres

About four lines of code and you never ever need to think about it again.
Current project:
https://togfox.itch.io/backyard-gridiron-manager
American football manager/sim game - build and manage a roster and win season after season
User avatar
darkfrei
Party member
Posts: 1168
Joined: Sat Feb 08, 2020 11:09 pm

Re: Fixing screen resolution ideas

Post by darkfrei »

My multiresolution (even 4K) rendering:
Attachments
multiresolution-01.love
(2.21 KiB) Downloaded 253 times
:awesome: in Lua we Löve
:awesome: Platformer Guide
:awesome: freebies
User avatar
Gunroar:Cannon()
Party member
Posts: 1085
Joined: Thu Dec 10, 2020 1:57 am

Re: Fixing screen resolution ideas

Post by Gunroar:Cannon() »

Hmmm, I'll check out TLfres. So I should also scale ui? How would I make a camera work+tlfres/a scaling lib?

@darkfrei, how does it work?
The risk I took was calculated,
but man, am I bad at math.

-How to be saved and born again :huh:
User avatar
darkfrei
Party member
Posts: 1168
Joined: Sat Feb 08, 2020 11:09 pm

Re: Fixing screen resolution ideas

Post by darkfrei »

Gunroar:Cannon() wrote: Tue Oct 12, 2021 7:45 pm Hmmm, I'll check out TLfres. So I should also scale ui? How would I make a camera work+tlfres/a scaling lib?

@darkfrei, how does it work?
It makes a virtual 1920x1080 screen and moves/scales this resolution to the current window. Also you can make any high-resolution canvases and render it too, so it will be shown as native resolution on 4K monitors. Press F11 to set the fullscreen mode.
:awesome: in Lua we Löve
:awesome: Platformer Guide
:awesome: freebies
User avatar
knorke
Party member
Posts: 237
Joined: Wed Jul 14, 2010 7:06 pm
Contact:

Re: Fixing screen resolution ideas

Post by knorke »

Gunroar:Cannon() wrote: Tue Oct 12, 2021 12:20 amAnd what's pixel perfect?
I think in this context it usually means two things:
1) 1:1 aspect ratios: Pixels are squares.
For example a fullscreen-game with 4:3 resolution shown as fullscreen on a widescreen 16:9 monitor would stretch the picture. So it would not be pixel perfect because now the pixels are stretched rectangles instead of squares.
One way to fix it would be letterboxes / pillarboxes.

2) One rendered pixel maps excactly to one hardware-pixel of the display. For example the game is 800x600 and the display is 800x600 too. If the display is 1600x1200 then it would still be pixelperfect, just that each rendered pixel gets shown as 2x2 hardware pixels. But if the display is 1024x768 and the game is still 800x600 then it is not possible to have this 1-to-1 mapping of rendered pixels to hardware pixels: As result pixels/edges become blurry because the OS/graphic drivers try to find a compromise for showing one rendered pixel as 1.28 pixels wide.

I also use TLfres. There is forum thread too: https://love2d.org/forums/viewtopic.php ... lit=tlfres
So I should also scale ui?
Imo it depends on the game and UI. It can be annoying if the UI gets too small on high resolutions. In other cases it is welcome if the UI takes up less screen space. Also, when possible the UI should not only change size but imo also make use of the extra pixels.
Compare these two videos of C&C Tiberian:
https://www.youtube.com/watch?v=6wJUqhzhzTg
https://www.youtube.com/watch?v=zD9nPC7FdOs
Low resolution: The build-menu shows 7 lines.
High res: Now the menu has 10 lines.
User avatar
Gunroar:Cannon()
Party member
Posts: 1085
Joined: Thu Dec 10, 2020 1:57 am

Re: Fixing screen resolution ideas

Post by Gunroar:Cannon() »

knorke wrote: Thu Oct 14, 2021 2:26 am ...
Wow, thnx for all the info, knorke!

The screen with the ui elements that I want to scale is like:

Image
For drawing the menu I use a relative screen size. Loke a button is love.graphics.getWidth()*.07, is that fine?
The risk I took was calculated,
but man, am I bad at math.

-How to be saved and born again :huh:
Post Reply

Who is online

Users browsing this forum: No registered users and 18 guests