Question about tmx files (tilemaps) and resolution for Iphone 3gs, Ipad, and Retina

Nibbie
Posts: 4
Joined: 2011.01
Post: #1
Hello everyone.

I have a question about the tmx files and sprites in relation to the different displays. I can't find a straight answer anywhere!

Question is in order to have a game display properly on all 3 displays, WHAT NEEDS TO BE DONE?

-Do I need to have 3 versions of the same tilemap (tmx) for each display?

-If the aspect ratios on the displays are different, how can I preserve the look of my sprites? I keep reading x2, but that doesn't solve the apsect ratio deal.

I currently laid out 45 levels using Tiled and created my graphics with the display for IPAD in mind first (since it's easier to scale an image DOWN later)

So what do I need to do now to have the code (cocos2d) recognize the coordinates of objects for all 3 displays? Is there a really easy way of doing the downscaling that I am not seeing? Am I overthinking this and the screens will automatically do it all? So if I open my Ipad version on an iphone, it will just scale down on its own?

This is very confusing and no good documentation on it.

Thanks in advance!
Quote this message in a reply
Sage
Posts: 1,482
Joined: 2002.09
Post: #2
There was a post on Cocos2D's blog about how it moved from pixels to points as a default scale. In Apple's terminology, a point is 2 pixels on retina devices and 1 pixel on other devices. All you really need to do is provide 2x sized textures.

It's fairly easy to scale textures down when loading them if using CoreGraphics, but you can't really use Cocos2D's convenience loading functions then. While using double sized textures will affect performance some, just try it first. If the performance is fine then don't bother scaling things down.

Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Quote this message in a reply
Nibbie
Posts: 4
Joined: 2011.01
Post: #3
Thank you for replying!

The main issue is regarding the tile maps and coordinates. In tiled, aren't the tilemaps that are generated pixle based? How do I make cocos recognize what I do on the tmx files as points?
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #4
Your game needs to work at both aspect ratios and all three resolutions. I don't know whether Cocos2D does anything to help you with this.

The iPhone version will be pixel-doubled automatically on the iPhone 4 if you don't handle that case.
Quote this message in a reply
Nibbie
Posts: 4
Joined: 2011.01
Post: #5
Thank you for the reply OneSad Cookie, but I don't think you read my post.

I specifically said I have created the game thus far for Ipad resolution because it's always easier to scale images down and not loose quality.

And obviously it needs to work at both aspect ratios and resolutions....that's what I made this post to start with lol.

The questions is HOW do I make it work on all 3 properly? DO I need all different tile maps (tmx files) for each resolution???
Quote this message in a reply
Sage
Posts: 1,482
Joined: 2002.09
Post: #6
There is no correct answer. Going from normal iPhone to retina is easy (at least code wise), you just need higher resolution assets. The aspect ratio and screen size stays the same so there aren't really any surprises. You don't need a different tilemap, just higher resolution textures to use with it.

The iPad is different because it has a different aspect ratio and overall screen size. For non-UI stuff, you can really just double the resolution of the assets as well as expand the screen size slightly. The UI stuff largely needs to be rewritten though as you don't want gigantic UI buttons and such on the screen. It can look a bit silly.

Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Quote this message in a reply
Nibbie
Posts: 4
Joined: 2011.01
Post: #7
Thank you Skorche, I appreciate your help. I will lay it out and keep you guys posted on my progress.
Quote this message in a reply
Ingrid
Unregistered
 
Post: #8
(Jan 6, 2011 03:11 PM)appsolutecreations Wrote:  Hello everyone.

I have a question about the tmx files and sprites in relation to the different displays. I can't find a straight answer anywhere!

Question is in order to have a game display properly on all 3 displays, WHAT NEEDS TO BE DONE?

-Do I need to have 3 versions of the same tilemap (tmx) for each display?

-If the aspect ratios on the displays are different, how can I preserve the look of my sprites? I keep reading x2, but iphone 4 case doesn't solve the apsect ratio deal.

I currently laid out 45 levels using Tiled and created my graphics with the display for iphone 3gs case in mind first (since it's easier to scale an image DOWN later)

So what do I need to do now to have the code (cocos2d) recognize the coordinates of objects for all 3 displays? Is there a really easy way of doing the downscaling that I am not seeing? Am I overthinking this and the screens will automatically do it all? So if I open my Ipad version on an iphone, it will just scale down on its own?

This is very confusing and no good documentation on it.

Thanks in advance!

Hello, you should need to have 3 versions of the same tilemap (tmx) for each display.
Quote this message in a reply
Sage
Posts: 1,482
Joined: 2002.09
Post: #9
Oh spam bots. When will they learn that answering a question by repeating the same sentence makes you obvious. WHEN WILL THEY LEARN!

Scott Lembcke - Howling Moon Software
Author of Chipmunk Physics - A fast and simple rigid body physics library in C.
Quote this message in a reply
Moderator
Posts: 452
Joined: 2008.04
Post: #10
(Jun 3, 2011 06:19 AM)Skorche Wrote:  Oh spam bots. When will they learn that answering a question by repeating the same sentence makes you obvious. WHEN WILL THEY LEARN!

That probably makes this guy pretty suspicious: http://www.idevgames.com/forums/thread-9...l#pid70735

Howling Moon Software - CrayonBall for Mac and iPhone, Contract Game Dev Work
Quote this message in a reply
Apprentice
Posts: 8
Joined: 2012.03
Post: #11
HD2x is a tool which can easily convert images and tmx files, from hd to sd or sd to hd... it may help you to convert your tmx in the 3 formats.
http://www.sovapps.com/?page_id=7
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Scaling iOS Game: iPhone -> iPad s0ckman 2 1,396 Dec 9, 2013 07:34 AM
Last Post: s0ckman
  Music bitrate for ipad and iphone games Bambinou 5 9,726 Nov 19, 2011 07:02 PM
Last Post: fugufish
  frame buffer 320x480 scaling images/2=retina? sefiroths 0 4,210 May 10, 2011 05:24 AM
Last Post: sefiroths
  Regarding resolution and screensize across iPhones and iPad lykkegaard 1 4,566 Mar 15, 2011 03:22 PM
Last Post: monteboyd
  Parsing XML files, on iPhone.. Jamie W 13 12,326 Jan 26, 2011 03:12 PM
Last Post: warmi