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?


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.

  • 2
    \$\begingroup\$ +1 for second approach. Basically that moves you from tile map to on-map objects. \$\endgroup\$ – Kromster says support Monica Jul 13 '11 at 9:12
  • \$\begingroup\$ 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 \$\endgroup\$ – 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.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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