Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 36

Thread: Grayout -Simple Linux freeware game

  1. #21
    Thanks again for input. So ttill room for improvements and some bling could be nice too. But now busy mode over here. I hope to get time to look at it again. I'm afraid as usual all suggestios will not be adressed. But possibly some. The algo could be optimized, no doubt. On the other hand the player might want to play leisure mood and not think too much so a non optimized algo can cut the player some slack.

  2. #22
    Quote Originally Posted by Jonax View Post
    The algo could be optimized, no doubt. On the other hand the player might want to play leisure mood and not think too much so a non optimized algo can cut the player some slack.
    You could always add a hard difficulty and use most optimized algorithm there and use current algorithm for easy mode.

  3. #23
    Quote Originally Posted by SilverWarior View Post
    You could always add a hard difficulty and use most optimized algorithm there and use current algorithm for easy mode.
    That is possible and a nice extra option. However I ran into an other unexpected problem for the Windows version. It turned out it's possible and useful for some windows users to scale the monitor, e.g. to 125%. Since I hadn't taken that into account the optics turned out horrible.

    See below screenshot at 125% on Windows. I assume the same thing could happen to Linux. Anyway I'm trying to make a fix. Seems promising. However this may complicate my upcoming game project. We will see.

    How do you guys handle such scaling? How common is the scaling?

    grayout-unscaled.jpg

  4. #24
    Quote Originally Posted by Jonax View Post
    It turned out it's possible and useful for some windows users to scale the monitor, e.g. to 125%. Since I hadn't taken that into account the optics turned out horrible.

    See below screenshot at 125% on Windows.
    This is not Monitor scaling but UI scaling. You see on Windows all UI elements size is defined in pixels including the Font size. So when you launch an application on a monitor that has the same physical size but higher resolution all UI elements in your application will end up being much smaller since their size s defined by hardware pixels.
    So you need to retrieve information of how many pixels per inch does the monitor have (DPI resolution) in order to be able to calculate the ratio from the DPI resolution your UI was designed on and to the current DPI resolution of your monitor. Now this probably doesn't seem to difficult right?
    Well the problem is that Microsoft made this a bit more difficult by requiring the application to be High DPI aware for the Windows to report actual monitor DPI and not default 96 DPI resolution as it does to all application that does not support High DPI awareness.Not to mention that Windows by itself support four DPI awareness Modes. Or the fact that some of them doesn't scale properly in certain conditions especially on systems with multiple monitors. Or the fact that Windows will go and cale some standard controls (controls that are not rendered by VCL or FMX in Delphi or LCL in Lazarus but are instead wrappers for standard Windows controls that are rendered by Windows itself) that your application might be using automatically but you need to scale rest of the controls yourself.

    Now I'm not sure of how to deal with High DPI awareness in Lazarus so I recommend you check the Lazarus forums for this.

    Quote Originally Posted by Jonax View Post
    I assume the same thing could happen to Linux.
    Now I'm not sure how Linux deals with DPI scaling but so far I have never heard users on Linux having so much problems as they do on Windows. So I'm guessing that DPI scaling on Linux might have more stable implementation than the one on Windows.

    Quote Originally Posted by Jonax View Post
    How common is the scaling?
    Until the arrival of High DPI monitors like 4K monitors DPI scaling was pretty rarely used since it was used only as accessibility feature for visually impaired people. But with the arrival of High resolution monitors this became much more commonly used due to the above mentioned problem of Windows Ui elements size being defined in the number of hardware pixels.
    MacOS solved this a long ago by using Virtual pixels for defining the size of any control. Then the OS performs the needed scaling so that such control has the same actual size (like 2,5 cm width) any any apple device regardless of Screen size or screen resolution of that device.

  5. #25
    I for one never encountered this scaling before. As you say the Lazarus forum is very helpful.

    MyIntegerVariableForScaling := Screen.PixelsPerInch;

    Seems to do the trick. Though it took some time to remake the program. I wouldn't be surpised if I missed something too. But now the new scaling ready version is downloadable on my site.

    Gameplay and appearance are supposed to remain unchanged.

    It turned out the UI scaling is possible in Linux too. At least for the KDE Debian I use.

    Haven't found that option on Raspberry but I guess most Raspberry users don't use High DPI monitor. And frankly I don't either.

  6. #26
    And thanks for the extensive reply SilverWarior . It sure seems to be a challenge to handle all that. At least I'm aware of the scaling now.

  7. #27
    Quote Originally Posted by Jonax View Post
    I for one never encountered this scaling before. As you say the Lazarus forum is very helpful.

    I guess most Raspberry users don't use High DPI monitor. And frankly I don't either.
    You probably never encountered this because you don't own High DPI monitor so Windows never went into this as they call legacy scaling mode which completely breaks some applications. And yes this can even break some of older Microsoft applications.
    There is a reason why Windows 10 and Windows 11 are actually logging which DPI scaling their users use for certain applications (yes on modern Windows versions user can force specific application to use one of the four scalling methods) so that when a user installs some old application Windows can check Microsoft database to see if Microsoft already has some information about which Scaling type most users use.

    Quote Originally Posted by Jonax View Post
    MyIntegerVariableForScaling := Screen.PixelsPerInch;
    Yeah this will work for as long as Windows report correct DPI resolution. But for this your application manifest file must contain proper entries to tel Windows that it does support High DPI scaling. Without that Windows will report wrong DPI resolution.

    Any way I also don't have High DPI monitor so I don't have actual experience with this but I did read several questions and their respective answers about this topic on Stack Overflow.
    Well technically I do have High DPI screen if I connect my computer to Smart TV that I got for free from my friend.

    And no I don't have some rich friends. This is just about six or seven years old Smart TV whole back-light electronics has gone bad so now I can be happy if screen remains constantly lit for 10 minutes otherwise it keeps turning black after about one to two minutes and remains black for about half a minute each time. Replacing back-light electronics would cost about 120 EUR which is half of the price of some cheaper Smart TV-s out there. So now I'm kinda hoping that someone else might donate me similar or same model so I can try and use parts from both to make at leas one working

  8. #28
    Indeed I never bought any High DPI monitor. But it turned out I have at least one rich friend with such a gadget. Annoying when I wanted to proudly show my latest creation and it looked like crap on his advanced machine.

    Seems to be complicated to handle the resolutions and I haven't even begun with the application manifest thingie. Anyway I got to try my best. No doubt I will encounter new problems. I assume there can be conflicts when I try to fix the appearance while windows also tries to fix the appearance in its way.

    An other question is how much more high-res the monitors will be in the future. Right now windows supports max rescaling of 225%. There must be some limit of how much it's meaningful/possible to shrink the pixels/ dots.. will there one day be rescaling to ten thousand percent.. and not lousy 4K monitors but 4G monitors.. I think a 4G monitor is still science fiction but the tech improves relentlessly..

    As for your high res TV it sounds like a good plan to wait for a similar wasted gadet to scrap parts from. I keep my fingers crossed for you. Them monitors can be expensive and I rather spend the dollars on the CPU and the Disks. Not that I buy anything fancy. I prefer the low power low end ones with integrated graphics. Still beats my first PC from last millenium. I started with a 20 MHz i386 with 1 MB ram and 40 MB disk drive. Even the most crappy modern PC is superior to that.

  9. #29
    Quote Originally Posted by Jonax View Post
    Right now windows supports max rescaling of 225%. There must be some limit of how much it's meaningful/possible to shrink the pixels/ dots.. will there one day be rescaling to ten thousand percent.. and not lousy 4K monitors but 4G monitors..
    With windows scaling you are not shrinking but instead stretching the pixels. The purpose of scaling is to make things look larger. Well technically you are not even stretching the pixels but instead telling Windows to draw standard UI components enlarged by the scale factor.

  10. #30
    Quote Originally Posted by SilverWarior View Post
    With windows scaling you are not shrinking but instead stretching the pixels. The purpose of scaling is to make things look larger. Well technically you are not even stretching the pixels but instead telling Windows to draw standard UI components enlarged by the scale factor.
    Sorry for unclear writing. What I tried to say is the physical light emitters making up the dots in modern flatscreen monitors ought to be made smaller or placed closer to each other if the screen makers want to fit more of them into each square inch. I assume Moores law doesn't apply here but either way there should be some limit of how small or densely place they can meaningfully be. CPU evolution - amazing. Monitor evolution -not bad but not as great as for monitors.

Page 3 of 4 FirstFirst 1234 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •