deepnight / ldtk

Modern, lightweight and efficient 2D level editor
https://ldtk.io
MIT License
3.37k stars 184 forks source link

Stamp Placement Alignment #576

Open nyalloc opened 2 years ago

nyalloc commented 2 years ago

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.

deepnight commented 2 years ago

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

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.