Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Studio Chat / a Little method for testing on Windows as tablet.

Author
Message
haliop787
4
Years of Service
User Offline
Joined: 22nd Mar 2020
Playing: With reality.
Posted: 24th Feb 2021 08:48 Edited at: 24th Feb 2021 08:53
So actually I never use percentage as virtual resolution, and always use virtual res according to MAxDeviceWidth/HEight. I just find it easier to use (for me)
so if your pc can turn into a tablet and you want to test your code on a big screen rather then broadcasting it to your phone , I find this extremely useful.

so actually all my buttons/ Sprites/ 2d stuff etc. is based on Virtual Width and Height so you'll get a very well done cross-platform cross-resolution accuracy across all of your apps.
And yeah, sometimes there's a little difference but nothing too hard to do , once you can check if you are on windows/ iPhone/ Android which is basically neglected but checking for the actual resolution.

Hope this helps someone.

Nadav "Haliop" Rosenberg
Lets make the world great forever.
Raven
19
Years of Service
User Offline
Joined: 23rd Mar 2005
Location: Hertfordshire, England
Posted: 24th Feb 2021 14:13
When handling Multi-Device Resolutions., it's actually most important to determine the Avg. Viewing Range of the End User in order to best Scale the User Interface.
The reason for this is because the Effective DPI is directly proportional to how far you are from the Screen.

This will range from 0.15m (6 inch) to 3.00m (10 feet), on Avg. 72 DPI is comfortable for the widest range of eyesight.

Let's say for a moment we have a 24" Full HD (1080p) Display.
This means our Display Dimensions are 53.1cm (20.9in) x 29.9cm (11.8in)., this results in a Native 92 DPI

This essentially means that the Ideal Viewing Distance is going to be 2m / 6f 6in... of course this isn't the range that most will ACTUALLY be from their Display.
Mobile (0.15 - 0.60m)
Desktop / Laptop (0.90 - 1.00m)
Console (3m)

This as a note is why you might've heard things about "Designing for the 10ft Experience"
So why is this important? Well because the Effective DPI will scale against the Native DPI depending on Distance.

That is to say that our above Display, you want to be ideally ~2m from... but what if you are 3m instead?
Well in that case the Effective DPI of the Display increases from 92 DPI to 138 DPI., and thus the scale of an image will appear approx. 66% the Size; meaning we want to increase it's size to 150% the Original to have it still be represented the exact same.
And this works in reverse as well.
Let's say that we are viewing at 1m instead of 3m... in that case the Effective DPI will drop to 47 DPI; and we will want to reduce it's size to 49% to again retain the same effective size.

Now strictly speaking., for the moment let's not actually focus on the Viewing Distance but instead just determine how this would Statically Change in regards to the Resolution Output.
That is to say that we want to Design & Develop our Application at a "Default" Resolution... again let's use 1080p (Full HD) as this is pretty much an Industry Standard.

How does changing our Resolution affect our DPI., and thus how do we then Correct this Programmatically so that our User Interface is ALWAYS the same size regardless of the Resolution the End User wants to use?
For this will use a more Standard 32" Display... and we'll design against a 1080p Resolution (as this will be the most common)

This means our Display DPI is going to be ~69 DPI., and so that's what we want to keep in terms of Effective UI DPI.
If we check against the various "Standard" Resolutions (720p / 900p / 1080p / 1440p / 1620p / 1800p / 2160p)., we can figure out what the various Native DPI will be.

46 - 52 - 69 - 92 - 103 - 115 - 138

Remember here '69' is our 100% Scaling Value., in essence how we handle this (in pseudocode)

Differential = [Native] / [Effective]
If Differential > 1.0
Then Differential = Abs( Differential - 2.0 )
Else Differential = [Effective] / [Native]

This then ends up our Scaling Factor for Resolution... now if we want to take into account the Device Type (i.e. Mobile / Desktop / Console) that is to say "Are we Holding the Device?", "Are we setting at a Computer Desk / have it on our Lap?" or "Are we setting on a Couch on the other side of the Room?"; then we'd have a second Differential Calculation that we then Multiply against our Resolution Differential.

All this will result in a close approximation of Scaling that retains the same UI Sizes on all Devices and Viewing Distances.
You can as a note also use this for Resolution Scaling (i.e. having different Virtual and Physical Resolutions)., so you could even have the Game Output remain a Consistent Size., but that's more difficult / problematic as Virtual Resolution is going to determine performance, and really you're best aiming to keep a similar performance level across devices and graphics hardware.





haliop787
4
Years of Service
User Offline
Joined: 22nd Mar 2020
Playing: With reality.
Posted: 24th Feb 2021 16:30
Yeah i get it.
I am aiming only for Android.
But lets say i want to "know" whats the current Dpi of the device, is there a way to do it in Agk? Cause i have no idea where the player will sit and how far away from the screen...

Is it a resolution thing only regarding Agk?
For now it looks the same both on my 15inch tablet pc and on my phone.

Also in Israel we have a Goverment Rule, that if you upload an app it should have accesabilities section where people can change everything from text and button size and also entire screen contrast/ removing all yellowish colors, ambient screen lightning.. it is actually a must in Israel... i am guessing it the same all over the world but here the goverment can actually sue you for that which is a bit problamatic, this is why at first stage i am sticking only with Android.
Nadav "Haliop" Rosenberg
Lets make the world great forever.
Raven
19
Years of Service
User Offline
Joined: 23rd Mar 2005
Location: Hertfordshire, England
Posted: 24th Feb 2021 19:29
On Mobile you can use GetDeviceDPI( ) but on Desktop this return 0... so you'd have to figure it out yourself.
This said generally speaking you can be sure that a Desktop Monitor will be 19 - 32"., this means the Avg. is 26" and you can use that as the basis for "Best Guess"
If you can get the EDID Information from the Display, then it will have all the information you need in there; but getting this is different depending on the OS.

As for the Accessibility Options "Requirement"., I was unaware that this was a restriction in any Territory.
Essentially in regards to North American, European or Japanese release of Software; there are no strict regulations...
Something little known is that while Software Ratings are often assumed to be a (Legal) Requirement., they're actually an Opt. In choice by the Developer.

This is actually where things get a little interesting., because a Retail Store (Digital or Physical) MUST carry out Age Checks on any Age Restricted Product... BUT as it's not a Legal Requirement to get Age Certification (it's just common practise), there is nothing legally preventing an Uncertificated Game / Software from being Sold to anyone (thus doesn't come under Age Restriction Guidelines and Legal Requirements).
I know that a lot of Digital Stores now DO require you to get an Age Rating (otherwise they automatically rate it as Restricted / 18+) but Physical Stores actually don't have similar requirements.
haliop787
4
Years of Service
User Offline
Joined: 22nd Mar 2020
Playing: With reality.
Posted: 25th Feb 2021 01:16
So yeah in Israel they are very strict about it.
Not really for games, I am actually building an App using AppGameKit that eventually should hold about 2 gb and more of txts, so more of an app rather then a game. But yeah its a law requirment here.
Web and Mobile.
Nadav "Haliop" Rosenberg
Lets make the world great forever.

Login to post a reply

Server time is: 2024-04-26 20:00:56
Your offset time is: 2024-04-26 20:00:56