Possible to adjust artwork for various resolutions?

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Message
Author
User avatar
Siben
Newbie
Posts: 6
Joined: Mon Dec 10, 2012 11:31 pm
Location: 518 NY
Contact:

Possible to adjust artwork for various resolutions?

#1 Post by Siben »

  • Is it possible to:
  • Declare dynamic variables for the gamewindow/full screen resolution?
  • And then modify image sizes to fit said resolution at start-up or when changed in the options
My problem is that I'm a SUPER-STICKLER about build quality in the final product. I want to eventually develop a commercial release so I want to develop a workflow aimed towards that goal. I can understand saying, "Just format all the images for 1 resolution" but I know that is an extremely unprofessional approach. Ideally I would want to develop my art assets "over-resolution" and then scale them down so if people want to play at 1680 x 1050 they can and then if they want to window it down to something smaller or vice-versa there is no loss of fidelity.

Edit: I redacted out a bunch of the original post as I managed to do some more investigation on my own and solved some of the other problems I was having. Sorry for that.

Levrex
Veteran
Posts: 280
Joined: Mon Jun 18, 2012 12:16 pm
Contact:

Re: Possible to adjust artwork for various resolutions?

#2 Post by Levrex »

It completely is. However, Ren'Py default interpolation is kind of... old, so you'll get a not very good looking pic with im.Scale.

Basically:
1) Get a game resolution. It depends on means by which you define it.
2) Optionally, declare a persistent variable depending on the said resolution: if you set resolution by some button, use
  • on that, which includes SetField(persistent, "res_images", 4) - something like that, of course. Although you'd have to restart the game after applying changes if you don't like completely perverted ways.
    3) Add so many copies of scene-declaring blocks as many resolutions you want your game to have, each depending on game resolution or persistent variable. AND IM.SCALE EACH SCENE IN A BLOCK BY COPY-PASTE METHOD HOWEVER YOU WANT. I recommend to get game resolution, use variable to store it, then use the said variable instead of scale width and height numbers. That way you'll need only one block with im.Scaled scenes.
If your question is solved, please add [Solved] to theme's name by editing its first post, so that the helpful guys out there wouldn't mistakenly think the problem is still unanswered and waste their time.

User avatar
Siben
Newbie
Posts: 6
Joined: Mon Dec 10, 2012 11:31 pm
Location: 518 NY
Contact:

Re: Possible to adjust artwork for various resolutions?

#3 Post by Siben »

I think I'm ok with forcing a restart on change...I think ideally I'd set it up for a maximum of 1680 x 1050 for all of the actual assets and give an option for 1440 x 900 and a 1024 x 786 so that way it could feasibly fit on most standard displays, pass the resolution and downscale appropriately. I just really don't want to do everything @ 800 x 600 cuz it's too damn small. Gots ta drool over artwork y'know?

User avatar
nyaatrap
Crawling Chaos
Posts: 1824
Joined: Mon Feb 13, 2012 5:37 am
Location: Kimashi Tower, Japan
Contact:

Re: Possible to adjust artwork for various resolutions?

#4 Post by nyaatrap »

It programatically can, but there is a quality problem.
Ren'py doesn't support bicubic and it's resizing range in good quality is 60~90%.
If you want to support many resolutions in good quality, you need to prepare several sizes of all images.

User avatar
Siben
Newbie
Posts: 6
Joined: Mon Dec 10, 2012 11:31 pm
Location: 518 NY
Contact:

Re: Possible to adjust artwork for various resolutions?

#5 Post by Siben »

Hm, depending on how efficient I can get the images that might not be a problem...is it mainly an issue with jpegs or are png's affected as well? I thought pngs were supposed to be lossless.

User avatar
nyaatrap
Crawling Chaos
Posts: 1824
Joined: Mon Feb 13, 2012 5:37 am
Location: Kimashi Tower, Japan
Contact:

Re: Possible to adjust artwork for various resolutions?

#6 Post by nyaatrap »

Ren'py uses bilinear and it causes blur (80%~) or aliasing(~70%). This quality problem is larger than the difference of jpeg/png.
In my game, I'm using 2 sizes - 2560px and 1536px for each sprites. to support under 60% resizing.

User avatar
Siben
Newbie
Posts: 6
Joined: Mon Dec 10, 2012 11:31 pm
Location: 518 NY
Contact:

Re: Possible to adjust artwork for various resolutions?

#7 Post by Siben »

Oh so you're upscaling so large that the downscale to fit on screen is more than 60% to get around the bilinear sampling?

User avatar
nyaatrap
Crawling Chaos
Posts: 1824
Joined: Mon Feb 13, 2012 5:37 am
Location: Kimashi Tower, Japan
Contact:

Re: Possible to adjust artwork for various resolutions?

#8 Post by nyaatrap »

No, I only support 1280 x 768 resolution. But I'm using many zooming animations inside of the game, so I need at least 2 sizes for quality and performance reason.
I barely use upscale - I always draw or make images more than 3000px, and resizes them into 2~3 sizes with bicubic for the actual game.

User avatar
Siben
Newbie
Posts: 6
Joined: Mon Dec 10, 2012 11:31 pm
Location: 518 NY
Contact:

Re: Possible to adjust artwork for various resolutions?

#9 Post by Siben »

ahhhhhhhh, good to know. thanks!

User avatar
EwanG
Miko-Class Veteran
Posts: 711
Joined: Thu Oct 26, 2006 5:37 pm
Location: San Antonio, TX
Contact:

Re: Possible to adjust artwork for various resolutions?

#10 Post by EwanG »

So what y'all are suggesting is build images for each of the "supported" resolutions - according to statcounter those should be 1366 x 768, 1280 x 800, and 1024 x 768 - ask the user to pick one, and then restart the game. So far I think I have a picture in mind of how I would do that. Would I then have three versions of each image defined - for example:

Code: Select all

    image bg streetSceneCloudy_1024 = "Street scene cloudy 1024.png"
    image bg streetSceneCloudy_1280 = "Street scene cloudy 1280.png"
    image bg streetSceneCloudy_1366 = "Street scene cloudy 1366.png"
And then throughout the game have a switch like:

Code: Select all

    if Screen1024:
        scene bg streetSceneCloudy_1024 with fade
    elif Screen1280:
        scene bg streetSceneCloudy_1280 with fade
    else:
        scene bg streetSceneCloudy_1366 with fade
Or is there something simpler I'm missing?
Working on something... might even be something good :D

User avatar
mirelle
Regular
Posts: 87
Joined: Thu Nov 29, 2012 11:28 am
Projects: The Story of X
Organization: Vocamania
Location: Indonesia
Contact:

Re: Possible to adjust artwork for various resolutions?

#11 Post by mirelle »

If you know how to work conditionswitch, that can be transformed into something much more simple.
[[The X Story]]
Discover the hidden truth within-- but be reminded that more often than not, curiosity kills the cat.
lurking here as a representative of the team~

User avatar
EwanG
Miko-Class Veteran
Posts: 711
Joined: Thu Oct 26, 2006 5:37 pm
Location: San Antonio, TX
Contact:

Re: Possible to adjust artwork for various resolutions?

#12 Post by EwanG »

mirelle wrote:If you know how to work conditionswitch, that can be transformed into something much more simple.
For example? Always open to learning better ways to do things!
Working on something... might even be something good :D

User avatar
jack_norton
Lemma-Class Veteran
Posts: 4085
Joined: Mon Jul 21, 2008 5:41 pm
Completed: Too many! See my homepage
Projects: A lot! See www.winterwolves.com
Tumblr: winterwolvesgames
Contact:

Re: Possible to adjust artwork for various resolutions?

#13 Post by jack_norton »

Honestly for my games I support only one resolution, in 16:9 aspect ratio. For past games was 1024x576 but for the new ones might try 1280x720. I use scaling on sprites and it's not that bad honestly, I guess depends how they're drawn. If the coloring style is cell-shading or something like that, I really don't think the result is bad!
follow me on Image Image Image
computer games

User avatar
EwanG
Miko-Class Veteran
Posts: 711
Joined: Thu Oct 26, 2006 5:37 pm
Location: San Antonio, TX
Contact:

Re: Possible to adjust artwork for various resolutions?

#14 Post by EwanG »

jack_norton wrote:Honestly for my games I support only one resolution, in 16:9 aspect ratio.
In that case, what happens if someone brings it up on a much smaller resolution? I'm game (heh) to do everything at the 1366 option and let things downscale, but once upon a time that used to result in black bars or even occasional crashes. Still an issue?
Working on something... might even be something good :D

User avatar
jack_norton
Lemma-Class Veteran
Posts: 4085
Joined: Mon Jul 21, 2008 5:41 pm
Completed: Too many! See my homepage
Projects: A lot! See www.winterwolves.com
Tumblr: winterwolvesgames
Contact:

Re: Possible to adjust artwork for various resolutions?

#15 Post by jack_norton »

Well if the game is 1024x576 the problem is mostly at higher resolution - for the backgrounds there isn't much to do, but for the sprites Ren'Py has a very smart system that I explained in other occasions. In practice the important is to have sprites at high quality, like height of 1024px. Then if in the game you display them at .5 so that they show up 512px in height at 1024x576px, if the user goes fullscreen at 1680x1050, the sprites scale in a way to still occupy the same space, but at higher resolution, less zoomed out.
A bit hard to explain it, I remember I did a better explanation a while ago and I posted even some screenshots of the same game running at two different resolutions.

Of course if people have a 4:3 resolution or 16:10 you'll see black bars, but that's really a minority (most monitors are 16:9 now).
follow me on Image Image Image
computer games

Post Reply

Who is online

Users browsing this forum: No registered users