bjorn/tiled — Issue #147: Tile layout favours some orthographic projections
Author: bgulanowski
Created: 2012-01-20 13:01:52+00:00
State: open

Tiled needs to be more compatible with different orthographic 3D projections. It can do so by allowing the user to select the tile layout strategy from any of four, instead of being restricted to only one, as it is now.

Overlapping only works properly if you do it a certain way. In the map demo I include an example of every tile in a pattern that would not look right without the tiles I made. They overlap a lot, but in carefully controlled ways. (Are you familiar with technical terminology of 3D projection?) The problem is that, in Tiled, while you can control the tile offset, you can't control the order in which the tiles are placed, so it makes some orthographic projections simpler than others.

Let's summarize what we know.

There are four degree orthographic projections align to 45 degree angles:
- 45 (up+right)
- 135 (up+left)
- 225 (down+left)
- 315 (down+right) *

Each of these can represent the entire set of orthographic projections for it's associated quadrant.

In a 2D game, you can make either vertical or horizontal maps (excluding hybrids). Each projection prefers a different overlapping strategy, depending whether you're making vertical or horizontal maps.

Because Tiled only supports laying tiles in one way (left to right, top to bottom), only two of those actually works naturally with the overlap enforced by tiled. (Even using the tile offset doesn't change this - the tiles are still laid down in the same order.)

The Tiled layout works perfectly with 45 for horizontal maps, and 225 with vertical maps.

In the game I am working on, we're using either 45 or 135 with a vertical map, so the overlaps always works against us some or all of the time.

Vertical maps using 135 degree projection (so you can see the top and left side of tiled "blocks") run against the layout on BOTH axes! To overcome this requires defining a whole bunch of tiles with corners clipped out for different virtual block shapes. This is quite annoying.

Vertical maps using 45 are compatible with Tiled in the X direction, but not the Y direction. (Tiles overlap properly from right to left, but not from top to bottom.) Horizontal maps using 45 degree projection are compatible in both directions, as are vertical maps using 315 (but only games that are primarily about crawling on the ceiling would use that projection).

It would be desirable for Tiled maps to use one of four layout techniques:

- left-right, top-bottom
- right-left, top-bottom
- left-right, bottom-top
- right-left, bottom-top

The horizontal layout can always happen first.

Thank you for your work on Tiled. It's possible I could help with this however I would have to familiarize myself with the Tiled source code first. But I'm an amateur with C++ and know nothing about Qt. Where in the code is the tile layout done?

Thanks again,
Brent