The issue with asymmetric tiles and an easy solution
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 40/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript
- Lĩnh vực
- game-dev
Hướng nghiên cứu
Không có tệp, bài kiểm thử hoặc entry point nào được nêu tên. Hãy xác định logic đối sánh phía của tile, theo dõi cách các mã phía được tạo và so sánh, sau đó xác minh rằng các phía đối xứng vẫn khớp với chính chúng, trong khi các phía bất đối xứng chỉ khớp với biểu diễn đảo ngược của chúng.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- JavaScript
- Star
- 219
- Fork
- 64
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của CodingTrain/Wave-Function-Collapse
-
Optimize grid updates Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 20/100
CodingTrain/Wave-Function-Collapse#41 · 2 reaction ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
CodingTrain/Wave-Function-Collapse#38 · 2 bình luận ·
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
CodingTrain/Wave-Function-Collapse#37 · 1 bình luận ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 42/100
CodingTrain/Wave-Function-Collapse#35 · 1 bình luận ·
-
Do NOT make a new grid Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
Tất cả issue của CodingTrain/Wave-Function-Collapse
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
palladius/rails8-app-on-gcp#145 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
dotenvx/dotenv-vscode#139 ·
-
test-change-proposal
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
web-platform-tests/interop#1455 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
corsairdev/corsair#1764 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100