Resolution pitfall

Started by
1 comment, last by Sollum 10 years, 8 months ago

Good evening lads,

Recently i have released an android game, few hundred of people downloaded it and THEN i understood that i screwed up.

At first, i was making my game for PC, with 480x800 ress. Then i thought "Hey, LISTEN! Lets port this to android!". So i did. I set android manifesto to support normal screens.

And then, after i released my game, i started getting messages that my game, looks too small on Samsung S3. Turns out its "normal" screen but with "high" density! 720p!

I was testing out my game mainly on 480p phones i had access to, and i cant run droid emulators (they take FOREVER to load and even if they load up, my application wont run on them).

Of course, i will simply make additional textures and UI for 720p, but i don't want to stumble into same pitfall again. How do you guys manage such things? Letting app go simply full screen screws up textures, as a lot of phones have their custom screen dimension standards (like mine for example), so i simply forced screen to go into 480x800 and have a black border around.

Are there any good or at least "ok" free libraries out there?

Advertisement

Generally, the best option is to just make it resolution independent, i.e. never rely on pixel-level accuracy at all. Plan for this beforehand and then you won't have much trouble with the graphics later, just make sure you scale the coordinates accordingly (if you're using hardware rendering the GPU will even do it from you, since the coordinate range is from -1 to 1 regardless of resolution).

Aspect ratio is a whole different problem you'll also stumble upon, though. Simply scaling won't help you here. You'll need to plan ahead of time and see how you can arrange the objects on screen. Generally you'll want to position everything relative to something else (e.g. one of the borders of the screen, the center of the screen, putting things next to another object, etc.).

Don't pay much attention to "the hedgehog" in my nick, it's just because "Sik" was already taken =/ By the way, Sik is pronounced like seek, not like sick.

I have a question about... why my images become "quady".

Today i bought Nexus 7.

Tried displaying simple image and it became "jagged" and "quady" for some reason.

thefuck.png

Code i use for texture loading


GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MIN_FILTER, GLES20.GL_NEAREST);
GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_MAG_FILTER, GLES20.GL_NEAREST); // if i remove this line, it will look better, but i dont get it, why?
GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_S, GLES20.GL_CLAMP_TO_EDGE);
GLES20.glTexParameteri(GLES20.GL_TEXTURE_2D, GLES20.GL_TEXTURE_WRAP_T, GLES20.GL_CLAMP_TO_EDGE);

Blending code:


GLES20.glEnable(GLES20.GL_BLEND); 
GLES20.glBlendFunc(GLES20.GL_SRC_ALPHA, GLES20.GL_ONE_MINUS_SRC_ALPHA);
//GLES20.glBlendFunc(GLES20.GL_ONE, GLES20.GL_ONE_MINUS_SRC_ALPHA);
GLES20.glEnable(GLES20.GL_DEPTH_TEST);

Thing is, texture is 400x400 and is placed as 400x400 object. But it just doesnt look right :/

Edit: Solved

This topic is closed to new replies.

Advertisement