Jump to content
  • Advertisement
Josheir

C++ Targeting Different Platforms

Recommended Posts

I am trying to write a 2D game using SFML so it will be portable.  I was thinking maybe a resolution for the desktop of 1024 x 768 and one higher resolution too with black bars.  I think that this should cover all the PCs.

Is this fine?

Secondly,  the SFML site mentions that IOS and Android are on the way for using SFML.  I am wondering what the resolutions are that I will need to use.  That is,  the least amount of different resolutions to cover all of these upcoming opportunities so I can plan ahead.  I am thinking maybe these devices might have more than one display resolution on their devices?  I am writing this here because it is not so much a question for SFML but really just general knowledge about mobile resolutions.

Thanks for the help,

Josheir

Share this post


Link to post
Share on other sites
Advertisement

Why would you off the bat limit the resolution of you application with no indication as to why this would be help. If its just for the sake of let say running on a PC then this is not optimal. Most framework these days( most likely SFML ) have the ability to enumerate the device capabilities, using that as your starting point would present a more flexible design. If it turn out that the specific resolution is too high to support your application feature, then you can use the said result(s) from enumeration to dial back resolution. Also, if you get caught up on resolution you will soon find this to be a pain, there is no such thing a mobile resolution especially on Android where the device and so wide and varied.

Share this post


Link to post
Share on other sites
16 minutes ago, cgrant said:

Why would you off the bat limit the resolution of you application with no indication as to why this would be help. If its just for the sake of let say running on a PC then this is not optimal. 

I am rewriting a program I wrote and I don't understand the need for other resolutions.  If they have 1024x768 than I figure just use it, it is optimal for the display.  This is a 2d game.  I am limiting it because it is easier than than writing more than one display with black bars, and if it is possible than why not take the easier route.  

My idea is that monitors have 1024x768 still and if not than they have the one other type 'x.'  It's optimal, 1024 x 768.  (looks how I want it to!)

16 minutes ago, cgrant said:

 Also, if you get caught up on resolution you will soon find this to be a pain, there is no such thing a mobile resolution especially on Android where the device and so wide and varied.

What are you suggesting as an alternative?  

 

Josheir

 

Edited by Josheir

Share this post


Link to post
Share on other sites

I did miss that 2D part, but yeah the only sane way you are going to get by is to do so form of scaling from your default resolution. Still think there will be some distortion, as even though the app is rendered at resolution X, the native display has a specific resolution ( can be queried ). You can go the route of having assets for a few common resolution ( gotta do the research ), or redo your asset so that they correspond to some other metric, ex. aspect ratio, instead of fix resolution. Does your app works at any other resolution than 1024 x 768 currently ? If not, can you say why ?

Share this post


Link to post
Share on other sites

Let me explain...

I wrote the program one time and it was a real pain to create it in different resolutions.  I am rewriting it now.  It worked using three different dimensions but the problem was that it looked different in all three.  I am better at programming now.

I was considering scaling but if it only works if the ratio of width and the ratio of height are the same with regards to the image displayed on the two resolution to be the same size. (I got the ratio by dividing the screen widths together and dividing the heights together)  This became the multiplier for the scaling.

So, I want to use 1024 x 768 as my default resolution.  If all of the monitors still have 1024 x 768 useable, well it would use this default resolution and be fine.  If not, my idea was to also use some other very popular resolution that every new monitor would definitely have.

So, I was wondering if my idea is sound, and I'm pretty sure it is.

Now, finally,  If a different resolution is used there shouldn't be distortion.  The same images will be used and the extra screen real estate will be blacked out.  So, it would be like viewing the 1024x768 centered on 1360 x 768 with  (1360 - 1024)/2 = 168 px as borders on the left and right.  Get it?

 

To reiterate, the idea is that 1024 x 768 is still on every monitor, and if not than there is a choice for some other monitor resolutiom that every newer computer has.

 

I can't think of any need for a very high resolution for this project.

 

What do you  all think?

Josheir

Edited by Josheir

Share this post


Link to post
Share on other sites

There is scaling but with a testing circle the shape was less circular.  I guess there is some formula though because when hacking at the different width and height scaling the image would be fairly close to the same on both resolutions.  This was using 1024 x 768 and 1360 x 768.  1024 x 768 scaled to 800 x 600 fine (and the reverse too.)  

I would think if a circle displayed on different resolutions and was a perfect circle this would be proof for the ratio of the resolutions.

Josheir

 

Edited by Josheir

Share this post


Link to post
Share on other sites

If you're going to force me to your arbitrarily picked resolution, then at least let me run it windowed.  1024x768 looks horrible on my monitors full screen and my eyes tend to get sore after 20 minutes of playing or so and I quit and go and leave a horrible review/look for the refund button/uninstall button.  You can also scale non-uniformly your 2D art assets to make them look better at whatever resolution too as 1080p is far more common these days than 4:3 for monitors and even mobile devices.

Share this post


Link to post
Share on other sites
3 hours ago, Josheir said:

Secondly,  the SFML site mentions that IOS and Android are on the way for using SFML.  I am wondering what the resolutions are that I will need to use

Yes mobiles/tablets have different resolution screens and more importantly different aspect ratios.

What I do is create the render buffer to the same as the full screen resolution of the device BUT up to a maximum size at which point I use up-scaling, Currently the maximum is 720p on mobiles for me. You might want to read this (applies to Android)

https://android-developers.googleblog.com/2013/09/using-hardware-scaler-for-performance.html

Now the real problem is the different aspect ratios. It is best to create your render buffer at the correct aspect of the device and make you game handle this but you 'could' have black bars (not something I would do myself) but please base it on 16:9 aspect not your current 4:3 !

1 hour ago, Mike2343 said:

1024x768 looks horrible

Share this post


Link to post
Share on other sites
2 hours ago, Josheir said:

Now, finally,  If a different resolution is used there shouldn't be distortion.  The same images will be used and the extra screen real estate will be blacked out.  So, it would be like viewing the 1024x768 centered on 1360 x 768 with  (1360 - 1024)/2 = 168 px as borders on the left and right.  Get it?

I use a 4k monitor as my daily driver. I will literally not be able to play a game that sits in a 1024x768 box in the very middle of the screen, because it will be too small to make out. At the very least you need to scale that 1024x768 up to the height of the monitor.

Also consider that 4:3 resolutions haven't been standard for nearly a decade. All commodity monitors are 16:9, so you'd be inflicting black bars on 90% or more of your user base.

Share this post


Link to post
Share on other sites
1 hour ago, swiftcoder said:

I use a 4k monitor as my daily driver. I will literally not be able to play a game that sits in a 1024x768 box in the very middle of the screen, because it will be too small to make out. At the very least you need to scale that 1024x768 up to the height of the monitor.

I am trying to understand this.  Swiftcoder, what is the size of this monitor in inches (high and wide,)  and what is the resolution that your 4k is running this at?   Also, what type of device is it for?

Thanks,

Josheir

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!