# How to adjust for screen resolution?

This topic is 4976 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I'm sure this question has probably been asked before, so if you wanna just point me to other threads that've answered it that's fine, or you can just give me answers yourself. I wasn't able to find too much doing a quick search: When you want to give the user the option of specifying the screen resolution, how do you specify movement amounts, and the size of textures/graphics? What I mean by this is currently I have my game set to 640 x 480, and when the user presses the left arrow their character walk 10 pixels to the left. Now if I was to change the screen resolution to 800 x 600, if I still move have the character move only 10 pixels when they press left, they won't be walking "as far" as before, relative to the world around them. How do you avoid this problem? Use percentages of the screen height/width instead of pixel values? or just multpily the movement velocity by some ratio value? For example, when running at 640 x 480 multiply the XYZ movement values by 1, when running at 800 x 600 multiply the XYZ movement values by 1.25 (800/640 = 1.25 and 600/480 = 1.25) and so on? And the same thing goes for applying the graphics. If I draw a 100 x 100 character on 640 x 480, it is going to appear much "larger" on the screen than if I was to draw it on 800 x 600, but I believe you want everything to still stay the same size on the screen, it should just be more detailed on the larger resolution (because it's using a higher resolution). How do you avoid this? Scale all the graphics according to the screen height/width by some factor (1 for 640x480, 1.25 for 800x600)? So I guess what I'm asking is do you just render everything in terms of a percentage of the screen size from the get go, or do you just code the game specifically for one screen size first, then scale it according to some other value if need be (such as 1.25 for 800 x 600). Or is there another way to do it that I'm not thinking of? Thanks!

##### Share on other sites
Either way would work fine, I can't imagine one being inherently better than the other.

However, if you choose one resolution to be the "base" resolution, I would go for a higher resolution than 640x480. The primary reason being that if you design all your artwork to look good at 640x480, it's going to look pretty ugly at 1600x1200 since you'll have to stretch it. On the other hand, if you design all your artwork for a high resolution screen, it should scale down to 640x480 reasonably well. (In other words, it's always better to scale images down than it is to scale up).

##### Share on other sites
These were just my guesses on how it could be done. Is this the technique they use in commercial games?

##### Share on other sites
Distance is often defined in world units instead of screen units. That way it doesn't matter in what resolution it's displayed. If your world is larger than the window in which it is displayed, you can simply show more of the world, and keep distances and sizes at the same pixel amounts. I think that's what older, sprite-based RTSs did.

##### Share on other sites
look at starcraft, one resolution only, they didn't want to re-draw all the sprites for different resolution, and they didn't want some players to have an advantage by being able to see more of the map at higher resolutions.

Modern games can use higher resoultion because they're mainly 3D, and higher res just means sharper 3D images

if you feel like drawing all your artwork twice, do like an 800 x 600 version and an 1024 x 768 version, or something like that.

if you don't re-draw your artwork for higher resolutions, but just have your game 'scale' up your artwork, then what's the point of the higher resoultion? you won't be getting more detail out of "scaled" artwork

##### Share on other sites
Quote:
 if you don't re-draw your artwork for higher resolutions, but just have your game 'scale' up your artwork, then what's the point of the higher resoultion? you won't be getting more detail out of "scaled" artwork

Like The Senshi said, you should draw your artwork for the higher resolution, then scale it down if you need. In this case, there would be a 'point' to it as the higher resolutions would look better.

The reason I was wondering is I was taking a look at some of the Windowed games in the GD Showcase, and some were very small because they ran at a set resolution. In these cases it would be nice if you could adjust it to a higher resolution. But for full screen games 2D games your right, there wouldn't be much of a noticable difference.

##### Share on other sites
Quote:
 Original post by deadlydogThese were just my guesses on how it could be done. Is this the technique they use in commercial games?

The menu screen in Quake 3 is scaled up to the current from 640x480, so yes some games are using this technique.

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 19
• 15
• 10
• 9
• 11
• ### Forum Statistics

• Total Topics
634097
• Total Posts
3015510
×

## Important Information

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!