# Representing multi-tile objects in a tilemap

I'm building an isometric tiled game, where the terrain and objects are represented by a 2-dimensional array of lists. Depth of objects on the map is derived from the tile (and a per-tile sorting routine), the objects are updated/drawn by going over the entire map, and it is important to know whether a tile is occupied or not for interaction/collision purposes.

Now, I want to have objects that are larger than a single tile (say, a 2x2 or 2x3 object). Drawing them this way is trivial, however, there is the occupation detection requirement. Putting the same object or dummy objects into the array merely to indicate that the tiles are taken doesn't seem like an elegant solution, but neither does checking surrounding tiles for possible big objects, each time the occupation status of a tile is requested.

Is there a more elegant solution that I've overlooked?

• The most reasonable solution in this case would be the former where you indicate the same object is in multiple positions in the map array. – AturSams Feb 17 '14 at 17:29

• Just a cheap suggestion... I had the same problem and resolved it by assigning each object an Area (which in the case of 1-tile objects was just this). Then I assign the main object to the primary tile and just the Area to the others. – Marco Bolis Dec 24 '14 at 12:29