Skip to content

Replacing a tileset image with a compatible but larger one breaks the tiles #300

Description

@keir

This happened to me when I extended my tileset image to make room for more tiles.

Steps to reproduce:

  1. Create a tileset using an image NxM pixels (e.g. 160x160); file: tileset_small.png
  2. Create rules to autotile based on the tileset
  3. Create a level using those autotile rules.
  4. Outside of LDtk, expand the canvas size of the tileset image from 160x160 to e.g. 160x320; file: tileset_big.png
  5. In LDtk, open tileset dialog, click "Replace image", select tileset_big.png

Expected behaviour
Existing level remains exactly as before. Additional tiles are free for use in rules.

Actual behaviour
Tiles are scrambled. Appears to be because the tiles are not remapped preserving the location, and are instead mapped by a linear ID that assumes the image does not change dimensions.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions