A dungeon of Wang tilesUn dungeon di tessere di Wang

Wang tiles are squares with a color on each edge, laid side by side only where the colors of the touching edges agree and never turned. Cohen, Shade, Hiller and Deussen (2003) used a set of 8 of them to cover large areas with texture: the tiles are laid row by row, each one drawn at random among those whose north and west colors agree with the tiles already in place, and with two tiles for every pair of colors the choice never runs out. Here the color of an edge is the position of its door, so that every tile of the set fits every neighbor it can meet, and the inside of each tile is a small cave or a set of corridors and rooms grown by one of two generators of game levels.

Le tessere di Wang sono quadrati con un colore su ogni lato, che si accostano solo dove i colori dei lati a contatto coincidono e non si girano mai. Cohen, Shade, Hiller e Deussen (2003) ne hanno usato un set di 8 per coprire grandi superfici di texture: le tessere si posano riga per riga, ciascuna estratta a caso fra quelle i cui colori a nord e a ovest coincidono con le tessere già posate, e con due tessere per ogni coppia di colori la scelta non manca mai. Qui il colore di un lato è la posizione della sua porta, così ogni tessera del set combacia con ogni vicina che può incontrare, e l'interno di ogni tessera è una piccola grotta o un insieme di corridoi e stanze fatti crescere da uno di due generatori di livelli di gioco.

A dungeon laid by scanline from the set below: walls in violet, floor in the color of the panel, tile borders as thin lines.Un dungeon posato riga per riga con il set qui sotto: muri in viola, pavimento nel colore del pannello, bordi delle tessere come linee sottili.
The tile set, with the door of each edge marked by its color (gold for the door at the fifth cell, lilac for the door at the eighth).Il set di tessere, con la porta di ogni lato segnata dal suo colore (oro per la porta alla quinta cella, lilla per quella all'ottava).
The relief tiles that are printed; drag to turn.Le tessere in rilievo che si stampano; trascina per ruotare.

Inside a tileDentro una tessera

A tile is a grid of 12 by 12 cells, whose border is wall except at its four doors. The caves are those of Johnson, Yannakakis and Togelius (2010): every inner cell is rock with probability 1/2, and in each of four steps a cell becomes rock when at least 5 of the 9 cells around it (itself included) are rock, which smooths the noise into caverns. The rooms come from the simple tiled model of wave function collapse (Gumin 2016), studied as constraint solving by Karth and Smith (2017): the tile is split into 4 by 4 blocks, each block keeps the list of modules (corridors and rooms with a given set of open sides) still compatible with its neighbors, and the block with fewest options is fixed at random, by weight, until none is left open.

Una tessera è una griglia di 12 per 12 celle, il cui bordo è muro tranne che alle sue quattro porte. Le grotte sono quelle di Johnson, Yannakakis e Togelius (2010): ogni cella interna è roccia con probabilità 1/2, e in ognuno di quattro passi una cella diventa roccia se almeno 5 delle 9 celle attorno (lei compresa) sono roccia, il che leviga il rumore in caverne. Le stanze vengono dal modello a tessere semplici del wave function collapse (Gumin 2016), studiato come soddisfacimento di vincoli da Karth e Smith (2017): la tessera è divisa in 4 per 4 blocchi, ogni blocco tiene la lista dei moduli (corridoi e stanze con un dato insieme di lati aperti) ancora compatibili con i vicini, e il blocco con meno opzioni viene fissato a caso, secondo i pesi, finché non ne resta nessuno aperto.

Both generators may leave a door cut off; the regions of floor that hold a door are then joined by the path that digs the fewest cells of rock, and the floor that no door reaches is filled; hence every door of a tile leads to every other one and any dungeon laid with the set is connected.

Entrambi i generatori possono lasciare isolata una porta; le regioni di pavimento che contengono una porta vengono allora unite dal cammino che scava meno celle di roccia, e il pavimento che nessuna porta raggiunge viene riempito, così ogni porta di una tessera porta a tutte le altre e ogni dungeon posato con il set è connesso.

Download for 3D printingScarica per la stampa 3D

A 3D print of this tile setUna stampa 3D di questo set di tessere

The tile set (or the dungeon shown above, tile by tile) can be ordered as a 3D print: each tile is a flat piece with a floor and walls about 10 mm high, which prints without supports, and the tiles can be laid in any order that matches the colors. The request sends the link to the set as it is on the screen.

Puoi ordinare il set di tessere (o il dungeon mostrato sopra, tessera per tessera) come stampa 3D: ogni tessera è un pezzo piatto con un pavimento e muri alti circa 10 mm, che si stampa senza supporti, e le tessere si possono posare in ogni ordine che rispetti i colori. La richiesta manda il link al set così com'è sullo schermo.

The tiles as separate closed solids on one plate (the set, or every tile of the dungeon), each a floor with walls on top, flat underneath and with vertical sides only, hence printable without supports. A door is one cell wide (a twelfth of the side); since the door of color 0 sits at the fifth cell and that of color 1 at the eighth, a tile turned by a half turn has its doors at the same positions with the colors swapped, so the printed pieces allow more layouts than the Wang rule.

Le tessere come solidi chiusi separati su un solo piatto (il set, o ogni tessera del dungeon), ciascuna un pavimento con i muri sopra, piatta sotto e con soli lati verticali, quindi stampabile senza supporti. Una porta è larga una cella (un dodicesimo del lato); poiché la porta del colore 0 sta alla quinta cella e quella del colore 1 all'ottava, una tessera girata di mezzo giro ha le porte nelle stesse posizioni con i colori scambiati, quindi i pezzi stampati consentono più disposizioni della regola di Wang.