Jump to content
  • Advertisement
Sign in to follow this  

Multi-Resolution Raster Graphics

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

3D games these days all allow the user to chooose between a myriad of display settings, but true 2D games are still following old methodologies. Do you believe it is important to have good multi-resolution support in a true 2D game? Is it most important for some LCD screens that only look crisp at the native resolution? Are LCDs going to become more popular in the future? I believe the trick is to create the graphics at the highest supported resolution and scale down from there. Using 3D acceleration, the scaling is trivial but ugly. The images must be scaled down beforehand with cubic interpolation and other processing. Doing such tasks by hand is tedious, writing a script or tool would be a better idea. However, having image sets for 3 to 5 resolutions would make the file size too large. Therefore the images should be scaled down either once right after installation or only when the user requests a certain display resolution. Doing it with the program and not by hand might create wasted texture space. Usually spritesheets and tilesheets are optimized to fit on 2^x textures, and after a scale-down a simple test might be done to see if the new texture could fit in a smaller 2^x texture. Not to mention the UVs are different at the smaller resolutions (may or may not be a problem depending on the code/engine). Another solution is to have the images stored separately and pieced together by the program when textures need to be loaded. This allows better texture usage (depending on the algorithm might be as good as by hand). The resulting system might be rather complex. I believe EDI wrote something in his journal about this. When dealing with animations and swapping textures, I wonder how this system would work. Other tricks for supporting different resolutions include centering a smaller display and, if the genre of the game permits, simply clipping the viewport. So, given the ease of hard-coding a resolution that "everyone" can support (640x480, 800x600) and the troubles involved in offering other resolutions, is it worth it? Is 1024x768 an acceptable resolution for today's 2D games? Articles on the subject? Thoughts? Examples of games with stellar multi-resolution support? Bodhi Crandall-Rus

Share this post


Link to post
Share on other sites
Advertisement
Probably obvious, but the game logic should go beyond the pixel at this point. Depending on the game it might be easier (tile-based, puzzle, board game) or harder (action games) to make the game logic pixel-independent. Remember that extra hard 50 pixel jump in the third level, it suddenly became 70 pixels and the player has to get across somehow.

One possibility is to use the largest resolution supported as the basis for the other resolutions. This offers the most precision in the game logic. Of course, floats/doubles should be used for position, movement, etc. When rendering, you have to be careful to scale so that the 1:1 texel to pixel ratio is achieved. Is it even worth worrying about correct pixel mapping to the screen?

For high-resolution, aliased graphics, pixel-perfect collisions don't make much sense anymore. Again using the highest resolution for the most precision, masks could be created of the sprites to allow for pixel-precise collisions and reactions.

If the pixels don't have to be perfectly mapped, you could use the same orthographic projection as the highest resolution. I haven't tested the results of such a procedure, or have I?

Share this post


Link to post
Share on other sites
Quote:
Original post by Boder
Remember that extra hard 50 pixel jump in the third level, it suddenly became 70 pixels and the player has to get across somehow.

Display information and player positon information should be kept separate anyway. Where the player is releative to the next obstacle, should be used to determine how it is rendered but it should not be based on that actual rendered output.

Also, floats aren't better by default you can use integers and still have accuracy and possibly better performance.

Share this post


Link to post
Share on other sites
Definitely should, but I think there are quite a few games that use world units as pixel units without realizing it. Since it removes one step (having to worry about scaling and projecting onto the screen) by having the pixelized screen a perfect fit into the pixelized game world, I think there are developers who see it as an easy solution.

Can you think of examples of multi-resolution true 2D games? By "true" I mean that it uses textured quads or bitmaps (sprites) and not little triangles to make images.

Share this post


Link to post
Share on other sites
I prefer to make my games use a configurable window size.
It makes no difference to the game logic, or even the rendering.
What I do is simply make the window selected size, but use a constant orthographic setup - lets say 800*600. The graphics are then mapped to that resolution.

Share this post


Link to post
Share on other sites
Quote:
Original post by Boder
...
I believe the trick is to create the graphics at the highest supported resolution and scale down from there.
...
The images must be scaled down beforehand with cubic interpolation and other processing.

...

Articles on the subject? Thoughts? Examples of games with stellar multi-resolution support?

Bodhi Crandall-Rus


Check out this site:
http://www.theprodukkt.com/werkkzeug1.html

Werkkzeug is a tool to generate (among other things) textures by an algorithm. By storing just the algorithm to generate a texture the data files become tiny and resolution independent. Using such a description you can generate the texture data when needed (i.e. at program start) in the resolution that is required.

Share this post


Link to post
Share on other sites
I'm of the oppinion that in a 2D game its not a sin to simply select one resolution and run with it. For most users its not an issue, though as you hit upon, there are concerns for users with LCDs due to their fixed resolution.

I really don't see the 'ugliness' of real-time scaling via a 3D API, proper settings should yield good looking results. Perhaps even using source material that is higher resoultion than the highest supported resoultion(Thought, much higher and it would be more space-efficient to provide pre-made art for each resolution.) Failing that, a load-time resampling is another good solution and one which is not terribly difficult to implement. This will most definately require that game logic is decoupled from the resolution, but it should be anyhow.

Also keep in mind that its much more difficult to design 2D art resources for a multi-resolution environment, creating a tile with text or some important detail is difficult to do when the lowest resolution may be 1/4th that of the highest (ie 640x480 vs. 1280x960) You also have to keep in mind that the most popular desktop LCD resolution is 1280x1024 which is not a standard 4:3 aspect ratio.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!