drogoganor / OpenDR

A work-in-progress recreation of the Auran RTS classic for the OpenRA strategy game engine.
GNU General Public License v3.0
65 stars 1 forks source link

Terrain tile masking/blending #18

Open drogoganor opened 6 years ago

drogoganor commented 6 years ago

Dark Reign had a great system for creating smooth transitions between terrain tile types. It was explained in the very detailed Tactics Engine manual included with the game. Here is the relevant section:

TE manual - tilesets

And here's the end result:

tile blending

The gist of it is that there are 4 values stored for each tile; one for each corner. In the level editor, the tile paint brush is offset by half a tile size, so the user is painting at the corner of 4 tiles instead of the middle of one tile.

The terrain engine then devises edge and corner masks (greyscale images) which are used to blend between the two different tile types. The end result looks really natural.

OpenRA currently only supports one value per tile, but apparently we might be able to add a field defining a custom tile data chunk size(? Unsure of terminology).

Currently DR looks very blocky without this tile blending:

no tile blending

This missing feature has elicited a few inquiries recently, so I thought I should write it up.