Wangscape / Wangview

Parse Wangscape's output and generate random map from the tilesets
MIT License
4 stars 1 forks source link

Isotropic terrain generation #5

Open serin-delaunay opened 7 years ago

serin-delaunay commented 7 years ago

Currently Wangview generates terrain in rows. When using tilesets that have an incomplete hypergraph (for instance example3, where no three-way borders are allowed), this produces visual artefacts in the form of columns.

In more complex tilesets the terrain generator would have more freedom to avoid these kinds of issues, but it would be good to make a terrain generator which works the same way in both axes,

serin-delaunay commented 7 years ago

Making an algorithm that generates terrain maps from the same distribution when building by rows or by columns might not be feasible, but a simple step towards removing the column artefacts would be to make row/column generation favour terrains which differ from the corresponding tile in the preceding row/column.

serin-delaunay commented 7 years ago

This could be done easily by placing a simple constraint on Wangscape terrain clique structure: one clique would be a "central" clique, and all other cliques would have to have at least one terrain from the central clique. Then regions could be grown from seed locations, and any incompatible borders between regions could use terrain from the central clique as a buffer.

If an algorithm like this is used in Wangview, using such a clique structure in Wangscape should be optional. However, it may be useful for the user to indicate which clique should be considered central.