ldtk icon indicating copy to clipboard operation
ldtk copied to clipboard

Stamp Placement Alignment

Open nyalloc opened this issue 3 years ago • 1 comments

LDtk current supports stamps by allowing tiles to be selected using the X modulo and Y modulo modifiers, each letting the user apply the rule every N tiles.

image

Because of this, automatically applied stamps, like those in the LDtk samples, have the appearance of being aligned to a grid.

image

A level may want to apply stamps in such a way that they are not aligned to this implicit grid. For example:

image

Using the X modulo and Y modulo modifiers to apply this 2x2 stamp, attempting the above design will result in the following result.

image

Stamps are are only applied when the start tile is on an even X and an even Y. If the start tile is on an odd X or Y coordinate, it does not apply the stamp.

I think we should investigate how we can achieve a more generalised form of automatic stamping in LDtk.

nyalloc avatar Jan 25 '22 23:01 nyalloc

Actually, after some testing, it seems that such a change would have lots of complicated implications:

  • this change would break lots of existing content
  • painting on one specific coordinate has cascading consequences on tiles very far away in the level (like the full level), creating some potential big performance issues
  • evaluating rectangle of tiles instead of single tiles has a big impact on performances for all existing rules
  • in some cases (eg. a "Tree" stamp), discarding would not be a desired effect

So I'll move this issue to the backlog and see if that could be done after a potential rework/optimization of the current Rule system.

deepnight avatar Jan 27 '22 09:01 deepnight