I'm creating a simple grass/dirt tileset. I'm able to create a seamless tileset by creating 1 unique piece per "direction"... however, this breaks down when trying to create more than one unique piece, because the edges don't line up perfectly.

I image this can be resolved by ensuring any duplicate tiles end on the same pixel of the touching edge, but is there a trick or algorithm etc that can be followed to ensure they line up without counting the exact pixels?

You can see in the image below, it looks "ok", but there's artifacting due to the grass not lining up when a secondary tile is placed.

Tile Examples

  • \$\begingroup\$ Are you looking for an algorithm or technique that can account for such irregularities, or are you looking for an algorithm or technique that can prevent such irregularities? Edit: For the former, wave collapse algorithm comes to mind. For the latter, I'd say use guidelines in your image editor. \$\endgroup\$
    – Theraot
    Jan 3 at 3:39
  • \$\begingroup\$ Wave collapse is interesting, I'll check that out! But for this question, am looking more for techniques, or perhaps tricks to generate multiple tiles that work well together. It seems maybe the best way is to just manually ensure that edges line up when drawing. Was hoping there'd be some commonly used techniques to avoid the need for that level of precision in the art. \$\endgroup\$ Jan 3 at 7:24
  • \$\begingroup\$ I describe one method for ensuring consistent seams in an autotile here. It's still elbow grease, but the structured approach can make it a little easier to get a seamless tiling starting point. \$\endgroup\$
    – DMGregory
    Jan 3 at 13:34
  • \$\begingroup\$ Thanks for the tip, that technique will come in handy! In my case, since I'm working with 16x16 tiles, and they specifically only need to line up where the grass meets the edge, I was able to accomplish it by ensuring all tiles ended with grass at the 8px mark. I do wonder how that will affect things artistically down the line, but it sure makes it easier to generate multiple tile variations \$\endgroup\$ Jan 3 at 22:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.