The issue with asymmetric tiles and an easy solution
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 40/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Stack tecnológico
- javascript
- Área
- game-dev
Línea de trabajo
No se nombran archivos, pruebas ni puntos de entrada. Localiza la lógica de coincidencia de los lados de las teselas, rastrea cómo se generan y comparan los códigos de los lados y, después, verifica que los lados simétricos sigan coincidiendo consigo mismos, mientras que los lados asimétricos coincidan únicamente con su representación invertida.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- JavaScript
- Estrellas
- 219
- Forks
- 64
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de CodingTrain/Wave-Function-Collapse
-
Optimize grid updates Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 20/100
CodingTrain/Wave-Function-Collapse#41 · 2 reacciones ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 35/100
CodingTrain/Wave-Function-Collapse#38 · 2 comentarios ·
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
CodingTrain/Wave-Function-Collapse#37 · 1 comentario ·
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 42/100
CodingTrain/Wave-Function-Collapse#35 · 1 comentario ·
-
Do NOT make a new grid Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 30/100
Todos los issues de CodingTrain/Wave-Function-Collapse
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
Theme loads third-party resources on every page (jsdelivr web font, cdnjs Font Awesome) – GDPR Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
docToolchain/docToolchain#1705 ·
-
Timezone select lists one option per character; duplicate "Failed" reason; shared tracker popover id Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
nightscout/nocturne#1414 ·
-
bug v2
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
modelcontextprotocol/inspector#2458 · 1 comentario ·
-
Mend: dependency security vulnerability status: needs triage 🕵️♀️
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
carbon-design-system/ibm-products#9907 ·