Use marching squares for tile rendering.

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

Post Reply
uber5001
Burner Inserter
Burner Inserter
Posts: 15
Joined: Thu Sep 15, 2016 8:30 pm
Contact:

Use marching squares for tile rendering.

Post 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.

IronCartographer
Filter Inserter
Filter Inserter
Posts: 454
Joined: Tue Jun 28, 2016 2:07 pm
Contact:

Re: Use marching squares for tile rendering.

Post by IronCartographer »

For the lazy: https://en.wikipedia.org/wiki/Marching_squares

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

Jap2.0
Smart Inserter
Smart Inserter
Posts: 2339
Joined: Tue Jun 20, 2017 12:02 am
Contact:

Re: Use marching squares for tile rendering.

Post 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.
There are 10 types of people: those who get this joke and those who don't.

Post Reply

Return to “Ideas and Suggestions”