Tuesday, April 1, 2014

5-Star Rush

I'm putting Psytech on the back burner for now because I'm looking to make my first Android game.


Being a pixel art game, it truly is a pain in the ass trying to make images for multiple resolutions. Since Android has no set standard, I'm out of luck there (I really love pixel art). I've decided to stick to a small virtual width and height (240x400) and just scale up to fit higher resolutions. This is so it hopefully doesn't look too bad using nearest mag filter to keep that pixel art feel.

EDIT:
The real problem is the different aspect ratios. It looks like the most common ones are 1.6, 1.666 (the one this game is currently fit for), 1.777, and 1.78 (lol?). Okay so if I fix the 400px height, then the widths are 250px for 1.6, 240px for 1.666, and 225px for 1.777 and 1.78. If I don't want to have any black bars, I should go with the max size of 250x400 for the background image, and cut down the actual game "play area" to the smallest 225x400. Then I make sure to keep the camera centered so higher ratios crop out the extra background space. That would probably work since it's only a few extra background pixels. (sorry tablets, you're going to have to go with an aspect ratio altering stretch). I'm getting the Galaxy S4, which is 1920x1080 (1.777), so it'll be that perfect fit for 225x400 with no extra background space.

Oh, and I just tried LibGDX's texture packer. This is probably the niftiest tool ever created. I don't know why I haven't tried using it before. One pack per screen would be excellent. Mr. Aurelien Ribon has created a very handy GUI for the texture packer. You can find it here:
http://www.aurelienribon.com/blog/2012/06/texturepacker-gui-support-for-multiple-packs/

I've been thinking about this game for a long time, so I've already scribbled out all the game mechanics on paper. It's just a matter of translating it to code.

5 comments:

  1. Hello You can fix different aspect ratio by adjusting camera on state in resize method. It's very simple and give good effects with this problem.

    ReplyDelete
    Replies
    1. Yes. I've figured that out. I was just worried about how forced stretching to different aspect ratios would distort the game, so I decided to crop instead, to keep the aspect ratio the same.

      https://dl.dropboxusercontent.com/u/59779278/help/images/screenshot1.png

      I don't know how effective this will be for tablets though. The aspect ratios for those are too square.

      Delete
    2. If you like i can test it out on Nexus 7 tablet but i do it form some time and it works on tablet and phones. Tablets is 16:10 common resolution and you simple must implement it and i think it works fine.

      Delete
    3. Oh wow. I didn't know most Android tablets are 16:10. I always thought they were 4:3. I should do some more research first.

      But still, for anyone using a 4:3 tablet, the game is going to have black bars on the sides. Or I can try to detect the aspect ratio, and stretch instead if it's 4:3.

      Delete
  2. I look on most popular tablets segment and there is 7" or 10,1" displays and this is around 16:10. You may seek and find other aspect ratio tablet but this is less popular devices.
    Generally if you want to make Android game you must know that not all devices is compatibile with it.

    ReplyDelete