Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

enter image description here

Here is what I want to do with my tile map that I am unsure of. As you can see the top walls are way larger then the bottom and side ones (this is also an issue with my corners which are odd shapes [more like an L then a square] as well as larger then the 40x40px that my current tiles are).

enter image description here

I have also attached the tile sheet I am using for the tiles to show you what the corners and tops look like compared to the rest of the tiles.

What I’m thinking is I might be able to just draw them using the same array I have if I use the tiles width and height instead of a set WxH? I dont know how well this will work, but were the blocks that will have different values will be blocks the player/NPCs can’t step on then it may not be an issue, again I’m not even sure if that is a viable solution.

My code in case you want to see how I'm currently handling it: Map.java (pastebin) (edit:im not handling it, meant how I'm currently doing the map)

tl;dr - how can I take take my 2d looking tile map and change it to have different size tiles? or is there a better way to do what I am trying to do? Is there a name of a method that I should be looking for while googling?

share|improve this question

2 Answers 2

up vote 17 down vote accepted

There are two standard ways of doing this.

  • Break up your non-standard tile sizes into standard tile sizes. So those strips of walls become a "stack" of square tiles that you just know to place together in your level editor. Games like the early Final Fantasy games worked this way.
  • Let any tile piece be taller than your standard tile height. Align tiles to the bottom of your tile rectangle, allowing any extra to draw higher than the usual tile height. When drawing your map, you draw tiles starting from the back (the tile squares higher on the screen), and ending with the bottom tiles (the ones at the bottom of the screen). This ensures that tall tiles in the foreground are properly overlayed on top of tiles in the background. Note that in this approach, your tiles are still limited to a single tile in width.

You can do either or both of these approaches. Even games which do the "break up into stacks of tiles" approach will often allow some objects (trees, etc) to break the tile height limits, and just enforce a top-to-bottom map draw ordering in order to make sure everything layers correctly.

share|improve this answer
1  
+1 for second approach. Basically that moves you from tile map to on-map objects. –  Krom Stern Jul 13 '11 at 9:12
    
Perfect thank you very much, I thought it might be something similar to the second option, but I wanted to make sure that I was doing it a standardized way. =D –  Latency Jul 13 '11 at 11:24

Slice and dice your odd sized tiles to fit the standard dimensions. The whole point of a tile map is that you get a lot of speed and utility by same-sizing everything.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.