Screenshot bug?

Started by Joseph, Tue 29/09/2009 17:36:23

Previous topic - Next topic

Joseph

Hi GUYS...and uh, gals....

Ive run into a possible snag-a-roonie (in 2 parts) with the screenshot feature and Im not sure if its a bug though. Here is the prob:

Part 1
Ive been using the template A.S.S.
http://www.adventuregamestudio.co.uk/yabb/index.php?topic=38928.0

for saving with screenshots. Ive got it to work ok. When I save, I see a nice screenshot (good graphics), but when I load, the screenshot seems "scaled down" in quality...like more pixelated...is this a bug? I contacted the author and did everything OK (kept the aspect ratio to 4:3 for the button that shows the screenshot)...etc

Part 2
This is even weirder! So I got the screenshots to work...but when I export the whole game folder + savegame folder to abother computer...that works (I can load the screenshots ok) BUT...when I try to save a new savegame + screenshot, it seems it loads a transparent image that cuts through my GUI...Why does it work on one computer, and not the other one?

The cpu it works on is windows vista 64 bits...the one it doesnt is XP 32 bits.

Im dumbfounded!

And dumb.
Spread the love...One.Turtle.At.A.Time.
http://www.youtube.com/watch?v=y0A77rohcyg

monkey0506

#1
Well firstly you do of course realize that any time an image is down-scaled there is an inherent loss of information, don't you? Think about it, if the original screenshot is 320x200 that means that the image is three hundred and twenty pixels wide by two hundred pixels tall. That's a total of 64000 (sixty four thousand) pixels available for displaying the image. Each pixel can display one single color.

If you take that same image and shrink it to half the size (160x100) the resulting image will have only A QUARTER of the pixels of the original (160x100 = 16000 pixels). That means that 75% of the pixels are now gone. That's a very significant portion. And again, with each pixel only being able to represent one single color, that could potentially result in a large amount of color loss as well.

As far as the template not functioning properly on the second system that sounds like a completely separate issue. There are a lot of factors that could be the cause of the problem and we might need more information on what exactly it is that you're doing when this issue crops up. Any relevant code you might be using, anything you might be doing in any way different at all between the two systems (especially game setup), etc.

Also the title of this thread is rather vague. The issue is specifically related to the A.S.S. template and that should probably be indicated in the title. At first glance the title seems to suggest a bug in AGS's screenshot functions.

Pumaman

What size is the button that you're displaying the savegame screenshot on?

The actual screenshot is scaled down to 160x100 by default, if your button is bigger than this then it will be pixellated. You can set the game.screenshot_width and game.screenshot_height variables in game_start to override this if you want.

hedgefield

That's interesting CJ, I didn't know you could set that size.

I've defined the screenshot size in my template with #define SL_WIDTH  128 and #define SL_HEIGHT 96 and it creates a dynamic sprite with that for the GUI button of the same size.
But when it saves the game it scales the actual screenshot down to 160x100? That's a widescreen aspect ratio isn't it? I built and tested it on 640x480 so the pixelation is not terribly noticeable to me, but I believe Joseph was running it at 1024x768 with a 320x240 button, where I can imagine it becomes quite noticeable.

Joseph

#4
Yes, exactly! Ive tried at various sizes, and its quite noticeable at larger resolutions.

Ok, so then if it scales it down to 160 x 100, then with the template it resizes it back up to whatever values #define SL_WIDTH  and  #define SL_HEIGHT are set to.

So now I understand why the save screenshot preview looks "ok" but in the load preview its pixelated!

Ok, so in game start I will set game.screenshot_width and game.screenshot_height to the values of #define SL_WIDTH  and  #define SL_HEIGHT  aswell.

Ill let you now whats up with that.

For the 2nd problem, I didnt change ANYTHING at all...I copied everything in my game folder and just pasted it into the 2nd computer...on one the screenshots work, on the other, the screenshot "eats thru" the GUI...without changing a single thing (script, art, modules, you name it).

I can provide someone with a test game if they want...and send it to them by email if they would liek to see whats up.

Im not sure what more information I should provide though! :(

**EDIT**

Ok, I imported my whole game  folder into a 3rd computer (a friend's,,,windows vista)...and the save screenshots work OK too...so I have 1 cpu (windows xp 32) that the screenshots dont work ok...instead of seeing a screenshot loaded on the button, its like the whole button becomes invisible and pokes a button-size hole into the GUI so we see the background behind it....weird!

So 2 computers it works ok, 1 computer it doesnt.

What could conflict with AGS`s screenshot function in this computer so it doesnt work? Codecs...software conflict, logged on as admin, etc...

?
Spread the love...One.Turtle.At.A.Time.
http://www.youtube.com/watch?v=y0A77rohcyg

monkey0506

Quote from: largopredator on Tue 29/09/2009 20:27:47But when it saves the game it scales the actual screenshot down to 160x100? That's a widescreen aspect ratio isn't it?

160x100 is of course 16:10 aspect ratio but it's also 50% of 320x200 (which is also 16:10 aspect ratio). ;)

Gilbert

In fact, the 320x200 mode was not supposed to be a widescreen mode. It's originally supposed to be stretched to 4:3 on a CRT, as pixels aren't necessarily square in shape, so in fact the aspect ratio of say, a 160x100 sprite depends on the resolution-monitor-setting combo. With CRTs people often used various "odd" modes with non-square pixels for various reasons.
It's probably after LCD panels have become popular that people tend to have their minds decayed to think that pixels should always be square.

Knox

#7
I have the same problem... ???
--All that is necessary for evil to triumph is for good men to do nothing.

Pumaman

Quote from: Joseph on Tue 29/09/2009 20:45:52
Ok, I imported my whole game  folder into a 3rd computer (a friend's,,,windows vista)...and the save screenshots work OK too...so I have 1 cpu (windows xp 32) that the screenshots dont work ok...instead of seeing a screenshot loaded on the button, its like the whole button becomes invisible and pokes a button-size hole into the GUI so we see the background behind it....weird!

So 2 computers it works ok, 1 computer it doesnt.

What could conflict with AGS`s screenshot function in this computer so it doesnt work? Codecs...software conflict, logged on as admin, etc...

Are you using Direct3D or DirectX 5 driver? Try the other one. Are you running full-screen or windowed? Try the other one.

Joseph

Hi Pumaman,

Interesting, on my home computer the save screenshots acts "normal" only when im in Window mode (either driver). Once I try in fullscreen (either driver), the screenshots dont work normally...I get the button that becomes transparent and cuts through the GUI (so we see the background behind the save GUI).



Spread the love...One.Turtle.At.A.Time.
http://www.youtube.com/watch?v=y0A77rohcyg

Pumaman

Strange, it could be that for some reason your graphics card won't allow AGS to read the contents of the screen when in full screen mode. I haven't heard of that happening before...

Joseph

#11
ive tried the same setup on yet another computer and this time Direct3D doesnt work in full screen or windowed...direct x 5 "works" partly...only part of  the screen is taken as a screenshot (the iconbar and bottom bar), everything in the middle is see-through.

Do you think its something to do with screenshots not working correctly when in 1024 x 768 + 32 bits?

**EDIT**

I did some more  tests:

On my computer at home where the screenshots worked (D3D Windowed), I tried in D3D Fullscreen doesnt work. I tried Direct X5 Fullscreen= doesnt work. I tried Direct X5 windowed=doesnt work.


Interesting find: When I click the checkbox "downscale 32 bits to 16 bits", every mode works! The screenshots work as they should...32 bits however, and I get all those problems and irregularities in 3 different computers with 3 different graphics cards + OS.

So it seems there could potentially be a problem with hi-res 32 bit graphics 1024 x 768 and the screenshot in savegame feature?

Perhaps someone could test this out on their end aswell...
Spread the love...One.Turtle.At.A.Time.
http://www.youtube.com/watch?v=y0A77rohcyg

Knox

Ive tested this with my own 32 bit 1024x768 game...and I get the same results as Joseph. It seems I can only get my savegames works in 16 bit (I have to downgrade).
--All that is necessary for evil to triumph is for good men to do nothing.

Pumaman

I've looked into this and it was a problem if your GUI had an alpha-transparent background image.

Could you please try out 3.2 RC 1 and see if that fixes the problem for you.

Joseph

Well on my end I tried my game on the 3.2 RC 1 and everything works (in every mode)...the only problem is when you're in D3D fullscreen, the screenshot is shifted over like 20% to the right...in  the direct x mode, fullscreen or windowed, it works super fine...windowed D3D, super fine...so I guess its just the fullscreen mode (I think when you have to have the "display borders in widescreen" selected)

I can provide a screenshot if you need

Im surprised you already have a fix going for  this bug, so fast! :)
Spread the love...One.Turtle.At.A.Time.
http://www.youtube.com/watch?v=y0A77rohcyg

Pumaman

Ah interesting, thanks for testing it... there might be a problem there when the side borders are enabled, I'll look into it.

SMF spam blocked by CleanTalk