The issue with asymmetric tiles and an easy solution
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 40/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Veraltet
- Tech-Stack
- javascript
- Bereich
- game-dev
Rechercherichtung
Es werden keine Dateien, Tests oder Einstiegspunkte genannt. Lokalisieren Sie die Logik zum Abgleichen der Kachelseiten, verfolgen Sie, wie Seitencodes erzeugt und verglichen werden, und verifizieren Sie anschließend, dass symmetrische Seiten weiterhin mit sich selbst übereinstimmen, während asymmetrische Seiten nur mit ihrer umgekehrten Darstellung übereinstimmen.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
the issue with the tiles in hand is the asymmetry
when you have a symmetric side on the tile, they can match to themselves (meaning the key you assigned to them), like in the first row here:

But as you can see in the second row, when dealing with tiles with asymmetric sides, the matches are incorrect. The logic used to match sides (having the same code) is not valid for asymmetrical sides, as it allows them to match themselves which is wrong visually.
A quick fix for this is to use a more complex code to identify sides and update the logic that finds that two sides match. My quick fix is to use a 3 character key for each side: '000', '111', '222', '333', ... , 'aaa', 'bbb', 'ccc', etc and for the asymmetrical sides use values as '001' and '100' for their mirrored side. When matching sides instead of comparing their code, you must compare their code vs the reversed string of their code. In this way, '000' matches '000' (which keeps symmetrical sides working just fine) but '001' will only find a match in the reversed key '100' fixing asymmetrical sides.
In the previous example 4 becomes '001' and 5 becomes '100', allowing for them to match to the correct side but not themselves.
Annex:
My suggested solution was to create a method that figures out 3 pixels colours for each side of the tile: left, center and right. Once you have them create an array with those 3 values. To connect a tile to another, just compare the array to the reverse order of itself. This implements the symmetrical / asymmetrical solution and will allow for interchangeable tiles on the fly.
- Vorherrschende Sprache
- JavaScript
- Sterne
- 219
- Forks
- 64
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus CodingTrain/Wave-Function-Collapse
-
Optimize grid updatesOffen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 20/100
CodingTrain/Wave-Function-Collapse#41 · 2 Reaktionen ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
CodingTrain/Wave-Function-Collapse#38 · 2 Kommentare ·
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
CodingTrain/Wave-Function-Collapse#37 · 1 Kommentar ·
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 42/100
CodingTrain/Wave-Function-Collapse#35 · 1 Kommentar ·
-
Do NOT make a new gridOffen
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 30/100
Alle Issues in CodingTrain/Wave-Function-Collapse
Ähnliche Issues
-
bug user-priority/P2
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
t8y2/dbx#11718 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug confirmed perf
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
videojs/video.js#9400 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
agent/scanner bug hive/hosted-available-lke648397-260827-5n31
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
rescript-lang/rescript#8765 ·
Maintainer antworten meist innerhalb von 1 Tag
-
feedback simulation workshop
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
githubnext/gh-aw-workshop#4417 ·
Maintainer antworten meist innerhalb von 1 Tag