1

I started to write a small engine to render a 2d isometric map. A friend of mine made a small basic image of a train station to use example art for my engine. I tried to import the .png into tiled and create a tileset for it, to then use the information for the rendering of that house.

When I import the image, tiled cuts off the edges of the picture (see attachment "tiled .png import to tileset") on the right and bottom side. I looked into the menus and tried to find information about it but I could'nt find any helpful advice why it happens.

tiled png import to tileset

Another thing I find curious is the information within the .tsx file:

<?xml version="1.0" encoding="UTF-8"?>
<tileset version="1.2" tiledversion="1.2.1" name="bAHNHOF" tilewidth="30" 
         tileheight="30" tilecount="195" columns="13">
  <image source="bAHNHOF.png" width="401" height="468"/>
</tileset>

Shouldn't columns(13) multiplied by tile width(30) result in width of the imported image (i.e. 401). It only is 390 though, so roughly 11 pixels less then the original width.

I probably made a mistake somewhere or am confusing something. Maybe someone can help me?

Thanks in advance :)

Tremah
  • 103
  • 8
  • Seem like whatever editor you are using wants "whole tile" sizes. This is not uncommon. Increase the size of your base image so that the X and Y align to tile size boundaries to prevent this. 30 for a tile size is also very unusual. I'd expect a power of 2 like "32" or "16". Going to make this an answer as I think it will solve it for you. – Michael Dorgan Nov 30 '18 at 18:08

1 Answers1

3

Seem like whatever editor you are using wants "whole tile" sizes. This is not uncommon. Increase the size of your base image so that the X and Y align to tile size boundaries to prevent this. 30 for a tile size is also very unusual. I'd expect a power of 2 like "32" or "16".

In short, your importer is culling tiles that are not full size. I'd expect it to display a warning about image size before it did this, but who knows as you didn't state the programs.

When this goes onto whatever platform you are using, a power of 2 tile size will help as well in terms of efficiency, so consider making that change sooner rather than later as well.

Finally, often tiling is done to save memory. If, when you divide up your image into tiles (tile it), you can create identical tiles, the computer can use that knowledge to lessen the amount of memory is needed.

Michael Dorgan
  • 12,453
  • 3
  • 31
  • 61
  • hello and thanks for the reply. the editor is called tiled as in https://www.mapeditor.org. The tiles will be 32x32, 30 was just what the editor had as a default value and I am still only trying to get into the entire subject. I'll try what you said :) – Tremah Nov 30 '18 at 21:48
  • I did what you suggested and it worked fine. I scaled the source image to 320x320 and changed the tile size within tiled map editor to 32px. now the image is imported correctly and everything works fine, thx a lot :) – Tremah Dec 01 '18 at 03:36