CodingTrain / CodingTrain/Wave-Function-Collapse

Encoding tiles symmetry and rotation

Offen
#14 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
JavaScript
Sterne
218
Forks
64
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

The base implementation notes that you can "Augment pattern data with rotations and reflections."
I don't think you need reflections for the circuit problem but you might run into it with more complex setup.

Let's assume you don't need reflections.
For rotations you need to have 4 letters that indicate the orientation of the piece.

For this issue let's call them :
- S -> straight
- L -> rotated 90° to the left
- F -> "flipped" but really it's rotated 180°
- R -> rotated 90° to the right

So this tile :
![4](https://user-images.githubusercontent.com/6383717/165170799-f486d23f-3919-4be4-bdf1-70ce30269eaf.png)

would have edges 4S, 2, 4S, 0

And this one :
![5](https://user-images.githubusercontent.com/6383717/165170893-5cb8e058-7ba7-48ba-b9ca-49da56452140.png)

would have : 4S, 1, 1, 4R

Now the complicated bit is that you have to account for that whenever you are rotating a piece.
For a Left (90°) rotation :
- every S becomes L
- every L becomes F
- every F becomes R
- every R becomes S

This also fixes the problem of having 5.png left edge connecting to a 4S the wrong way because it will never be a 4S AND a top facing edge at the same time.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Beginne damit, die Basisimplementierung zu lesen und nachzuverfolgen, wo die Kachelmusterdaten gedreht werden. Kodiere die vier Orientierungen S, L, F und R und überprüfe, dass das Drehen eines Teils jede Orientierung konsistent aktualisiert, ohne Spiegelungen hinzuzufügen. Erledigt ist die Aufgabe, wenn die beschriebenen Kantenkombinationen nach jeder Drehung weiterhin korrekt ausgerichtet sind.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
javascript
Bereich
game-dev
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.