Please login or register.

Login with username, password and session length
Advanced search  

News:

For WME related articles and tutorials visit WME Resource Center.

Pages: 1 [2] 3  All

Author Topic: Screen resolution scale down  (Read 46655 times)

0 Members and 1 Guest are viewing this topic.

Atelier Sentô

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 52
    • View Profile
    • Atelier Sentô
Re: Screen resolution scale down
« Reply #15 on: April 22, 2014, 06:03:45 PM »

I've tested my game on several computers using metamorphium's version of wme lite and it's a pleasure to see it down-scaled on every screen (even on a small netbook).

In another hand, some small graphical glitches appear when the game is down-scaled.

1 - ENTITIES

I have the feeling that, instead of scaling the whole window to fit the screen, wme lite scales all the entities separatly.
Per exemple, let's take an entity which is 100x100px at the original resolution (1920x1080).
On a 1600x900 screen, it's going to be resized to 83,3333 x 83,3333 -> 83x83
So the resized entity will be slightly smaller as expected.

When the game is down-scaled, during animations or when you hide/show an entity, it creates a "vibration" as you can see it on the following gif:

(during this animation, every image is jpg so on every frame, the character have a small part of background all around her; instead of a transparent void)

Of course, it can be easily fixed by using transparent png instead of jpg.
So it's not a big problem.

2 - SCROLLING

When scrolling scenes are down-scaled, the scrolling becomes very fast.
I don't why or how to fix it.
My theory is maybe Scene.ScrollPixelsX uses the pixels of the screen (1600x900) instead of the pixels of the original resolution (1920x1080).
Is it possible?

3 - SUBTITLES

At their original resolution (1920x1080), my subtitles look like this:


But when downscaled to 1600x900, they look like this:

which is a little bit odd.

CONCLUSION
If I took the time to report all those things, it's because I'm wondering if they are known problems or if they come from me (scripting errors, per example).

I'm learning WME but programming is still an esoteric language to me...
Thank you for reading me!
« Last Edit: April 22, 2014, 06:11:43 PM by Atelier Sentô »
Logged

HCDaniel

  • Regular poster
  • ***
  • Karma: 8
  • Offline Offline
  • Posts: 168
    • View Profile
Re: Screen resolution scale down
« Reply #16 on: April 23, 2014, 08:45:12 AM »

The issue you mention with entities is correct. I have added an option to wmelite (should be available in the julia branch as well, maybe not with the latest fixes though) to draw all entities to an (invisible) screen with the original game resolution. Only then, the whole scene is scaled to the screen and painted. It fixed all artifacts with drawing bitmaps for me (in our game the bitmaps must be correct to the last pixel). Downside to that approach is that a lot more memory is used - on Windows however, that might not be such a big issue anymore.

To use it, you need to add a settings.xml and enable the option. I hope this is the right format, I just reverse engineered it from the code (I don't have a game project at hand right now):

Code: [Select]
<?xml version="1.0" encoding="UTF-8"?>
<Settings>
  <Rendering>
    <PixelPerfect>1</PixelPerfect>
  </Rendering>
</Settings>

W.r.t. scrolling I don't know what really happens. Can you make some simple project available so I can test this?
EDIT: Could it be related to the scrolling speed setting and the rendering speed of your machine? Does it help to modify ScrollSpeedX?

Font rendering is done differently in the lite version of the engine. Especially for the font attributes, "bold" and "italic" are not supported. Looks like you have a font that you want wme to draw in bold. Original wme will do it, wmelite ignores the setting.
« Last Edit: April 23, 2014, 08:51:04 AM by HCDaniel »
Logged

Atelier Sentô

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 52
    • View Profile
    • Atelier Sentô
Re: Screen resolution scale down
« Reply #17 on: April 23, 2014, 03:37:28 PM »

Hello HCDaniel!
Many thanks for your help!

1- ENTITIES

Using SciTE, I've created a file called settings.xml in the same folder as wme lite (julia branch) and I've pasted your code in it.

Now, when I run the game on a smaller screen, the interactive regions and the subtitles are down-scaled but the images appear in their original size.
Per example, my first scene looks like this:

while it should look like this:

(you can click on the images to see them fullsize)

Maybe I forgot to do something to enable the option you're talking about?

2- SCROLLING

In my scene_init.script I've set the scrolling like this:
Code: WME Script
  1. // set the horizontal scrolling speed
In WME, the scrolling is smooth and follow the character just fast enough.
But in wme-lite, it's very very fast.
I send you a scrolling scene by PM so you can test it!

3- SUBTITLES

Thank you for the tip! I didn't know that!
The subtitles still look odd... but it will be OK when settings.xml is enable, I suppose.

Again, many thanks for your help.
« Last Edit: April 25, 2014, 04:59:14 PM by Atelier Sentô »
Logged

HCDaniel

  • Regular poster
  • ***
  • Karma: 8
  • Offline Offline
  • Posts: 168
    • View Profile
Re: Screen resolution scale down
« Reply #18 on: April 23, 2014, 05:48:06 PM »

Can you check again with the "wme.exe" I uploaded here (the relevant changes from the julia branch are in):

https://bitbucket.org/MnemonicWME/wmelite/downloads

The settings.xml file should be fine. If you make a mistake there, it will typically be ignored. As you noticed a difference, it was all fine, even if it was not the result you wished for ;)

I'll check the scrolling project in the next days (I have downloaded it already). What makes me sceptical are the settings you use. You want the engine to scroll one pixel at a time, every 1ms. That would in theory result in 1000 pixels/second. Maybe with regular WME you use full screen, and it could be that the frames per second are limited (maybe to 100 or 60 I'm not sure), so there you'll get only 60 pixels per second at max. Can you re-check in windowed mode whether the scrolling is too fast there as well?
Logged

Atelier Sentô

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 52
    • View Profile
    • Atelier Sentô
Re: Screen resolution scale down
« Reply #19 on: April 25, 2014, 09:35:19 AM »

Can you check again with the "wme.exe" I uploaded here (the relevant changes from the julia branch are in):

https://bitbucket.org/MnemonicWME/wmelite/downloads

The settings.xml file should be fine. If you make a mistake there, it will typically be ignored. As you noticed a difference, it was all fine, even if it was not the result you wished for ;)

Thank you! The down-scaling is now pixel perfect!
What a relief! Many thanks for your help!

Some strange things occur. I don't know if they are know problems.

1 - All semitransparent entities become grey.
On this screenshot, the reflection in the water (on the top-right corner) is looking grey:

while it should look light-blue, like this:

This reflection is a png whose opacity has been reduced in photoshop.
But the same problem occurs when I set the opacity through wme scripts.

2 - The subtitles now use wme default font.

3 - When an objet moves in a scene, there's an aliasing effect.
Here is a video of this effect:
http://youtu.be/4Bpe7-_YvC4
(You'll have to watch it in HD fullscreen to see the "aliasing" on the boat (mostly on its left side)).
Here is the script I use to move the boat:
Code: WME Script
  1. while(true)
  2.   {
  3.    if(boat.X <= 610 * Game.GlobalScale)
  4.         {
  5.         break;
  6.         }
  7.   boat.X = boat.X - 1;
  8.   boat.Y = boat.Y - 1;
  9.  
  10.   Sleep(60);
  11.   }

I'll check the scrolling project in the next days (I have downloaded it already). What makes me sceptical are the settings you use. You want the engine to scroll one pixel at a time, every 1ms. That would in theory result in 1000 pixels/second. Maybe with regular WME you use full screen, and it could be that the frames per second are limited (maybe to 100 or 60 I'm not sure), so there you'll get only 60 pixels per second at max. Can you re-check in windowed mode whether the scrolling is too fast there as well?
When I'm working in windowed, the scrolling is OK. And now, with the new version of wmelite you just uploaded, it's OK in fulllscreen too.

Thank you for your explanations about fps.
I think that most of my problems are because I don't quite understand how to deal with fps...
I'm going to make researchs about it in the wme forums. I have to learn how to create a game that will work on every computers!

EDIT:
I've made a scrolling test with this code:
Code: WME Script
  1. // set the horizontal scrolling speed
The result is good and the scene don't scroll too fast anymore.

Once again, many thanks for your very helpful answers.
It's so relieving to see everything becoming clear, little by little.
« Last Edit: April 25, 2014, 11:02:44 AM by Atelier Sentô »
Logged

HCDaniel

  • Regular poster
  • ***
  • Karma: 8
  • Offline Offline
  • Posts: 168
    • View Profile
Re: Screen resolution scale down
« Reply #20 on: April 25, 2014, 03:14:02 PM »

This reflection is a png whose opacity has been reduced in photoshop.
But the same problem occurs when I set the opacity through wme scripts.
Hmm, can I ask you again to provide me with an example scene? Is this a difference between regular wme and wmelite, or is it a problem that is only visible with "pixel perfect rendering"?

2 - The subtitles now use wme default font.
Hmm that only happens when the font file is not found. Are you sure it is in the same place that the scripts expect it? Please check the "wme.log" file, there you should find complaints if the specified font is not found.

3 - When an objet moves in a scene, there's an aliasing effect.
Here is a video of this effect:
http://youtu.be/4Bpe7-_YvC4
(You'll have to watch it in HD fullscreen to see the "aliasing" on the boat (mostly on its left side)).
I'll check that one out.

I've made a scrolling test with this code:
Code: WME Script
  1. // set the horizontal scrolling speed
The result is good and the scene don't scroll too fast anymore.
That one looks good, scrolling with roughly 60 fps for 4 pixels each :)
Logged

Atelier Sentô

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 52
    • View Profile
    • Atelier Sentô
Re: Screen resolution scale down
« Reply #21 on: April 25, 2014, 04:35:41 PM »

This reflection is a png whose opacity has been reduced in photoshop.
But the same problem occurs when I set the opacity through wme scripts.
Hmm, can I ask you again to provide me with an example scene? Is this a difference between regular wme and wmelite, or is it a problem that is only visible with "pixel perfect rendering"?
In WME, official wmelite and "wmelite julia branch", semitransparent entities looks good.
This problem only appeared today when I tried the "pixel perfect rendering" wme.exe you uploaded yesterday.

(By the way, I wasn't sure how to use your "wme.exe" so I pasted it in the "wmelite - julia branch" folder and I click on it to launch the game.)

I'm going to send you an example scene. I'll send it by PM soon.

I'm also going to check the font files and I'll come back if I don't find the answer.

Thank you for your help!
« Last Edit: April 25, 2014, 04:58:34 PM by Atelier Sentô »
Logged

HCDaniel

  • Regular poster
  • ***
  • Karma: 8
  • Offline Offline
  • Posts: 168
    • View Profile
Re: Screen resolution scale down
« Reply #22 on: April 26, 2014, 12:14:39 PM »

Quote
1 - All semitransparent entities become grey.
On this screenshot, the reflection in the water (on the top-right corner) is looking grey:
I checked your project. Unfortunetely I have absolutely no idea what's happening. The issue is only present in Windows (Linux & Android behave as expected). I don't know whether I have done something wrong (and SDL is gracefully correcting my errors on Linux & Android), or whether it is SDL's fault with the direct3d renderer.

Rendering the scene to a texture and then rendering the texture to the screen (on Windows) alters the color of the semitransparent parts of images (transparency itself is still ok). Does anybody have an idea what might be going on?

Quote
3 - When an objet moves in a scene, there's an aliasing effect.
I see what you mean, but I have no idea what to do :( I guess that it does not make a big difference whether pixelperfect is on or off, and that the effect is gone when you run the game at original resolution?

I did not see any font issue when running the project, so I hope that one is resolved :)
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Screen resolution scale down
« Reply #23 on: April 26, 2014, 12:28:48 PM »

I checked your project. Unfortunetely I have absolutely no idea what's happening. The issue is only present in Windows (Linux & Android behave as expected). I don't know whether I have done something wrong (and SDL is gracefully correcting my errors on Linux & Android), or whether it is SDL's fault with the direct3d renderer.
Yeah, there seems to be some alpha issue in Direct3D mode in fullscreen. I think meta encountered it as well. Switching to OpenGL renderer fixed the problem. So I suppose meta's fork uses OpenGL while your testing executable doesn't.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

HCDaniel

  • Regular poster
  • ***
  • Karma: 8
  • Offline Offline
  • Posts: 168
    • View Profile
Re: Screen resolution scale down
« Reply #24 on: April 26, 2014, 01:27:19 PM »

Yeah, there seems to be some alpha issue in Direct3D mode in fullscreen. I think meta encountered it as well. Switching to OpenGL renderer fixed the problem. So I suppose meta's fork uses OpenGL while your testing executable doesn't.

Thanks for the hint, I just double-checked that. Unfortunately it doesn't help. Both d3d and opengl work fine, unless I enable the option to render the scene to a separate SDL texture first (in game resolution) and then render that texture to the screen. Alpha is ok, but the color itself looks like it was merged with another one (maybe black) and thus turned to grey. I think I can exclude other bugs, because I added some code that dynamically switches this feature on and off every second just for testing, and only if I render to that extra texture the color has changed. Hmpf :(
Logged

Atelier Sentô

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 52
    • View Profile
    • Atelier Sentô
Re: Screen resolution scale down
« Reply #25 on: April 27, 2014, 04:17:44 PM »

I did not see any font issue when running the project, so I hope that one is resolved :)
In the same folder as wmelite, I've added a "fonts" folder with the .ttf file inside and it's OK, now!
I'm sorry: I didn't know wmelite was acting differently with fonts.
The good thing is: this problem is now solved!

Quote
3 - When an objet moves in a scene, there's an aliasing effect.
I see what you mean, but I have no idea what to do :( I guess that it does not make a big difference whether pixelperfect is on or off, and that the effect is gone when you run the game at original resolution?
The aliasing appears only on the pixelperfect version of wmelite.
Metamorphium's version does not have this problem.
Unfortunately, I don't have a 1920x1080px screen so I can't test it fullscreen at original resolution with wmelite.

I've also noticed that, both on metamorphium's wmelite and on your pixelperfect version, a very strong screen tearing appears when the scene scroll.
(I see no screen tearing when playing the same scene on Mnemonic's official wmelite)

Yeah, there seems to be some alpha issue in Direct3D mode in fullscreen. I think meta encountered it as well. Switching to OpenGL renderer fixed the problem. So I suppose meta's fork uses OpenGL while your testing executable doesn't.

Thanks for the hint, I just double-checked that. Unfortunately it doesn't help. Both d3d and opengl work fine, unless I enable the option to render the scene to a separate SDL texture first (in game resolution) and then render that texture to the screen. Alpha is ok, but the color itself looks like it was merged with another one (maybe black) and thus turned to grey. I think I can exclude other bugs, because I added some code that dynamically switches this feature on and off every second just for testing, and only if I render to that extra texture the color has changed. Hmpf :(
It sounds like the problem is more complicated than expected... I'm sorry!
I hope looking at my problem doesn't take too much of your time and that it will help you in some way with your own game.
« Last Edit: April 27, 2014, 04:23:18 PM by Atelier Sentô »
Logged

HCDaniel

  • Regular poster
  • ***
  • Karma: 8
  • Offline Offline
  • Posts: 168
    • View Profile
Re: Screen resolution scale down
« Reply #26 on: April 27, 2014, 06:58:19 PM »

Quote
The aliasing appears only on the pixelperfect version of wmelite.
Metamorphium's version does not have this problem.
Unfortunately, I don't have a 1920x1080px screen so I can't test it fullscreen at original resolution with wmelite.
Can you check once again please, I uploaded a new .exe with one more thing from the julia branch that I forgot to add.

Quote
I've also noticed that, both on metamorphium's wmelite and on your pixelperfect version, a very strong screen tearing appears when the scene scroll.
(I see no screen tearing when playing the same scene on Mnemonic's official wmelite)
I don't know whether it is possible to use the "vsync" feature that the regular WME has. Mnemonic, do you know how to do that in SDL?

Quote
It sounds like the problem is more complicated than expected... I'm sorry!
I hope looking at my problem doesn't take too much of your time and that it will help you in some way with your own game.
No need to excuse :) It's good that you test and find bugs, we will all benefit from it. It will make also our game better I'm sure 8)
Logged

Atelier Sentô

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 52
    • View Profile
    • Atelier Sentô
Re: Screen resolution scale down
« Reply #27 on: April 28, 2014, 07:05:43 PM »

Quote
The aliasing appears only on the pixelperfect version of wmelite.
Metamorphium's version does not have this problem.
Unfortunately, I don't have a 1920x1080px screen so I can't test it fullscreen at original resolution with wmelite.
Can you check once again please, I uploaded a new .exe with one more thing from the julia branch that I forgot to add.
Unfortunately, the aliasing problem is still there.

No need to excuse :) It's good that you test and find bugs, we will all benefit from it. It will make also our game better I'm sure 8)
OK, thank you!  :D
Logged

HCDaniel

  • Regular poster
  • ***
  • Karma: 8
  • Offline Offline
  • Posts: 168
    • View Profile
Re: Screen resolution scale down
« Reply #28 on: April 28, 2014, 08:41:25 PM »

Can you send me this one anim that shows the aliasing effect as well so I can test the effect in my PC?

BTW I still have no clue about the strange color with semitransparent graphics  :(
Logged

Atelier Sentô

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 52
    • View Profile
    • Atelier Sentô
Re: Screen resolution scale down
« Reply #29 on: April 29, 2014, 06:58:17 PM »

Can you send me this one anim that shows the aliasing effect as well so I can test the effect in my PC?
I've sent you the file by MP!

BTW I still have no clue about the strange color with semitransparent graphics  :(
It is indeed a strange problem... I'm sad I can't help.
Logged
Pages: 1 [2] 3  All
 

Page created in 0.062 seconds with 21 queries.