Page 1 of 1

Use marching squares for tile rendering.

Posted: Sun Jul 23, 2017 9:01 pm
by uber5001
This is a solution to some of the problems presented in FFF-199.

The gist of marching squares is that instead of drawing a Land tile and a Water tile, instead you draw the tiles in between Land and Water. In a 2D game, every tile is visually placed between 4 terrain-grid-squares (the current tiles). You can implement this without making many new visual assets. The current tiles are perfect.

Oddly enough, it seems the current tile system is just a complex version of marching squares, where each tile relies on itself and 8 neighbors (see Moore neighborhood), instead of 4 neighbors (see Unaligned rectangular neighborhood).

Here's a gif:
Image\

Here's a working demo: factorio-tiles

Here's a reddit post: Here's how water and grass *should* interact. Just click and drag.

Re: Use marching squares for tile rendering.

Posted: Sun Jul 23, 2017 9:12 pm
by IronCartographer
For the lazy: https://en.wikipedia.org/wiki/Marching_squares

Good work. You took this suggestion/feedback to the next level. :)

Re: Use marching squares for tile rendering.

Posted: Mon Jul 24, 2017 12:18 am
by Jap2.0
Yep, this is pretty much perfect. My only problem (which is so miniscule that it isn't even really worth considering) is that the transitions are slightly inside the grass tiles, not really on the borders (which would be better in my opinion), but that could be changed very easily by moving some things a few pixels, or straight out ignored because this is already so much better.