PDA

View Full Version : Random question (mostly/only) to/for the devs



Majora
11-12-2012, 09:27 PM
So I was playing Super Metroid again and it was laggy on my netbook. Then it ocurred to me that the graphics options were on kinda "high". Namely, scaling filters! Why can't ZC use those so that it doesn't look like crap at the bigger (anything above 640x480 pretty much) resolutions? Just curious. If Allegro doesn't continue to be a pile of inflexible garbage, I'd imagine that since there's pixel art scaling libraries/etc (i.e. what emulators use, hq2x, hq3x, Eagle, etc. etc.) already it'd be a simple matter, no?


Then again, I have zero idea how ZC handles graphics, and from what little i've seen they're handled in a hilariously ghetto fashion.


I'm sure this will become irrelevant when ZC goes open but for now...

(on another note, despite ZC seemingly being low-resource on the surface, it could benefit greately from being a multi-threaded program. Or more specifically, able to take advantage of multi-core CPUs or even the GPU, or both! But I have a vague impression that fiddling with hardware stuff would be a pain in the ass, to that extent. Again, ZC Open will possibly address this someday. :I)

Gleeok
11-13-2012, 04:39 AM
How does ZC look like crap at high resolutions? I removed the sbig stuff back during RC3 in favor of allowing users to set any arbitrary window size/resolution -- it should scale perfectly to any size rect while maintaining aspect ratio. If you are getting hardware stretching in full-screen you need to set res_x, res_y to match the ratio in your display settings.

I have no problem with adding an option to use any alternate (non-allegro) magnification-filtering algorithm to draw the screen in ZC. An option to use these can be placed in the config file and launcher, and perhaps a shortcut key as well. If someone wants to contribute one then be my guest. :).


ex:
[code]
void hq2x_blit(BITMAP* src, BITMAP* dest, int scale, int source_x, int source_y, int source_w, int source_h); // x,y,w,h; we don't need to scale entire source bitmap (black border pixels)


[edit] Actually, the size is always 224, 168 I think...

Majora
11-13-2012, 12:13 PM
http://code.google.com/p/hqx/source/browse/trunk/src/hq3x.c?r=2

Found the code! Fuck if I know how to splice it in. Hmm. http://www.hiend3d.com/hq3x.html

LinktheMaster
11-13-2012, 08:11 PM
Well, I will say that unfortunately ZC's current scaling, while really nice, isn't perfect in what it does anyway. I've noticed some resolutions tend to break it. While most of the common ones work (1024x768, 1280x720, etc.), some will just revert back to 320x240. I'm wanting to say the default netbook resolution (1024x600) did this, but I can't remember. I was doing testing for ZCM and found this problem.

Nicholas Steel
11-14-2012, 02:12 AM
How does ZC look like crap at high resolutions? I removed the sbig stuff back during RC3 in favor of allowing users to set any arbitrary window size/resolution -- it should scale perfectly to any size rect while maintaining aspect ratio. If you are getting hardware stretching in full-screen you need to set res_x, res_y to match the ratio in your display settings.

Oh? I didn't realize this! I was just using 640x480 under the assumption that higher resolutions still had massive black borders all around the screen.

Edit: Very awesome, no more shitty blurry upscaling! Hooray for crisp pixellated graphics!

Gleeok
11-14-2012, 05:00 AM
Oh? I didn't realize this! I was just using 640x480 under the assumption that higher resolutions still had massive black borders all around the screen.

Edit: Very awesome, no more shitty blurry upscaling! Hooray for crisp pixellated graphics!

I guess we need to start writing things down. :lol smily: I forget what stuff does all the time... >_>

Nicholas Steel
11-22-2012, 05:45 AM
I guess we need to start writing things down. :lol smily: I forget what stuff does all the time... >_>

I notice that it doesn't scale up the display at 1920x1080 as much as Zelda Classic 1.92b183. In 2.50 Release Candidate 5 at 1920x1080 there is about an inch of wasted space below the gameplay display and also above the gameplay display. In 1.92b183 at 640x480 with sbig=1 there is about 1 centimeter of wasted space above and below the gameplay display.

Anyways to have 1920x1080 fill in the empty vertical space while retaining correct aspect ratio?

Gleeok
11-22-2012, 03:30 PM
Unfortunately I don't have those display options. Can you post a screenshot?

Nicholas Steel
11-23-2012, 06:24 AM
Gleeok

1.92b183 (640x480, sbig=1)
http://i63.photobucket.com/albums/h133/franpa/th_2012-11-22191108_zpsc73351e1.jpg (http://s63.photobucket.com/albums/h133/franpa/?action=view&current=2012-11-22191108_zpsc73351e1.jpg)

2.50 RC5 (1920x1080)
http://i63.photobucket.com/albums/h133/franpa/th_2012-11-22191248_zpsf0579ec9.jpg (http://s63.photobucket.com/albums/h133/franpa/?action=view&current=2012-11-22191248_zpsf0579ec9.jpg)

Notice that in 2.50 the bright blue border fully surrounds the gameplay (And the faded blue border) while in 1.92 the faded border extends all the way to the top and bottom of the display? 1.92 scales the image up to fit 100% of the vertical space.

Gleeok
11-23-2012, 12:40 PM
Aha. I see what you mean now. Borders within borders... I'll add sbig back in for that I guess. :P

Can you check something? In the same settings as that pic, look in the 2.5 allegro.log and see if triple buffering is enabled.

Nicholas Steel
11-23-2012, 03:01 PM
Aha. I see what you mean now. Borders within borders... I'll add sbig back in for that I guess. :P

Can you check something? In the same settings as that pic, look in the 2.5 allegro.log and see if triple buffering is enabled.

Tell me the precise message it should say when Triple buffering is enabled. I can have it say "Triplebuffer available" when setting Double Buffer and Triple Buffer to 0 in ag.cfg, and I can have it say "Triplebuffer not available" when I set those values to 1. Either way it doesn't seem to do anything or at least has no impact on input lag, the same goes for vsync, setting that to 0 or 1 seems to have no impact on anything. Display is tear free so long as Cap FPS is set to 1, lots of screen tearing when set to 0 regardless of every other setting (as well as running at 2,000fps).

All this is tested in fullscreen mode.

Gleeok
11-23-2012, 04:11 PM
If it doesn't say anything then it's triple buffered. (unless you override in the config file.)

How is the off-screen background blue only in 2.5... Maybe I can add another option "bg_color" for this and have it default to 0 (black).


[edit] franpa: Does it look the same in 2.5 if you set the resx, resy to 640x480 and let your graphics card do all the work?

Nicholas Steel
11-24-2012, 04:19 AM
Yes Gleeok, 640x480 in 2.50 RC5 is identical in appearance/scaling to 1.92b183's 640x480 with sbig=1.

Gleeok
11-24-2012, 04:51 AM
So why don't you just use that then? ;)

It is working as expected then; at 1920x1080 you get a x4 scale to 1280x960, which leaves 60 pixels on the top and bottom of the main screen. It's always preferable to let your graphics card do what it's good at rather than have allegro do it in software (and less good I might add) when it comes to mag filtering/fitting to a display/whatever.

It shouldn't be blue like that though. I'm still looking to see what's happening there...

Nicholas Steel
11-24-2012, 06:04 AM
It shouldn't be blue like that though. I'm still looking to see what's happening there...
Gleeok, the surrounding space is only blue while you have paused the game with the Escape key. You'd think letting the video card/monitor scale it would be fine, however it adds a blur to the picture kinda like bilinear filtering but not quite as bad.

Gleeok
11-24-2012, 02:57 PM
Gleeok, the surrounding space is only blue while you have paused the game with the Escape key.

Gah. That explains why I couldn't find it. (I should of noticed the little drop-down menu in that pic.)

Like majora said though, if allegro stretches the display it uses a nearest neighbor algorithm and looks like crap. (run an older version in 800x600 to see it). I don't know what you want me to fix. :shrug:

Nicholas Steel
11-24-2012, 04:20 PM
Nearest Neighbor is good though, specifically because of the fact that the game uses low resolution tiles for graphics so any kind of blur greatly reduces the amount of details in the graphics. Having it scaled with some blurry filter like what monitors and even the GPU does, can make it notably harder to identify hard to see secrets like cracks indicating a wall can be bombed.