Game Development Community

Resolution - who, what, why, how?

by Matt Troup · in Torque Game Builder · 11/08/2005 (2:20 am) · 13 replies

I've always been a bit confused on the subject of image resolution. I'm going to say a LOT of silly things (I'll start with a fairly focused paragraph and add more later so I don't seem like a ranting lunatic). Bear with me.

When I open a new file in photoshop I get to choose the resolution of the image. The default I have is 72 DPI. If I type a higher dpi in the text box the image size does not escalate (for a 128x128 image at 16bit color it is 96K for both 72dpi and 100dpi). So, I figure the issue with file image resolution has to do with processing power (I'm not quite sure whether it has to do with real time power or pregame loading power). Considering the image's purpose (video game) it wouldn't be unreasonable to select a higher dpi would it?. That has to add a good 30 dpi, right? Plus, I'd like to give my images the justice they deserve, now matter how amature they may appear, so that should add another couple million dpi. Heh. Seriously, with the power our machines have today I wouldn't suspect a slight rise in dpi would bog things down too much - especially for some primitive 2D action.

What variables should I consider when choosing the dpi for my in-game images? The resolution the game is being played at? The size of the screen? I have a feeling I'm getting those variables a mixed up, or I don't have the correct understanding.

#1
11/08/2005 (2:37 am)
I belive what the difference is is canvas size VS image size.

the reason why your 72dpi and 100dpi images are the same kb size is that basically nothing has changed (the overall size changed when you increase the resolution).

to do otherwise would require your image to resample (dither?), which is a lossy process.

i unfortunatly dont know much more about image sizes beyond that, but hope that helps.

-------------------

as for your dpi for game images, it depends on if you need to zoom in on an image. if you will never do that, then 72dpi is fine. if you do, then just make sure however far you zoom in has about 72dpi per inch, and your good.
#2
11/08/2005 (2:47 am)
Hmmm. So, if I have that first part right, because my actual screen resolution did not change that was no difference? Would this then mean a Torque 2D game running at 1024 x 768 has the potential to run slower than a game running at 640 x 480?
#3
11/08/2005 (4:30 am)
Matt ...

Assuming RGBA ...

At 640x480 there are 307200 pixels on the screen. That is 1.17MB of data.
At 1024x768 there are 786432 pixels on the screen. That is 3MB of data.
Now double those to take into account the back buffer.

In other words, at 1024x768 the gfx card has to push roughly 3 times as many pixels as it does at 640x480. It doesnt have the potential to run slower, it does run slower.

Now, how much slower and whether the game is still playable is a whole different question.

Re: DPI...

DPI refers to dots per inch. It is used to calculate the number of pixels to draw in 1 inch when the image is printed. Therefore, a 128x128 image at 72dpi, when printed will be 1.7" x 1.7". The same 128x128 image printed at 200dpi will be 0.64" x 0.64" on the paper. To print a 1.7" x 1.7" image at 200dpi, the image would need to be 340 x 340 pixels. In other words, it's not something you have to worry about for games. Pixel size is what is important, DPI has no effect since the monitor's DPI is fixed.

T.
#4
11/08/2005 (11:45 am)
Wow. That makes much more sense... dpi wise.

As far as screen resolution/screen size: It appears I should worry more about pixel dimentions when dealing with image integrity. For instance, changing my screen's resolution to 1024x768 and then drawing my sprites in a graphics program will not help... I should instead decide whether or not to draw sprites in a 64x64 box or a 128x128 box, etc, and make each decision based on the dimention relation to other sprites in the game so when the game is played on a 15 inch screen instead of a 20 inch some artifacts will not be scaled improperly while others still look smooth.
#5
11/08/2005 (1:38 pm)
You dont have to worry about any of that. In the doc directory there is a basic tutorial which goes through the whole co-ordinate system thing, which you should probably read. It will clear a lot of things up.

T.
#6
11/08/2005 (9:13 pm)
Hmmm. Weird. Yeah, image integrity doesn't seem to be a problem. What I've found, though, is that I'll have to worry about the dimentions of the player's screen. I truly dislike games being run in a window... full screen or nothing with me. So, when a game is running on my wide screen laptop the images look short and stubby.

I come from the arcade world where everything is standardized. With PC games it's completely wild. Everyone has different amounts of raw power, screen real estate, etc. Is there a way this stubbiness is usually handled? Is the idea to check to see what type of screen the user has on startup and add black bars on the sides? I can't tell if I'm understanding more or getting more lost.
#7
11/08/2005 (9:27 pm)
You should keep an aspect ratio. such as 1.5x1 or something of the sort.

with widescreens, it's not that the pixels are streched, so keeping an aspect ratio would work (of course the side of the screen will be blank, but that's ok right? maybe u can put GUI controlls there)
#8
11/08/2005 (9:38 pm)
Ah, ah. I see. I'll read more into aspect ratios. Thanks for the help, Jason and Tom, I appreciate you guys taking the time to teach me about this subject. The tech parts and the art parts of my brain have been duking it out over this for way too long.
#9
11/09/2005 (6:18 am)
Matt,

The reason I pointed you towards reading the tutorial doc is that it explains that T2D uses its own co-ordinate system. Thus, the game looks exactly the same regardless of resolution. You setup the co-ord system you want to use when you setup the camera. It's pretty simple. Widescreen might still be an issue, but I'm not sure.

The easiest way (i think) to deal with it is this: Set up the camera to use an co-ord system that resembles 800x600 on the screen using something like sceneWindow2d.setCurrentCameraPosition("0 0 800 600"); Make your art to look good in that res. If you make your game throughout with that in mind, you'll have a 1:1 mapping of image pixels to screen pixels. However, T2D will scale for other resolutions, and (in theory) it will look the same.

The one caveat is the Torque GUI system. If you're using that for HUD or menu stuff then it can be a pain to get looking right in multiple resolutions. Your profile says you're a TGE owner, so I would suggest going through the TGE private forums. There should be a lot of threads on the GUI and getting it to look good. You probably dont have to worry about that for a while yet, though.

T.
#10
12/11/2005 (11:17 am)
My image is turning out blurry and im trying to make it look how it looks in photoshop, ingame.
any suggestions would be helpful thank you.
heres what i got.

Ok, so i created an 800 * 600 image in photoshop.
I changed my scene window to sceneWindow2D.setCurrentCameraPosition( "0 0 800 600" ).
im using the image as the background bitmap in mainScreenGui.
in mainScreenGui i changed

GuiChunkedBitmapCtrl(mainScreenGui) -> extent = "800 600";
t2dSceneWindow(sceneWindow2D) -> extent = "800 600";

well here is the top of my mainscreen gui

new GuiChunkedBitmapCtrl(mainScreenGui)
{
profile = "GuiContentProfile";
horizSizing = "width";
vertSizing = "height";
position = "0 0";
extent = "800 600";
minExtent = "0 0";
visible = "1";
bitmap = "./images/MyImage";
useVariable = "0";
tile = "0";

new t2dSceneWindow(sceneWindow2D)
{
profile = "GuiContentProfile";
horizSizing = "width";
vertSizing = "height";
position = "0 0";
extent = "800 600";
minExtent = "0 0";
visible = "1";
lockMouse = "0";
};
new GuiMenuBar(mainScreenMenu)
{
profile = "GuiMenuBarProfile";
horizSizing = "width";
vertSizing = "bottom";
position = "0 0";
extent = "800 22";
minExtent = "8 2";
visible = "1";
};
};

not sure y this isnt displaying 1to1.

Thanks for your time.
#11
12/12/2005 (11:47 am)
Anybody?
#12
12/12/2005 (7:33 pm)
I think you have to enable the nearest neighbor filter, but I'm not sure if it's in the 1.1alpha.
#13
01/27/2006 (11:51 pm)
@Lyle, i know that there is a .jpg quality setting that can be set somewhere, have you looked at that?